2

In my project we have Automated Tests in Selenium. Our application using AngularJS but we're rewriting to Angular 9 using Hybrid Approach. The problem is that those tests doesn't work because the method getAllAngularTestabilities()[0].whenStable() is never run callback to inform Selenium that Angular finished underhood work.

Also when I run method getAllAngularTestabilities()[0].isStable() then is always returnig false.

It's weird because property isStable is true, also microTasks and macroTask are empty.

enter image description here

But in fact somewhere deeper there is some loop that not allowing to Stable application, I was able to find this out thanks to answer from @Stanislav Berkov How to track which async tasks protractor is waiting on?

And apparently there is MacroTask from oidc-client, probably for refreshing token which is triggered every few minutes enter image description here

And I've no idea how can I solve this. Maybe I could exclude the whole package somehow from zone.js, but I don't know how can I do this.

georgeawg
  • 48,608
  • 13
  • 72
  • 95
DiPix
  • 5,755
  • 15
  • 61
  • 108
  • [Don't do this](https://meta.stackoverflow.com/questions/361474/should-we-display-a-warning-when-users-include-images/361481#361481). Please read why a [screenshot of HTML or code or error is a bad idea](https://meta.stackoverflow.com/questions/303812/discourage-screenshots-of-code-and-or-errors). Consider updating the Question with formatted text based relevant HTML, code trials and error stack trace. – undetected Selenium Mar 03 '20 at 23:00
  • We are having the same issue. Did you ever got it resolved? – jerone Aug 04 '22 at 14:03

1 Answers1

0

isStable will not emit true if you have pending macrotasks (like setTimeout or setInterval). Be sur to not have these in the bootstrapping process of yout app.

Matthieu Riegler
  • 31,918
  • 20
  • 95
  • 134