question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Protractor E2E test times out when app polls an API at regular intervals

See original GitHub issue

Our app has a poller which makes calls to an API every 3 seconds. When I load a page with has an active instance of the poller Protractor will always time out.

The poller is started when the page loads and uses the Angular $timeout function.

Is there a way to get Protractor to ignore the poller or send a signal to the app to pause the poller momentarily so the E2E test can finish running?

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:32 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
nvsoarescommented, May 30, 2016

Given that Angular 2, as of yet, at least to my knowledge, does not provide an interval service for polling. Would you propose people using protractor to test angular 2 apps workaround this issue? In cases where dropping synchronization is not possible. In our use case we have a timeout of 20 minutes, set up as a sort of ticker, to revalidate a JWT token. When our protractor tests hit the homepage, they sit there waiting for a 20min timeout.

Cheers, Nuno

1reaction
elgalucommented, Mar 26, 2014

I use 7mins spec timeouts, also have long running e2e tests:

    allScriptsTimeout: 7*60*1000,
Read more comments on GitHub >

github_iconTop Results From Across the Web

Protractor Tutorial: Handling Timeouts With Selenium
Protractor waits indefinitely and then time out if the AngularJS application continuously checks $timeout or $http. You can use the $interval ...
Read more >
How to implement intervals/polling in angular2 to work with ...
I have an angular2 app I want to test with protractor. In this app I have a page with a graph that is...
Read more >
9 Understanding timeouts - Testing Angular Applications
Because Protractor tests involve many different pieces working together, there are different kinds of timeouts. For example, Jasmine will mark your test as ......
Read more >
Timeouts - Protractor - end-to-end testing for AngularJS
If your AngularJS application continuously polls $timeout or $http, Protractor will wait indefinitely and time out. You should use the $interval for anything ......
Read more >
Testing with Protractor: how to fix synchronization issues
If your AngularJS application continuously polls $timeout or $http, Protractor will wait indefinitely and time out. To fix infinite timeout, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found