Dealing with very long running $timeout calls
My app has a $timeout call that lasts about an hour and it's legit to use the app while this timeout is running. While my use case might be excessive, I don't think it's far fetched for other apps to have background timers waiting for a long period of time (even as much as 30 seconds would cause issues).
The only workaround I can see is doing browser.ignoreSynchronization = true; but that's not very civilized - in fact I found this out while trying to fix some other issues that are cleanly handled by synchronization.
Is there a known or preferred way I can mark a particular call and say "that $timeout over there, ignore it and sync anyways"?
Thanks for the awesome work all!
You can use $interval in Angular to get a similar effect to $timeout, without tripping up Protractor. See https://docs.angularjs.org/api/ng/service/$interval and https://github.com/angular/protractor/issues/169#issuecomment-26442090
@tullmann Thanks! My team wound up deciding on having the $timeout call be shut off by a browser.driver.executeScript call. While both solutions are require changes to accommodate the test suite, the team's motivation is that keeping $timeout is less surprising given the intent, and the workaround as it manifests in the runtime code isn't centric to Protractor itself.
That said, if anyone wants to use $interval, it's about a 3 line change.
I noticed this issue, and I don't think this is a valid resolution - it does not make sense for all third party libraries to change their code to $interval usage due to this deficiency.
I just recently closed an issue in UI Bootstrap where a request was made to do this switch, but this should truly be handled by Protractor properly.