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
Post a Comment