Skip to content

Instantly share code, notes, and snippets.

@megurock
Last active August 29, 2015 14:04
Show Gist options
  • Save megurock/b76ffd1549746dec8f7e to your computer and use it in GitHub Desktop.
Save megurock/b76ffd1549746dec8f7e to your computer and use it in GitHub Desktop.
testing site title and description using nightwatch.js
module.exports = {
setUp: function() {
},
tearDown: function() {
},
myTest: function(browser) {
var title = 'Site Title',
description = 'Site Description';
browser
.resizeWindow(400, 400)
.url("http://localhost:8000/")
.waitForElementVisible("body", 3000)
.verify.title(title)
.verify.attributeEquals("meta[property='og:title']", "content", title)
.verify.attributeEquals("meta[property='og:site_name']", "content", title)
.verify.attributeEquals("meta[name=description]", "content", description)
.verify.attributeEquals("meta[property='og:description']", "content", description)
// more assertions go here
.end();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment