Protractor uses WebDriverJS under the hood.
WebDriverJS uses the concept of "control flow" to ensure async tasks are executed in the expected deterministic order.
So the following will work as expected:
myElement.click();
browser.executeScript(...);
BUT, if I add a function to the then of the promise returned by one of these functions on browser, will everything just continue to work in the expected way?
For example:
browser.executeScript(...).then(function() {
browser.navigate(...);
});
Will control flow be maintained with the above code?