Selenium: how to wait for AngularJS to finish updating the DOM after AJAX? -


[related philosophical debate sleeping out @ programmers.se]

angualr not guaranteed update dom in event handler ajax completion (especially if third-party directives involved), of solutions floating online using $http interceptors incomplete.

the answer similar question "wait angular finish updating dom", suggests using $timeout. however, source suggests uses $browser.defer mechanism can executed in order other deferred dom manipulation.

i found $browser.notifywhennooutstandingrequests internal method happens after deferred stuff, test still unstable after waiting that. guess should wait ajax complete first or there else i've missed?

this how it:

function waitfordisplayed(element) {    var d = protractor.promise.defer(); // result of being fulfilled returned    browser.wait(element.isdisplayed).       then(function(isdisplayed) {          d.fulfill();       });       return d.promise; } 

Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -