Search code examples
angularjsprotractorwait

protractor browser.wait intermittently blocks the website execution


I'm using protractor 4.0.14 on an angularjs application.

We are doing an async call that takes 30 seconds with a loading bar. So I'm waiting for an element that appears after that time. The loading bar always goes to 100%, then intermittently get stuck at 100% because of the browser.wait, but most of the time it works and display the element I'm looking for.

When it doesn't, it's just stuck on 100%, gets a timeout, then continue the tests. Only happens with protractor, manually on a browser, it never gets stuck.

it('Should wait for the end of the api call', function () {
    browser.wait(function () {
        return $('#loaded i.check').isPresent();
    }, 60000);
    expect($('#score button').isPresent()).toBe(true);
}, 61000);

I tried to use the ignoreSynchronization to true, I tried using implicitlyWait, wait for an Expected Condition "EC", used browser.driver.wait instead of browser.wait, sleep, but nothing changes the problem. It sometimes get stuck on the loading bar, preventing the application to continue.

Any suggestion?

Edit: Not a protractor issue. I managed to recreate the error in a regular Chromium browser manually.


Solution

  • It wasn't a docker problem since I managed to recreate the bug without protractor on chromium.

    the cause was a network error : err-network-changed