-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Test run fails with :"Failed: Timed out waiting for asynchronous Angular tasks to finish after..." #4584
Comments
I have the same issue. The problem is not protractor, it's the growl component from primeng. It uses timeout() so the protractor thinks that the angular is busy and waits until timeout. That's why when you use waitForAngular(false) it works. I didn't find a solution yet too. |
Thanks jotapsi. In this case I see 2 probable issues:
|
Yeah, you can see here, on the initTimeout() method, there is a setTimeout function. You know this is the problem because when you set the "sticky" input to true, the protractor problem goes away, at least in my case. My workaround for now is set waitForAngular to false and finish my test case this way, then I set it back to true and do a page refresh, resetting the timeout and then we can do the other tests normally. PrimeNG could add an input to the Growl Component so we could run the timeout outside angular zone, thus resolving the issue, but I don't really know if they are willing to do that. I really do not believe it's Protractor's fault, technically it's working as intended. |
I see this too. I have the following versions installed : Node Version: v8.9.1 I observed this since last two days when my tests which were passing earlier suddenly started to fail. My bad , setting browser.waitForAngularEnabled(false) isn't really solving the problem as it is inconsistent and not working every time. |
update : My dev team made changes to the application code which made the timeout to run outside angular zone. This made my tests green. But , i strongly believe this needs to be considered by protractor , perhaps. |
Yes, I believe, there are some other components expect PrimeNG growl one. That might use timeouts as well. So we have to deal with such cases. It's better to get some thought about the issue from Protractor's team. As they might be aware of the issue and have some generic approach how to workaround it. |
For now, if you have a "Repeated" setTimeout / setInterval in your app, Angular will always waits for your "setTimeout / setInterval " and therefore never stable and Protractor will wait for it forever. |
I am also facing the same issue in my project. |
Same issue |
Same issue. |
1 similar comment
Same issue. |
Same issue.... |
As mentioned above, this was caused by repeated settimeout/setInterval in the test app. For now, the recommend way is to let the repeated settimeout/setInterval run outside angular, so that it won't affect the stability of angular. If you cannot do so, e.g. the repeated settimeout/setInterval comes from a third party library, you have to |
Thanks, the browser.waitForAngularEnabled(false) worked for me! |
I have the same issue. I have a bit of code running on a Rxjs interval and get this error. If I comment out the interval, all is well. |
You need to use |
Faced this issue today ✋ I solved it by adding
|
Fixed by PrimeNG team. |
@aozolin can you confirm in which git commit/issue/release version this is fixed? Perhaps by referencing the fix PR to this issue? |
Hello. Thank you. |
@qiyigg Do you know if the change you mentioned (to let Protractor conditionally ignore some asynchronous tasks) was ever merged in? And if so, is there any documentation or examples for how we might use this feature? We're running into this same problem with libraries besides primeng. |
@aschlei Sorry, It hasn't been checked in yet. |
Same problem but this solution worked OK. browser.waitForAngularEnabled(false); |
@qiyigg Do you know if the change you mentioned (to let Protractor conditionally ignore some asynchronous tasks) was ever merged in? This is now a problem for everyone using Firebase with Angular & can imagine this will be an issue that will keep coming up. |
@JamboBuenna As far as I know, @heathkit task was paused, and mainly because the original implementation relies on some Angular API that we might deprecate soon. add @vikerman, who will take over the Protractor stuff. |
We do have a design for this, but I'm no longer working on Protractor and haven't had time to put it together. Anyone who wants to could make a Protractor plugin using the new Testability API that could selectively ignore tasks. The rough outline would be:
The current implementation of Testability does depend on Zone.js. However, I think you can count on |
@vikerman Can you help with it? |
i had the same issue and started to implement a plugin for this. need community help to develop it to high quality and probably more protractor/angular versions. |
Bug report
v8.9.1
5.2.0
5.0.1
Chrome 62.0.3202.89
Mac OS High Sierra 10.13.1, Windows 10
Output from running the test
Failed: Timed out waiting for asynchronous Angular tasks to finish after 110 seconds. This may be because the current page is not an Angular application. Please see the FAQ for more details: https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular While waiting for element with locator - Locator: By(css selector, .ui-button[label="Success"])
Steps to reproduce the bug
Just run above test case.
The URL you are running your tests against (if relevant)
https://www.primefaces.org/primeng/#/growl
Hi protractor team,
Recently we have faced with blocking issue, synchronisation between Protractor and Angular fails. Please use above test example to reproduce the issue.
If modify the test case and put browser.waitForAngularEnabled(false); after the first click - test passed success. So it looks like Protractor becomes waiting for Angular to complete its tasks infinitely.
Please investigate the issue and help to fix it as it's a really blocker for our team now.
The text was updated successfully, but these errors were encountered: