Skip to content

Instantly share code, notes, and snippets.

@macikokoro
Forked from manderly/casperjstest.js
Created August 11, 2014 21:31
Show Gist options
  • Save macikokoro/3ecb77fb4974e27c31f7 to your computer and use it in GitHub Desktop.
Save macikokoro/3ecb77fb4974e27c31f7 to your computer and use it in GitHub Desktop.
casper.test.begin("Testing if node express app", 2, function suite(test) {
casper.start('http://localhost:3000', function() {
test.assertHttpStatus(200);
});
casper.then(function() {
if (this.fetchText('.daysLeft' > 0)) {
this.echo("more than 0 days left");
}
this.echo("Days left: " + this.fetchText('.daysLeft'));
});
casper.then(function() {
test.assertTitle("Class Days Remaining", 'title is ok');
});
casper.run(function() {
test.done();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment