awx/awx/ui/client/test/e2e/commands/waitForAngular.js
2017-09-15 17:21:55 -04:00

21 lines
570 B
JavaScript

exports.command = function(callback) {
let self = this;
this.timeoutsAsyncScript(this.globals.asyncHookTimeout, function() {
this.executeAsync(function(done) {
if(angular && angular.getTestability) {
angular.getTestability(document.body).whenStable(done);
}
else {
done();
}
},
[],
function(result) {
if(typeof(callback) === "function") {
callback.call(self, result);
}
});
});
return this;
};