console.log("Alert: " + msg);
};
+// display HTTP errors
+page.onResourceError = function (resourceError) {
+ // console.log('phantomjs error code: ' + resourceError.errorCode);
+ console.log(resourceError.errorString);
+ phantom.exit(3);
+};
page.open(url, function (status) {
if (debug >= 1) console.log("fetch " + url + " with status: " + status);
if (status != 'success') {
- console.log("Failed to fetch page, give up");
+ console.log("Failed to fetch page, give up. Network error?");
phantom.exit(1);
}
if (!window || !window.$ || !window.mkws) {
return false;
} else {
+ var passing = window.$(".passingAlert").text() || window.$(".failingAlert").text();
+
return {
mkws: window.mkws,
html: window.$("html").html(),
duration: window.$(".duration").text(),
- passing: window.$(".passingAlert").text()
+ passing: passing
};
}
})