Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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