Prettify codebase

This commit is contained in:
2020-06-25 23:31:51 +02:00
parent 236ab22e12
commit 818382bd13
17 changed files with 102 additions and 94 deletions

View File

@ -23,7 +23,7 @@ exports.command = function command(data) {
this.execute(
// The function argument is converted to a string and sent to the browser
function(argData) {
return argData;
return argData
},
// The arguments for the function to be sent to the browser are specified in this array
@ -31,9 +31,9 @@ exports.command = function command(data) {
function(result) {
// The "result" object contains the result of what we have sent back from the browser window
console.log("custom execute result:", result.value);
console.log('custom execute result:', result.value)
}
);
)
return this;
};
return this
}

View File

@ -14,10 +14,10 @@ module.exports = {
command: async function() {
// Other Nightwatch commands are available via "this"
// .init() simply calls .url() command with the value of the "launch_url" setting
this.init();
this.waitForElementVisible("#app");
this.init()
this.waitForElementVisible('#app')
const result = await this.elements("css selector", "#app ul");
this.assert.strictEqual(result.value.length, 3);
const result = await this.elements('css selector', '#app ul')
this.assert.strictEqual(result.value.length, 3)
}
};
}

View File

@ -10,15 +10,15 @@
*
*/
const assert = require("assert");
const assert = require('assert')
module.exports = class {
async command() {
// Other Nightwatch commands are available via "this.api"
this.api.init();
this.api.waitForElementVisible("#app");
this.api.init()
this.api.waitForElementVisible('#app')
const result = await this.api.elements("css selector", "#app ul");
assert.strictEqual(result.value.length, 3);
const result = await this.api.elements('css selector', '#app ul')
assert.strictEqual(result.value.length, 3)
}
};
}