summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/tools
diff options
context:
space:
mode:
authorChristophe Monniez <moc@odoo.com>2019-02-15 15:59:55 +0000
committerChristophe Monniez <moc@odoo.com>2019-02-19 08:06:07 +0000
commitfec86404e7de3b22b4945812d525d4017d254c33 (patch)
tree23a4e8e30c1dd398e38fc93f1a1499754830ed1e /addons/web/static/src/js/tools
parent83e6faf9a227686b7abe418aadb3bbf9d96955c2 (diff)
[IMP] tests: replace browser_js success and failure strings
When evaluating js tests using the browser_js method, they are considered a success when 'ok' is found in the console log and a failure if 'error' is found instead. This is not very robust and recently failed with this commit : 7410de111fe It adds a filter named 'Error' in a view, when the 'click_all' test clicks on this filter, a message with the name of the filter is written in the console, wrongly leading to a test failure. With this commit, the browser_js method expects a log message in the browser console with the explicit text "test successful". On the other hand, any error in the console log will lead to a test failure but a test can be forced to fail with the explicit error message in the browser console "test failed". As a bonus, the python logger should now also log browser js trace messages. closes odoo/odoo#31158
Diffstat (limited to 'addons/web/static/src/js/tools')
-rw-r--r--addons/web/static/src/js/tools/test_menus.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/web/static/src/js/tools/test_menus.js b/addons/web/static/src/js/tools/test_menus.js
index c7b1846b1e9..4e31b2d4467 100644
--- a/addons/web/static/src/js/tools/test_menus.js
+++ b/addons/web/static/src/js/tools/test_menus.js
@@ -70,11 +70,11 @@
return testDef.then(function() {
console.log("Successfully tested ", testedApps.length, " apps");
console.log("Successfully tested ", testedMenus.length - testedApps.length, " menus");
- console.log("ok");
+ console.log("test successful");
}).always(function() {
console.log("Test took ", (performance.now() - startTime)/1000, " seconds");
}).fail(function () {
- console.error("Error !");
+ console.error("test failed");
});
}