projects
/
mkws-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dump "mkws" object on error, and append it to the mkws-error.html page
[mkws-moved-to-github.git]
/
test
/
phantom
/
evaluate.js
diff --git
a/test/phantom/evaluate.js
b/test/phantom/evaluate.js
index
9447ad8
..
b84c0c2
100644
(file)
--- a/
test/phantom/evaluate.js
+++ b/
test/phantom/evaluate.js
@@
-20,6
+20,9
@@
page.viewportSize = {
};
var run_time = 8; // poll up to seconds
};
var run_time = 8; // poll up to seconds
+if (system.args[2] && parseFloat(system.args[2]) > 0){
+ run_time = parseFloat(system.args[2] );
+}
/************************/
/************************/
@@
-67,7
+70,7
@@
page.open(url, function (status) {
phantom.exit(1);
}
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 () {
var exit = wait_for_jasmine(function () {
return page.evaluate(function () {
@@
-76,6
+79,7
@@
page.open(url, function (status) {
} else {
return {
mkws: window.mkws,
} else {
return {
mkws: window.mkws,
+ html: window.$("html").html(),
duration: window.$(".duration").text(),
passing: window.$(".passingAlert").text()
};
duration: window.$(".duration").text(),
passing: window.$(".passingAlert").text()
};
@@
-86,13
+90,21
@@
page.open(url, function (status) {
console.log("MKWS tests are successfully done in " + result.time/1000 + " seconds. Hooray!");
console.log("jasmine duration: " + result.duration);
console.log("jasmine passing: " + result.passing);
console.log("MKWS tests are successfully done in " + result.time/1000 + " seconds. Hooray!");
console.log("jasmine duration: " + result.duration);
console.log("jasmine passing: " + result.passing);
+ console.log("mkws: " + result.mkws_js);
},
function (result) {
var error_png = "./mkws-error.png";
},
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("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 html = result.html + "\n\n<!-- mkws: " + JSON.stringify(result.mkws) + " -->\n";
+ var fs = require('fs');
+ fs.write(error_html, html, "wb");
},
run_time * 1000);
});
},
run_time * 1000);
});