Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created June 17, 2020 06:47
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
//demo.js is a JS file under tests folder
module.exports = {
'step one: navigate to google' : function (browser) { //step one
browser
.url('https://www.google.com')
.waitForElementVisible('body', 1000)
.setValue('input[type=text]', 'nightwatch')
.waitForElementVisible('input[name=btnK]', 1000)
},
'step two: click input' : function (browser) { //step two
browser
.click('input[name=btnK]')
.pause(1000)
.assert.containsText('#main', 'Night Watch')
.end(); //to close the browser session after all the steps
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment