I'm doing e2e-testing with Protractor and Jasmine. Our application is in Angular.
I have written given getPageTimeout: 500000
, allScriptsTimeout: 600000
, in the config file. Added defaultTimeoutInterval:500000
as per GitHub .
Even then I'm getting the below exception. Appreciate any help.
A Jasmine spec timed out. Resetting the WebDriver Control Flow.
The last active task was:
Protractor.waitForAngular()
at [object Object].webdriver.WebDriver.schedule (C:\Users\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:345:15)
at [object Object].Protractor.executeAsyncScript_ (C:\Users\AppData\Roaming\npm\node_modules\protractor\lib\protractor.js:1141:26)
at [object Object].Protractor.waitForAngular (C:\Users\AppData\Roaming\npm\node_modules\protractor\lib\protractor.js:1159:15)
at [object Object].getWebElements (C:\Users\AppData\Roaming\npm\node_modules\protractor\lib\protractor.js:191:21)
at [object Object].getWebElements
In order to modify this behavior to handle timeouts in Protractor Selenium, you need to add allScriptsTimeout (timeout in millis) to the protractor configuration file and this will reflect the change in timeout globally.
Add allScriptsTimeout: 1100000 to avoid script timeout if scripts are too long.
It ensures that the test process doesn't get stuck if something goes wrong. By default, the timeout is 10 seconds, which means that a single test should not take longer than that.
Angular is never becoming ready in your app. The only reason why you're seeing jasmine timeout instead of protractor timeouts is because you increased your protractor timeout limit to be higher than your jasmine timeout limit. This is likely a problem with the app polling indefinitely, rather than a problem with how you're writing your test.
From https://github.com/angular/protractor/blob/master/docs/timeouts.md:
"Before performing any action, Protractor asks Angular to wait until the page is synchronized. This means that all timeouts and http requests are finished. If your application continuously polls $timeout or $http, it will never be registered as completely loaded. You should use the $interval service (interval.js) for anything that polls continuously (introduced in Angular 1.2rc3)."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With