};
var run_time = 8; // poll up to seconds
+if (system.args[2] && parseFloat(system.args[2]) > 0){
+ run_time = parseFloat(system.args[2] );
+}
/************************/
phantom.exit(1);
}
- console.log("polling MKWS jasmine test status...");
+ console.log("polling MKWS jasmine test status for " + run_time + " seconds");
var exit = wait_for_jasmine(function () {
return page.evaluate(function () {
} else {
return {
mkws: window.mkws,
+ html: window.$("html").html(),
duration: window.$(".duration").text(),
passing: window.$(".passingAlert").text()
};
function (result) {
var error_png = "./mkws-error.png";
+ var error_html = "./mkws-error.html";
+
console.log("MKWS tests failed after " + result.time/1000 + " seconds");
console.log("keep screenshot in '" + error_png + "'");
page.render(error_png);
+
+ console.log("keep html DOM in '" + error_html + "'");
+ var fs = require('fs');
+ fs.write(error_html, result.html ? result.html : "Argh!", "wb");
},
run_time * 1000);
});