-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Make it easier to control when ignoreSynchronization
is off or on
#1939
Comments
Can we just wrap all our command in control flow, and make a function that sets ignoreSynchronization in control flow. i.e. if (ignoreSynchronization) {driver.get(...)}
else {waitForAngular(); driver.get(...)} after: flow.execute(function() {
if (ignoreSynchronization) {driver.get(...)}
else {waitForAngular(); driver.get(...)}
}) and make setIgnoreSynchronization = function(val) {
flow.execute(function() {
ignoreSynchronization = val;
})
} This will make cloning browsers more robust too |
Yeah, I think that's reasonable and probably the simplest way to do it. The hardest bit will be making clear docs about usage :) |
If this were implemented.. I wonder if synchronisation could be turned off automatically by 'get' operations, and on when an action is performed that interacts with the page. i.e waitForAngular()
click() - turn on sync
waitForAngular()
getText() - turn off sync
getText() - turn off sync
getText() - turn off sync
getText() - turn off sync
getText() - turn off sync
click() - turn on sync
waitForAngular()
getText() - turn off sync Does that make sense? I think in some cases it could result in a fairly reasonable performance improvement, without the overhead of having to manage the sync on and off manually. |
@smhc I think that's out of scope for this change, but I'm working on an entirely new way of doing waits that will incorporate this sort of smart waiting. Stay tuned :) |
Any update on this? I was wondering about even just retrieving browser.ignoreSynchronization as a promise or setting/getting within the context of the control flow somehow.
So then in waitForAngular() you can have
It would be nice to have the ability to use ignoreSynchronization within various points in the control flow. It seems to work ok when changing in onPrepare, beforeEach, or afterEach, but it isn't very useful when trying to change in the middle of a test. |
Has this been addressed by cae175c ? |
@smhc: No, By the way, I like your previous suggestion of waitForAngular after click (and navigate, sendKeys, etc), and have been thinking about incorporating it into my page objects. It would be interesting to see if there is any performance benefit. |
We'll have an opportunity to fix this when moving to Blocking Proxy. See #3375 |
In #3813, we added |
It's kind of difficult to know how it interacts with the control flow at the moment.
The text was updated successfully, but these errors were encountered: