Wednesday, 26 November 2014

angular protractor and $timeout


If you use $timeout to pool data or something, you will have problem with protractor. Errors like that:


 1) Application verify the title
   Message:
     Error: Timed out waiting for Protractor to synchronize with the page after 11 seconds. Please see https://github.com/angular/protractor/blob/master/docs/faq.md
   Stacktrace:
     Error: Timed out waiting for Protractor to synchronize with the page after 11 seconds. Please see https://github.com/angular/protractor/blob/master/docs/faq.md
    at Error (<anonymous>)
==== async task ====
Protractor.waitForAngular()
    at [object Object].<anonymous> (/Users/peterwang/Documents/dev/code/deerhunterweb/test/e2e/app.js:74:14)
==== async task ====
Asynchronous test function: it()
Error
    at [object Object].<anonymous> (/Users/peterwang/Documents/dev/code/deerhunterweb/test/e2e/app.js:70:5)
    at Object.<anonymous> (/Users/peterwang/Documents/dev/code/deerhunterweb/test/e2e/app.js:1:63)

Finished in 13.953 seconds
2 tests, 2 assertions, 1 failure

Shutting down selenium standalone server.
>> 
Fatal error: protractor exited with code: 1






if you check the official website  of protractor, you will see that:

http://angular.github.io/protractor/#/system-setup

If your page uses $timeout for polling Protractor will not be able to tell when your page is ready. Consider using $interval instead of$timeout


1 comment:

  1. I like your post very much. It is very much useful for my research. I hope you to share more info about this. Keep posting angularjs online training

    ReplyDelete