mirror of
https://github.com/ZwareBear/awx.git
synced 2026-05-04 07:51:58 -05:00
De-lint test files and update test,build config
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
exports.command = function(deps, script, callback) {
|
||||
this.executeAsync(`let args = Array.prototype.slice.call(arguments,0);
|
||||
exports.command = function inject (deps, script, callback) {
|
||||
this.executeAsync(
|
||||
`let args = Array.prototype.slice.call(arguments,0);
|
||||
|
||||
return function(deps, done) {
|
||||
let injector = angular.element('body').injector();
|
||||
let loaded = deps.map(d => {
|
||||
@@ -11,11 +13,13 @@ exports.command = function(deps, script, callback) {
|
||||
});
|
||||
(${script.toString()}).apply(this, loaded).then(done);
|
||||
}.apply(this, args);`,
|
||||
[deps],
|
||||
function(result) {
|
||||
if(typeof(callback) === "function") {
|
||||
callback.call(this, result.value);
|
||||
[deps],
|
||||
function handleResult (result) {
|
||||
if (typeof callback === 'function') {
|
||||
callback.call(this, result.value);
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
import { EventEmitter } from 'events';
|
||||
import { inherits } from 'util';
|
||||
|
||||
|
||||
const Login = function() {
|
||||
function Login () {
|
||||
EventEmitter.call(this);
|
||||
}
|
||||
|
||||
inherits(Login, EventEmitter);
|
||||
|
||||
|
||||
Login.prototype.command = function(username, password) {
|
||||
|
||||
Login.prototype.command = function command (username, password) {
|
||||
username = username || this.api.globals.awxUsername;
|
||||
password = password || this.api.globals.awxPassword;
|
||||
|
||||
@@ -33,16 +30,17 @@ Login.prototype.command = function(username, password) {
|
||||
this.api.elementIdDisplayed(id, ({ value }) => {
|
||||
if (!alertVisible && value) {
|
||||
alertVisible = true;
|
||||
loginPage.setValue('@username', username)
|
||||
loginPage.setValue('@password', password)
|
||||
loginPage.click('@submit')
|
||||
loginPage.waitForElementVisible('div.spinny')
|
||||
loginPage.setValue('@username', username);
|
||||
loginPage.setValue('@password', password);
|
||||
loginPage.click('@submit');
|
||||
loginPage.waitForElementVisible('div.spinny');
|
||||
loginPage.waitForElementNotVisible('div.spinny');
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
this.emit('complete');
|
||||
})
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = Login;
|
||||
|
||||
@@ -1,20 +1,17 @@
|
||||
exports.command = function(callback) {
|
||||
let self = this;
|
||||
this.timeoutsAsyncScript(this.globals.asyncHookTimeout, function() {
|
||||
this.executeAsync(function(done) {
|
||||
if(angular && angular.getTestability) {
|
||||
exports.command = function waitForAngular (callback) {
|
||||
this.timeoutsAsyncScript(this.globals.asyncHookTimeout, () => {
|
||||
this.executeAsync(done => {
|
||||
if (angular && angular.getTestability) {
|
||||
angular.getTestability(document.body).whenStable(done);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
},
|
||||
[],
|
||||
function(result) {
|
||||
if(typeof(callback) === "function") {
|
||||
callback.call(self, result);
|
||||
}, [], result => {
|
||||
if (typeof callback === 'function') {
|
||||
callback.call(this, result);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user