javascript - WebDriverJS control flow -
protractor uses webdriverjs under hood.
webdriverjs uses concept of "control flow" ensure async tasks executed in expected deterministic order.
so following work expected:
myelement.click(); browser.executescript(...);
but, if add function of promise returned 1 of these functions on browser, continue work in expected way?
for example:
browser.executescript(...).then(function() { browser.navigate(...); });
will control flow maintained above code?
should be. it's called framing in webdriverjs' documentation:
flow.execute(function() { console.log('a'); }).then(function() { flow.execute(function() { console.log('c'); }); }); flow.execute(function() { console.log('b'); }); // // c // b
Comments
Post a Comment