projects
/
mkws-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
50218f1
)
ASCII dump of HTML page (not fully implemented yet).
author
Wolfram Schneider
<wosch@indexdata.dk>
Fri, 14 Mar 2014 18:13:30 +0000
(18:13 +0000)
committer
Wolfram Schneider
<wosch@indexdata.dk>
Fri, 14 Mar 2014 18:13:30 +0000
(18:13 +0000)
test/phantom/run-jasmine.js
patch
|
blob
|
history
diff --git
a/test/phantom/run-jasmine.js
b/test/phantom/run-jasmine.js
index
a1f8704
..
27c465b
100644
(file)
--- a/
test/phantom/run-jasmine.js
+++ b/
test/phantom/run-jasmine.js
@@
-65,6
+65,19
@@
function wait_for_jasmine(checkFx, readyFx, failFx, timeout) {
}, 500); //< repeat check every N ms
};
}, 500); //< repeat check every N ms
};
+function dump_html(file) {
+ // not yet implemented
+ var spawn = require('child_process').spawn,
+ lynx = spawn("lynx", ["-nolist", "-dump", file]);
+
+ lynx.stdout.on('data', function (data) {
+ console.log('lynx >> ' + data);
+ });
+
+ // lynx.stderr.on('data', function (data) { console.log('stderr: ' + data); });
+ // lynx.on('close', function (code) { console.log('child process exited with code ' + code) });
+};
+
// redirect webkit console.log() output
page.onConsoleMessage = function (message) {
if (debug >= 2) console.log(message);
// redirect webkit console.log() output
page.onConsoleMessage = function (message) {
if (debug >= 2) console.log(message);
@@
-142,15
+155,17
@@
page.open(url, function (status) {
var error_png = "./mkws-error.png";
var error_html = "./mkws-error.html";
var error_png = "./mkws-error.png";
var error_html = "./mkws-error.html";
+ var html = result.html + "\n\n<!-- mkws: " + JSON.stringify(result.mkws) + " -->\n";
+ var fs = require('fs');
+ fs.write(error_html, html, "wb");
+ dump_html(error_html);
+
console.log("MKWS tests failed after " + result.time / 1000 + " seconds");
console.log(result.error_msg.join("\n"));
console.log("keep screenshot in '" + error_png + "'");
page.render(error_png);
console.log("keep html DOM in '" + error_html + "'");
console.log("MKWS tests failed after " + result.time / 1000 + " seconds");
console.log(result.error_msg.join("\n"));
console.log("keep screenshot in '" + error_png + "'");
page.render(error_png);
console.log("keep html DOM in '" + error_html + "'");
- console.log("you may run: lynx -nolist -dump " + error_html);
- var html = result.html + "\n\n<!-- mkws: " + JSON.stringify(result.mkws) + " -->\n";
- var fs = require('fs');
- fs.write(error_html, html, "wb");
+ // console.log("you may run: lynx -nolist -dump " + error_html);
}, run_time * 1000);
});
}, run_time * 1000);
});