How can I override default timeout(defaultTimeoutInterval
) for it
and describe
methods in Protractor? It's defaulted to 2500ms
.
For this, you'll have to add getPageTimeout (timeout in milliseconds) to your protractor configuration file, to reflect the change in timeout globally. But in case you want to provide the timeout for individual test cases, you'll have to pass an additional parameter when calling the browser. get() i.e. browser.
Running jasmine --default-timeout 10000 # ... or JASMINE_DEFAULT_TIMEOUT="10000" jasmine # ... should use the provided value as the default timeout. If any tests override this value directly in code, those should probably take precedence.
1) defaultTimeoutInterval is a timeout from jasmine for each it to not make test run forever or very long - http://www.protractortest.org/#/timeouts#timeouts-from-jasmine. Set it to some default value that you believe your it should not exceed.
For Angular apps, Protractor will wait until the Angular Zone stabilizes. This means long running async operations will block your test from continuing. To work around this, run these tasks outside the Angular zone.
I just found the answer myself.
In config.js
:
jasmineNodeOpts: {
defaultTimeoutInterval: 25000
},
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