Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to override protractor's default timeout?

How can I override default timeout(defaultTimeoutInterval) for it and describe methods in Protractor? It's defaulted to 2500ms.

like image 724
Mohsen Avatar asked Mar 06 '14 18:03

Mohsen


People also ask

How do you increase timeout on a protractor?

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.

What is the default timeout in jasmine for an async test?

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.

What is defaultTimeoutInterval in protractor?

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.

How does Protractor wait for Angular?

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.


1 Answers

I just found the answer myself.

In config.js:

jasmineNodeOpts: {
    defaultTimeoutInterval: 25000
},
like image 124
Mohsen Avatar answered Sep 23 '22 10:09

Mohsen