Created
January 31, 2013 18:51
-
-
Save ashwinr/4685298 to your computer and use it in GitHub Desktop.
phantomjs test file
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
if (phantom.args.length === 0 || phantom.args.length > 2) { | |
console.log('Usage: run-qunit.js URL'); | |
phantom.exit(); | |
} | |
var page = new WebPage(); | |
// Route "console.log()" calls from within the Page context to the main Phantom context (i.e. current "this") | |
page.onConsoleMessage = function(msg) { | |
console.log(msg); | |
}; | |
page.onError = function(msg, trace) { | |
console.log(msg); | |
} | |
page.open(phantom.args[0], function(status) { | |
if (status !== "success") { | |
console.log("Unable to access network"); | |
phantom.exit(1); | |
} else { | |
page.evaluate(function() { | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment