Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tell what protractor's waitForAngular is stuck on?

Is there any way to determine what Protractor's browser.waitForAngular() is getting stuck on?

My Protractor test basically loads the page, clicks on an element, and then waits for a new page to load. I'm getting the "Timed out waiting for Protractor to synchronize with the page after 11 seconds," error; however, I don't use $timeout, and can see that there are no outstanding http requests in my browser's Developer Console.

I can manually reproduce the same steps as my test in my browser, and run

angular.getTestability(document.body)
    .whenStable(function() {console.log("holla")})

and see that the page is, in fact, stable within 1 second of loading.

If I write a protractor test that loads the first page, and then uses browser.get('index.html#second-page'), the test passes.

I am aware that I can set ignoreSerialization on Protractor, but honestly, I'd rather not, because I'm concerned that there is some insidious bug in my Angular project. Are there any steps I can take to get a deeper look at what's going on in Protractor?

like image 667
Andrew Rueckert Avatar asked Dec 19 '14 02:12

Andrew Rueckert


1 Answers

If you have a setTimeout in your code, protractor will not be able to synchronize. Consider using $interval instead.

like image 108
Justin Acount Avatar answered Oct 28 '22 02:10

Justin Acount