[FIX] web: clickbot hard-coded date in tests
This commit, fix the issue that some tests fails on other month than October, this occurs because the current date wasn't patched on the tests. Moreover, this commit removes the log "Clicking on: Control Panel menu", this log is not very important, and can increase significantly the size of the log.# with '#' will be ignored, and an empty message aborts the commit. closes odoo/odoo#140728 X-original-commit: 3538513c87098aab21bd2224fbf6a338ffd5b577 Related: odoo/enterprise#50046 Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
This commit is contained in:
@@ -96,7 +96,9 @@ async function waitForNextAnimationFrame() {
|
||||
*/
|
||||
async function triggerClick(target, elDescription) {
|
||||
if (target) {
|
||||
browser.console.log(`Clicking on: ${elDescription}`);
|
||||
if (elDescription) {
|
||||
browser.console.log(`Clicking on: ${elDescription}`);
|
||||
}
|
||||
} else {
|
||||
throw new Error(`No element "${elDescription}" found.`);
|
||||
}
|
||||
@@ -268,7 +270,7 @@ async function testFilters() {
|
||||
return;
|
||||
}
|
||||
// Open the search bar menu dropdown
|
||||
await triggerClick(searchBarMenu, "Control Panel menu");
|
||||
await triggerClick(searchBarMenu);
|
||||
const filterMenuButton = document.querySelector(
|
||||
".o_control_panel .o_dropdown_container.o_filter_menu"
|
||||
);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { registry } from "@web/core/registry";
|
||||
import { createWebClient } from "./helpers";
|
||||
import { makeDeferred, patchWithCleanup } from "@web/../tests/helpers/utils";
|
||||
import { makeDeferred, patchDate, patchWithCleanup } from "@web/../tests/helpers/utils";
|
||||
import { browser } from "@web/core/browser/browser";
|
||||
import { ListRenderer } from "@web/views/list/list_renderer";
|
||||
import { onWillStart, onWillUpdateProps } from "@odoo/owl";
|
||||
@@ -124,7 +124,8 @@ QUnit.module("clickbot", (hooks) => {
|
||||
};
|
||||
registry.category("command_categories").add("view_switcher", {});
|
||||
});
|
||||
QUnit.skip("clickbot clickeverywhere test", async (assert) => {
|
||||
QUnit.test("clickbot clickeverywhere test", async (assert) => {
|
||||
patchDate(2017, 9, 8, 15, 35, 11); // October 8 2017, 15:35:11
|
||||
patchWithCleanup(browser, {
|
||||
console: {
|
||||
log: (msg) => {
|
||||
@@ -148,14 +149,12 @@ QUnit.module("clickbot", (hooks) => {
|
||||
"Testing app menu: app1",
|
||||
"Testing menu App1 app1",
|
||||
'Clicking on: menu item "App1"',
|
||||
"Clicking on: Control Panel menu",
|
||||
"Testing 2 filters",
|
||||
'Clicking on: filter "Not Bar"',
|
||||
'Clicking on: filter "Date"',
|
||||
'Clicking on: filter option "October"',
|
||||
"Testing view switch: kanban",
|
||||
"Clicking on: kanban view switcher",
|
||||
"Clicking on: Control Panel menu",
|
||||
"Testing 2 filters",
|
||||
'Clicking on: filter "Not Bar"',
|
||||
'Clicking on: filter "Date"',
|
||||
@@ -164,21 +163,18 @@ QUnit.module("clickbot", (hooks) => {
|
||||
"Testing app menu: app2",
|
||||
"Testing menu App2 app2",
|
||||
'Clicking on: menu item "App2"',
|
||||
"Clicking on: Control Panel menu",
|
||||
"Testing 2 filters",
|
||||
'Clicking on: filter "Not Bar"',
|
||||
'Clicking on: filter "Date"',
|
||||
'Clicking on: filter option "October"',
|
||||
"Testing menu menu 1 app2_menu1",
|
||||
'Clicking on: menu item "menu 1"',
|
||||
"Clicking on: Control Panel menu",
|
||||
"Testing 2 filters",
|
||||
'Clicking on: filter "Not Bar"',
|
||||
'Clicking on: filter "Date"',
|
||||
'Clicking on: filter option "October"',
|
||||
"Testing menu menu 2 app2_menu1",
|
||||
'Clicking on: menu item "menu 2"',
|
||||
"Clicking on: Control Panel menu",
|
||||
"Testing 2 filters",
|
||||
'Clicking on: filter "Not Bar"',
|
||||
'Clicking on: filter "Date"',
|
||||
@@ -312,7 +308,8 @@ QUnit.module("clickbot", (hooks) => {
|
||||
]);
|
||||
});
|
||||
|
||||
QUnit.skip("clickbot clickeverywhere menu modal", async (assert) => {
|
||||
QUnit.test("clickbot clickeverywhere menu modal", async (assert) => {
|
||||
patchDate(2017, 9, 8, 15, 35, 11); // October 8 2017, 15:35:11
|
||||
serverData.views["foo,false,form"] = `
|
||||
<form>
|
||||
<field name="foo"/>
|
||||
@@ -362,14 +359,12 @@ QUnit.module("clickbot", (hooks) => {
|
||||
"Testing app menu: app1",
|
||||
"Testing menu App1 app1",
|
||||
'Clicking on: menu item "App1"',
|
||||
"Clicking on: Control Panel menu",
|
||||
"Testing 2 filters",
|
||||
'Clicking on: filter "Not Bar"',
|
||||
'Clicking on: filter "Date"',
|
||||
'Clicking on: filter option "October"',
|
||||
"Testing view switch: kanban",
|
||||
"Clicking on: kanban view switcher",
|
||||
"Clicking on: Control Panel menu",
|
||||
"Testing 2 filters",
|
||||
'Clicking on: filter "Not Bar"',
|
||||
'Clicking on: filter "Date"',
|
||||
|
||||
Reference in New Issue
Block a user