I'm trying to write some e2e test for my Angular application using Protractor.
I have a simple html button having id=my-btn
which I want to click, using:
$('#my-btn').click();
Unfortunately I'm getting the following errors:
Failed: script timeout: result was not received in 11 seconds
From: Task: Protractor.waitForAngular() - Locator: By(css selector, #my-btn)
(Session info: chrome=73.0.3683.75)
(Driver info: chromedriver=2.46.628411 (3324f4c8be9ff2f70a05a30ebc72ffb013e1a71e),platform=Mac OS X 10.14.3 x86_64)
If before the click I set:
browser.waitForAngularEnabled(false);
then I don't get any errors. The problem is that doing that means:
* If set to false, Protractor will not wait for Angular $http and $timeout
* tasks to complete before interacting with the browser. This can cause
* flaky tests, but should be used if, for instance, your app continuously
* polls an API with $timeout.
So I would like what is causing the waitForAngular
operation to timeout.
Is there a way to check what http or timeout are still hanging?
I want to debug my application to understand what's going on.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…