Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created June 17, 2020 06:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velotiotech/0626597c25ecd2be1f0886ef125a14fa to your computer and use it in GitHub Desktop.
Save velotiotech/0626597c25ecd2be1f0886ef125a14fa to your computer and use it in GitHub Desktop.
//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