Skip to content

Instantly share code, notes, and snippets.

@cold-logic
Created September 3, 2019 04:34
Show Gist options
  • Save cold-logic/6e59c3d1b076a7bc2904a04f5cc32546 to your computer and use it in GitHub Desktop.
Save cold-logic/6e59c3d1b076a7bc2904a04f5cc32546 to your computer and use it in GitHub Desktop.
An E2E test using Nightwatch.js
module.exports = {
'Demo test Ecosia.org': function (browser) {
browser
.url('https://www.ecosia.org/')
.waitForElementVisible('body')
.assert.titleContains('Ecosia')
.assert.visible('input[type=search]')
.setValue('input[type=search]', 'nightwatch')
.assert.visible('button[type=submit]')
.click('button[type=submit]')
.assert.containsText('.mainline-results', 'Nightwatch.js')
.end()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment