mirror of https://github.com/vitalif/phantomjs
commit
963366f6ce
|
@ -31,7 +31,7 @@ waitFor = (testFx, onReady, timeOutMillis=3000) ->
|
||||||
|
|
||||||
if phantom.args.length isnt 1
|
if phantom.args.length isnt 1
|
||||||
console.log 'Usage: run-qunit.coffee URL'
|
console.log 'Usage: run-qunit.coffee URL'
|
||||||
phantom.exit()
|
phantom.exit(1)
|
||||||
|
|
||||||
page = new WebPage()
|
page = new WebPage()
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ page.onConsoleMessage = (msg) ->
|
||||||
page.open phantom.args[0], (status) ->
|
page.open phantom.args[0], (status) ->
|
||||||
if status isnt 'success'
|
if status isnt 'success'
|
||||||
console.log 'Unable to access network'
|
console.log 'Unable to access network'
|
||||||
phantom.exit()
|
phantom.exit(1)
|
||||||
else
|
else
|
||||||
waitFor ->
|
waitFor ->
|
||||||
page.evaluate ->
|
page.evaluate ->
|
||||||
|
|
|
@ -36,7 +36,7 @@ function waitFor(testFx, onReady, timeOutMillis) {
|
||||||
|
|
||||||
if (phantom.args.length === 0 || phantom.args.length > 2) {
|
if (phantom.args.length === 0 || phantom.args.length > 2) {
|
||||||
console.log('Usage: run-qunit.js URL');
|
console.log('Usage: run-qunit.js URL');
|
||||||
phantom.exit();
|
phantom.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
var page = new WebPage();
|
var page = new WebPage();
|
||||||
|
@ -49,7 +49,7 @@ page.onConsoleMessage = function(msg) {
|
||||||
page.open(phantom.args[0], function(status){
|
page.open(phantom.args[0], function(status){
|
||||||
if (status !== "success") {
|
if (status !== "success") {
|
||||||
console.log("Unable to access network");
|
console.log("Unable to access network");
|
||||||
phantom.exit();
|
phantom.exit(1);
|
||||||
} else {
|
} else {
|
||||||
waitFor(function(){
|
waitFor(function(){
|
||||||
return page.evaluate(function(){
|
return page.evaluate(function(){
|
||||||
|
|
Loading…
Reference in New Issue