1

I have an Angular application that integrates with AudioEye, Twitter, and some other third party applications. We use lazy loading to load our components so our app has no rootElement app. Our login page is a different Angular application. When I run my test suite I keep seeing this error:

Error while waiting for Protractor to sync with the page: {}

Each time the tests run I get different results due to this error, and I am wondering I can resolve the issue. Any ideas or theories would be greatly appreciated. Thanks in advance.

STACK:

Cucumber 9.5
Protractor: 2.5.1
node: 0.12

freginold
  • 3,946
  • 3
  • 13
  • 28

2 Answers2

0

I think these cases are still solved by turning the Protractor-to-Angular synchronization off. Put the following into onPrepare() in your config, or into a beforeEach/beforeAll of your test:

browser.ignoreSynchronization = true;

Note that, unfortunately, this would eliminate one of the advantages of using Protractor for testing AngularJS applications. Now, the tests may require additional explicit waits via browser.wait().

Follow-up links:

Community
  • 1
  • 1
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
  • Thank you for the reference links, but turning synchronization off isnt going to work for us. We are trying to leverage protractors wait for angular as much as possible. However it is worth noting that this issue happens around login, and navigation steps. Do you think turning the synchronization off just during these areas would resolve the issue? – Giuseppe DiBella Apr 24 '16 at 21:34
  • @GiuseppeDiBella sure, you can keep the sync off for the problematic parts only. Thanks. – alecxe Apr 25 '16 at 00:31
  • Thanks, is that the only know solution at the moment? I followed those articles you attached and saw something talking about NG_DEFER_BOOTSTRAP! in someone's reply toward the bottom of this post: https://github.com/angular/protractor/issues/66. But im not sure I follow how that works. – Giuseppe DiBella Apr 25 '16 at 00:41
  • @GiuseppeDiBella interesting, I have not personally tried that, but it sounds like an another solution. – alecxe Apr 25 '16 at 01:15
  • I am trying to look into the issue with one of our developers to see if we can do something like the above but havent got it yet. – Giuseppe DiBella May 06 '16 at 21:59
0

In your config file add- rootElement : 'html'. and when you navigate to non-angualar-page use browser.ignoreSynchronization=true and use protractor commands.

Nick
  • 484
  • 5
  • 18