Protractor $timeout workaround
What issue is this PR resolving? Alternatively, please describe the bugfix/enhancement this PR aims to provide
Using angular-loading-bar, protractor tests often fail with the following message:
Failed: Timed out waiting for Protractor to synchronize with the page after 11 seconds. Please see https://github.com/angular/protractor/blob/master/docs/faq.md
While waiting for element with locator - Locator: By(css selector, h1).
The following tasks were pending:
- $timeout: function () {
_inc();
}
This "pending task" is a angular-loading-bar function. According to similar problems here:
- https://github.com/lynndylanhurley/ng-token-auth/pull/196
- https://github.com/angular/protractor/issues/169
We can use $interval to work around this problem. So I implemented $interval with a count of 1 at the cost of aforementioned $timeout
Have you provided unit tests that either prove the bugfix or cover the enhancement? Tests have been updated
Related issues
None
@chieffancypants if this fixes people's build I have no issue with merging.
I can confirm the same approach was taken in other libraries, one that comes to my mind right now is growl-2: https://github.com/JanStevens/angular-growl-2/pull/103
@faceleg , yes it does
Any update on this?