De-lint test files and update test,build config

This commit is contained in:
gconsidine
2017-10-10 16:32:11 -04:00
parent 8b6cc0e323
commit 82f81752e4
61 changed files with 1335 additions and 991 deletions

View File

@@ -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;
};

View File

@@ -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;

View File

@@ -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;
};