Odoo18-Base/addons/web/static/tests/_framework/start.hoot.js
KaySar12 8a9c49514f
Some checks are pending
Setup Native Action / native (3.12.7) (push) Waiting to run
Setup Native Action / docker (3.12.7) (push) Waiting to run
update base web lib
2025-05-23 14:51:51 +07:00

50 lines
1.2 KiB
JavaScript

// ! WARNING: this module cannot depend on modules not ending with ".hoot" (except libs) !
import { definePreset, defineTags } from "@odoo/hoot";
import { runTests } from "./module_set.hoot";
definePreset("desktop", {
icon: "fa-desktop",
label: "Desktop",
platform: "linux",
size: [1366, 768],
tags: ["-mobile"],
touch: false,
});
definePreset("mobile", {
icon: "fa-mobile font-bold",
label: "Mobile",
platform: "android",
size: [375, 667],
tags: ["-desktop"],
touch: true,
});
defineTags(
{
name: "desktop",
exclude: ["headless", "mobile"],
},
{
name: "mobile",
exclude: ["desktop", "headless"],
},
{
name: "headless",
exclude: ["desktop", "mobile"],
},
{
name: "focus required",
before: (test) => {
if (!document.hasFocus()) {
console.warn(
"[FOCUS REQUIRED]",
`test "${test.name}" requires focus inside of the browser window and will probably fail without it`
);
}
},
}
);
// Invoke tests after the module loader finished loading.
queueMicrotask(() => runTests({ fileSuffix: ".test" }));