updates to work with PhantomJS 2.x

This commit is contained in:
Oliver Gorwits
2018-12-29 13:26:54 +00:00
parent 6ed29f85ea
commit 9022e3ee8b

View File

@@ -1,3 +1,4 @@
var system = require('system');
/** /**
* Wait until the test condition is true or a timeout occurs. Useful for waiting * Wait until the test condition is true or a timeout occurs. Useful for waiting
* on a server response or for a ui change (fadeIn, etc.) to occur. * on a server response or for a ui change (fadeIn, etc.) to occur.
@@ -34,7 +35,7 @@ function waitFor(testFx, onReady, timeOutMillis) {
}; };
if (phantom.args.length === 0 || phantom.args.length > 2) { if (system.args.length === 0 || system.args.length > 2) {
console.log('Usage: run-qunit.js URL'); console.log('Usage: run-qunit.js URL');
phantom.exit(1); phantom.exit(1);
} }
@@ -46,7 +47,7 @@ page.onConsoleMessage = function(msg) {
console.log(msg); console.log(msg);
}; };
page.open(phantom.args[0], function(status){ page.open(system.args[1], function(status){
if (status !== "success") { if (status !== "success") {
console.log("Unable to access network"); console.log("Unable to access network");
phantom.exit(1); phantom.exit(1);