Skip to content

Instantly share code, notes, and snippets.

@scoates
Created October 7, 2010 16:35
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 scoates/615412 to your computer and use it in GitHub Desktop.
Save scoates/615412 to your computer and use it in GitHub Desktop.
browser
.chain
.session()
.and(function (browser) { // log out
try {
browser
.open('/')
.assertElementPresent('link=Log out')
.clickAndWait('link=Log out')
.assertElementPresent('link=Log in')
.testComplete();
} catch (err) {
if (err.message.match(/^assertElementPresent\(link=Log out/)) {
console.log(stylize(' No log out necessary', 'grey'));
} else {
throw err;
}
}
})
.assertTitle('whatever')
.testComplete()
.end(function (err) {
if (err) {
console.log('ERROR');
throw err;
}
console.log('done');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment