Skip to content

Instantly share code, notes, and snippets.

@jimmyeisenhauer
Created August 12, 2015 21:36
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 jimmyeisenhauer/c3848a46aed6c913c5cf to your computer and use it in GitHub Desktop.
Save jimmyeisenhauer/c3848a46aed6c913c5cf to your computer and use it in GitHub Desktop.
Recreate nightwatch.js chai issue
var expect = require('chai').expect;
module.exports = {
before : function(browser) {
console.log('Setting up...');
},
after : function(browser) {
console.log('Closing down...');
browser.end();
},
'Demo test Google' : function (browser) {
console.log('Running Test...');
browser
.url('http://www.google.com')
.waitForElementVisible('body', 1000);
browser
.setValue('input[type=text]', 'nightwatch')
.waitForElementVisible('button[name=btnG]', 1000)
.click('button[name=btnG]')
.pause(1000)
.assert.containsText('#main', 'Night Watch');
browser.getText('#main', function(result) {
expect(result.value).to.contain('text');
});
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment