The Problem Description:
We've recently got this infamous error while opening one of the pages in our application in a Protractor end-to-end test:
Failed: Timed out waiting for asynchronous Angular tasks to finish after 50 seconds. This may be because the current page is not an Angular application.
This happens on a browser.get("/some/page/");
call in one of our tests:
describe("Test", function () {
beforeEach(function () {
browser.get("/some/page/");
});
it("should test something", function () {
// ...
});
)};
And, what is weird about our case, is that the error is not thrown on any other page in our Angular web application - Protractor syncs with Angular without any problems. ng-app
location-wise things are the same across all the pages - ng-app
is defined on the root html
tag:
<html class="ng-scope" lang="en-us" ng-app="myApp" ng-strict-di="">
The behavior is consistent - every time we navigate to this page with browser.get()
, we get this error. Any time we navigate to any other page in our app, sync works.
Note that, of course, we can turn the sync off for this page and treat it as non-angular, but this can only be considered as a workaround.
The Questions:
What else can cause Protractor-to-Angular sync fail? What should we check?
And, in general, what is the recommended way to debug sync problems in Protractor?
Using currently latest Protractor 5.5.1, Angular 1.5.6.