[IMP] web: Run JS tests

After this commit, the tests launched from the debug tools or the
command palette will be in debug=assets mode.

This commit adds the "Run JS tests" and "Run Mobile JS tests" commands.

closes odoo/odoo#80842

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
FrancoisGe
2021-12-03 14:19:02 +00:00
parent 5801ff87cf
commit dc93dbefe0
3 changed files with 19 additions and 3 deletions
@@ -11,7 +11,7 @@ function runPoSJSTests({ env }) {
name: env._t("JS Tests"),
target: "new",
type: "ir.actions.act_url",
url: "/pos/ui/tests?mod=*",
url: "/pos/ui/tests?debug=assets",
});
},
sequence: 35,
@@ -28,6 +28,22 @@ commandProviderRegistry.add("debug", {
category: "debug",
name: env._t("Deactivate debug mode"),
});
result.push({
action() {
const runTestsURL = browser.location.origin + "/web/tests?debug=assets";
browser.open(runTestsURL);
},
category: "debug",
name: env._t("Run JS Tests"),
});
result.push({
action() {
const runTestsURL = browser.location.origin + "/web/tests/mobile?debug=assets";
browser.open(runTestsURL);
},
category: "debug",
name: env._t("Run JS Mobile Tests"),
});
} else {
if (options.searchValue.toLowerCase() === "debug") {
result.push({
@@ -6,7 +6,7 @@ import dialogs from "web.view_dialogs";
import { ComponentAdapter } from "web.OwlCompatibility";
function runJSTestsItem({ env }) {
const runTestsURL = browser.location.origin + "/web/tests?mod=*";
const runTestsURL = browser.location.origin + "/web/tests?debug=assets";
return {
type: "item",
description: env._t("Run JS Tests"),
@@ -19,7 +19,7 @@ function runJSTestsItem({ env }) {
}
function runJSTestsMobileItem({ env }) {
const runTestsMobileURL = browser.location.origin + "/web/tests/mobile?mod=*";
const runTestsMobileURL = browser.location.origin + "/web/tests/mobile?debug=assets";
return {
type: "item",
description: env._t("Run JS Mobile Tests"),