[WIP] website_sale: test tour debug

bzr revid: chm@openerp.com-20140122081321-8mtcqnd5yyx6c2nj
This commit is contained in:
Christophe Matthieu
2014-01-22 09:13:21 +01:00
parent d9582aa9e4
commit 35b7cd5d51
3 changed files with 4 additions and 5 deletions
@@ -9,7 +9,8 @@ function waitFor (ready, callback, timeout, timeoutMessageCallback) {
if(!condition) {
var message = timeoutMessageCallback ? timeoutMessageCallback() : "Timeout after "+timeout+" ms";
console.log('{ "event": "error", "message": "'+message+'" }');
console.log("Waiting for...\n"+ready);
var json = { "event": "error", "message": "Waiting for...\n"+ready };
console.log(JSON.stringify(json));
phantom.exit(1);
} else {
clearInterval(interval);
@@ -17,7 +18,7 @@ function waitFor (ready, callback, timeout, timeoutMessageCallback) {
}
}
}, 100);
};
}
function run (test) {
var options = JSON.parse(phantom.args);
@@ -292,9 +292,8 @@
url: /shop\/confirmation\//,
},
afterTrigger: function (tour) {
localStorage.setItem("test-success", "{}");
window.localStorage.setItem("test-success", "{}");
throw "afterTrigger test finish, remove this throw";
},
}
];
@@ -18,7 +18,6 @@ testRunner.run(function websiteSaleTest (page, timeout) {
return page.evaluate(function () {
var res = window.localStorage && window.localStorage.getItem
&& window.localStorage.getItem("test-success");
console.log('{ "error": "testExecuted", "message": "'+res+'"" }');
return res;
});
}, function finish () {