Created
June 14, 2012 11:40
-
-
Save danpalmer/2929799 to your computer and use it in GitHub Desktop.
Casperjs Multiple Tests
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
// Test 1 | |
casper.start(); | |
casper.open('http://localhost:3000/'); | |
casper.then(function() { | |
// asserts | |
}); | |
casper.run(function() { | |
// I can't mark as done here because the first test to finish will be used? | |
}); | |
// | |
// Not sure how best to do this, can I put the whole of each test inside the start function and reference this? | |
// | |
// Test 2 | |
casper.start(); | |
casper.open('http://localhost:3000/'); | |
casper.then(function() { | |
// asserts | |
}); | |
casper.run(function() { | |
this.test.done(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ok, thanks for the tip, I didn't know about
clear()
. For the moment I'm running everything as a suite withcasper test
.