This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Consider allowing e2e test to ignore certain timeouts #14118
Open
Description
Based on a discussion we had about angular/protractor#2950. Since this feature would require changes to Angular.js, moving discussion here.
The basic problem is that sometimes, apps have a long-running or repeating $timeout
call for some reason. Protractor waits for all timeouts to finish before reporting stable, so this causes it fail for any tests on that page.
An example use case would be a page using a widget that they don't necessarily control the code for, which has a long running $timeout
. Ideally, they'd be able to ignore this timeout without changing the code for the widget.
Mitigating, currently available solutions:
- you can always turn off all waiting for Protractor using
browser.ignoreSynchronization = true
or by directly usingbrowser.driver.<method>
- If you control the offending app code, use
$interval
instead of$timeout
Potential solutions that would require changes to angular:
- Instead of waiting for there to be 0 timeouts, the test writer could pass in a number X, and we could wait for there to be
<= X
. - We could add yet another parameter to
$timeout
telling angular to ignore it for reporting stability (note that this requires some changes to the app code) - We could add some ability to name your timeouts, and let protractor pass in a list of timeouts it should ignore. Concerns here: name conflicts, names getting minified. (note that this requires some changes to the app code)