angular-loading-bar icon indicating copy to clipboard operation
angular-loading-bar copied to clipboard

Protractor $timeout workaround

Open boboldehampsink opened this issue 9 years ago • 4 comments

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

boboldehampsink avatar Nov 01 '16 15:11 boboldehampsink

@chieffancypants if this fixes people's build I have no issue with merging.

faceleg avatar Apr 17 '17 21:04 faceleg

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

gastonelhordoy avatar Apr 17 '17 21:04 gastonelhordoy

@faceleg , yes it does

LeleDev avatar May 05 '17 14:05 LeleDev

Any update on this?

boboldehampsink avatar Jun 30 '17 10:06 boboldehampsink