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:
f247ee7
)
make a screenshot if the test failed
author
Wolfram Schneider
<wosch@indexdata.dk>
Thu, 30 Jan 2014 22:23:29 +0000
(22:23 +0000)
committer
Wolfram Schneider
<wosch@indexdata.dk>
Thu, 30 Jan 2014 22:23:29 +0000
(22:23 +0000)
test/spec-dev/evaluate.js
patch
|
blob
|
history
diff --git
a/test/spec-dev/evaluate.js
b/test/spec-dev/evaluate.js
index
ac4dbe9
..
be26202
100644
(file)
--- a/
test/spec-dev/evaluate.js
+++ b/
test/spec-dev/evaluate.js
@@
-24,7
+24,8
@@
page.open(url, function (status) {
console.log("fetch " + url + " with status: " + status);
console.log("polling MKWS test status...");
console.log("fetch " + url + " with status: " + status);
console.log("polling MKWS test status...");
- for (var i = 1; i < run_time; i++) {
+ var r;
+ for (var i = 1; i <= run_time; i++) {
setTimeout(function () {
var result = page.evaluate(function (s) {
// return document.querySelector(s).innerText;
setTimeout(function () {
var result = page.evaluate(function (s) {
// return document.querySelector(s).innerText;
@@
-39,11
+40,17
@@
page.open(url, function (status) {
console.log("MKWS tests are successfully done. Hooray!");
phantom.exit(0);
}
console.log("MKWS tests are successfully done. Hooray!");
phantom.exit(0);
}
+ r = result;
}, i * 1000);
}
}, i * 1000);
}
+
setTimeout(function () {
setTimeout(function () {
+ var error_png = "./mkws-error.png";
console.log("MKWS tests failed after " + run_time + " seconds");
console.log("MKWS tests failed after " + run_time + " seconds");
+ console.log("keep screenshot in '" + error_png + "'");
+
+ page.render(error_png);
phantom.exit(1);
phantom.exit(1);
- }, run_time * 1000);
+ }, (run_time + 1) * 1000);
});
});