Last active
August 29, 2015 14:05
-
-
Save manderly/0c1a8e7210e71e891857 to your computer and use it in GitHub Desktop.
CasperJS test exercise
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { //todo: parse as int? | |
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