Skip to content

Instantly share code, notes, and snippets.

Created July 1, 2014 15:51
Show Gist options
  • Save anonymous/58248519671d54a37ce2 to your computer and use it in GitHub Desktop.
Save anonymous/58248519671d54a37ce2 to your computer and use it in GitHub Desktop.
casper.test.currentTestFile = "otherFile.js";
casper.test.begin("test1", function suite(test){
casper.start().then(function(){
test.assert(true, "was true");
}).run(function(){
test.done();
});
});
casper.test.begin("test2", function suite(test){
var oldfile = test.currentTestFile;
console.log("old file:", oldfile);
test.currentTestFile = "newFile.js";
casper.start().then(function(){
test.assert(true, "was also true");
}).run(function(){
test.currentTestFile = oldfile;
test.done();
});
});
casper.test.begin("test3", function suite(test){
casper.start().then(function(){
test.assert(true, "was true, again (duh)");
}).run(function(){
test.done();
});
});
<?xml version="1.0" encoding="UTF-8"?>
<testsuites time="0.142">
<testsuite name="test1" tests="1" failures="0" errors="0" time="0.067" timestamp="2014-07-01T15:45:38.759Z" package="otherFile">
<testcase name="was true" classname="otherFile" time="0.067"/>
<system-out/>
</testsuite>
<testsuite name="test2" tests="1" failures="0" errors="0" time="0.033" timestamp="2014-07-01T15:45:38.760Z" package="otherFile">
<testcase name="was also true" classname="newFile" time="0.033"/>
<system-out/>
</testsuite>
<testsuite name="test3" tests="1" failures="0" errors="0" time="0.042" timestamp="2014-07-01T15:45:38.760Z" package="otherFile">
<testcase name="was true, again (duh)" classname="otherFile" time="0.042"/>
<system-out/>
</testsuite>
</testsuites>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment