Skip to content

Instantly share code, notes, and snippets.

@bitemyapp
Created June 1, 2012 23:34
Show Gist options
  • Save bitemyapp/2855770 to your computer and use it in GitHub Desktop.
Save bitemyapp/2855770 to your computer and use it in GitHub Desktop.
var page = require('webpage').create();
var href = "http://localhost:5000";
var step = 0;
var raise = function(error) {
console.log("Error raised: " + error);
phantom.exit(1);
}
var assertEquals = function(first, second, message) {
if (first === second) {
console.log(message + " successful");
} else {
raise(first + " and " + second + " were unequal, you assertEquals'd them");
}
}
function test_signup_first() {
page.open(href + "/signup/", function (status) {
var title = page.evaluate(function () {
return document.title;
});
assertEquals(title, "Nutrivise", "Title should equal Nutrivise");
});
}
function test_signup_second() {
page.open(href + "/signup/", function (status) {
var title = page.evaluate(function () {
return document.title;
});
assertEquals(title, "Nutrivise", "Title should equal Nutrivise");
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment