2020-06-25 23:29:05 +02:00
|
|
|
/**
|
|
|
|
* A basic Nightwatch custom command
|
|
|
|
* which demonstrates usage of ES6 async/await instead of using callbacks.
|
|
|
|
* The command name is the filename and the exported "command" function is the command.
|
|
|
|
*
|
|
|
|
* Example usage:
|
|
|
|
* browser.openHomepage();
|
|
|
|
*
|
|
|
|
* For more information on writing custom commands see:
|
|
|
|
* https://nightwatchjs.org/guide/extending-nightwatch/#writing-custom-commands
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
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
|
2020-06-25 23:31:51 +02:00
|
|
|
this.init()
|
|
|
|
this.waitForElementVisible('#app')
|
2020-06-25 23:29:05 +02:00
|
|
|
|
2020-06-25 23:31:51 +02:00
|
|
|
const result = await this.elements('css selector', '#app ul')
|
|
|
|
this.assert.strictEqual(result.value.length, 3)
|
2020-06-25 23:29:05 +02:00
|
|
|
}
|
2020-06-25 23:31:51 +02:00
|
|
|
}
|