[FIX] *: adapt QUnit tests and tours

[FIX] *: selectors in tours

[FIX][TMP] account: CogMenu selector in tours

[FIX][TMP] web*: Breadcrumb targetting in tours

Adds a `o_breadcrumb` class to target the whole breadcrumb, no matter
how much elements it contains (collapsed parts, visible path, single
name...).

add classname on last breadcrumb item

[FIX][TMP] project: View buttons selector in tours (moved away from CP)

[FIX][TMP] project: Kanban selectors in tours (quick create)

[FIX][TMP] *: SearchBar selectors in tours (toggle menu)

[FIX][TMP] *: ButtonBox selector in tours

[WIP][IMP] web: add toggleSearchBarMenu in search helpers

adapt and unskip 3 list tests

adapt and unskip calendar tests

unskip web_tour test that actually pass

post rebase fix

allow to lose cell focus after multi edition (given to searchbar) - bug reported, to check later

post rebase fixes

fix

Part-of: odoo/odoo#116641
This commit is contained in:
Pierre Paridans
2023-05-12 22:59:22 +02:00
parent 3aaa0bfff1
commit eef262abf4
112 changed files with 3673 additions and 2329 deletions
@@ -38,7 +38,7 @@ registry.category("web_tour.tours").add('project_tour', {
actions.auto('.modal:visible .btn.btn-primary');
},
}, {
trigger: ".o_kanban_project_tasks .o_column_quick_create .input-group .o_input",
trigger: ".o_kanban_project_tasks .o_column_quick_create .o_kanban_header input",
content: Markup(_t("Add columns to organize your tasks into <b>stages</b> <i>e.g. New - In Progress - Done</i>.")),
position: 'bottom',
run: "text Test",
@@ -46,7 +46,7 @@ registry.category("web_tour.tours").add('project_tour', {
trigger: ".o_kanban_project_tasks .o_column_quick_create .o_kanban_add",
position: 'right',
}, {
trigger: ".o_kanban_project_tasks .o_column_quick_create .input-group .o_input",
trigger: ".o_kanban_project_tasks .o_column_quick_create .o_kanban_header input",
extra_trigger: '.o_kanban_group',
content: Markup(_t("Add columns to organize your tasks into <b>stages</b> <i>e.g. New - In Progress - Done</i>.")),
position: 'bottom',
@@ -2,7 +2,7 @@
import { browser } from "@web/core/browser/browser";
import { click, getFixture, patchWithCleanup } from "@web/../tests/helpers/utils";
import { setupControlPanelServiceRegistry, toggleGroupByMenu, toggleMenuItem, toggleMenuItemOption } from "@web/../tests/search/helpers";
import { setupControlPanelServiceRegistry, toggleSearchBarMenu, toggleMenuItem, toggleMenuItemOption } from "@web/../tests/search/helpers";
import { makeView } from "@web/../tests/views/helpers";
import { registry } from "@web/core/registry";
import { makeFakeNotificationService, fakeCookieService } from "@web/../tests/helpers/mock_services";
@@ -133,7 +133,7 @@ QUnit.module("Project", {}, () => {
}
async function openGroupByMainMenu(target) {
await toggleGroupByMenu(target);
await toggleSearchBarMenu(target);
}
async function openGroupByDateMenu(target) {
@@ -164,12 +164,8 @@ QUnit.module("Project", {}, () => {
QUnit.test("check that removing the group by 'Date: Month > Stage' in the search bar triggers a notification", async function (assert) {
const stepsTriggeringNotification = async () => {
const removeFilterXpath = `//div[contains(@class, 'o_searchview_facet')]
[.//span[@class='o_facet_value']
[contains(., 'Date: Month')]]
/i[contains(@class, 'o_facet_remove')]`;
const removeFilterElement = getFirstElementForXpath(target, removeFilterXpath);
await click(removeFilterElement);
// There's only one possibility here
await click(target, ".o_facet_remove");
};
await testBurnDownChartWithSearchView(stepsTriggeringNotification, assert);
});
@@ -216,7 +212,7 @@ QUnit.module("Project", {}, () => {
function checkGroupByOrder(assert) {
const dateSearchFacetXpath = `//div[contains(@class, 'o_searchview_facet')]
[.//span[@class='o_facet_value']
[.//small[@class='o_facet_value']
[contains(., 'Date: Month')]]`;
const dateSearchFacetElement = getFirstElementForXpath(target, dateSearchFacetXpath);
const dateSearchFacetParts = dateSearchFacetElement.querySelectorAll('.o_facet_value');
@@ -16,7 +16,7 @@ registry.category("web_tour.tours").add('burndown_chart_tour', {
trigger: '.o_kanban_record:contains("Burndown Chart Test") .o_kanban_manage_reporting div[role="menuitem"] a:contains("Burndown Chart")',
}, {
content: 'The sort buttons are not rendered',
trigger: '.o_cp_bottom_left:not(:has(.btn-group[role=toolbar][aria-label="Sort graph"]))',
trigger: '.o_graph_renderer:not(:has(.btn-group[role=toolbar][aria-label="Sort graph"]))',
extra_trigger: '.o_graph_renderer',
}, {
content: 'Remove the project search "Burndown Chart Test"',
@@ -35,8 +35,8 @@ registry.category("web_tour.tours").add('burndown_chart_tour', {
content: 'A "The Burndown Chart must be grouped by Date and Stage" notification is shown when trying to remove the group by "Date: Month > Stage"',
trigger: '.o_notification_manager .o_notification:contains("The Burndown Chart must be grouped by Date and Stage") button.o_notification_close',
}, {
content: 'Open the group by menu',
trigger: '.o_group_by_menu button',
content: 'Open the search panel menu',
trigger: '.o_control_panel .o_searchview_dropdown_toggler',
}, {
content: 'The Stage group menu item is invisible',
trigger: '.o_group_by_menu:not(:has(.o_menu_item:contains("Stage")))',
@@ -56,8 +56,8 @@ registry.category("web_tour.tours").add('burndown_chart_tour', {
content: 'A "The Burndown Chart must be grouped by Date" notification is shown when trying to remove the group by "Date: Month > Stage"',
trigger: '.o_notification_manager .o_notification:contains("The Burndown Chart must be grouped by Date") button.o_notification_close',
}, {
content: 'Open the filter menu',
trigger: '.o_filter_menu button',
content: 'Open the search panel menu',
trigger: '.o_control_panel .o_searchview_dropdown_toggler',
}, {
content: 'Open the Date filter sub menu',
trigger: '.o_filter_menu button.o_menu_item:contains("Date")',
@@ -73,7 +73,10 @@ registry.category("web_tour.tours").add('burndown_chart_tour', {
}, {
content: 'Close the Date filter menu',
trigger: '.o_graph_renderer',
}, {
content: 'Open the search panel menu',
trigger: '.o_control_panel .o_searchview_dropdown_toggler',
}, {
content: 'The comparison menu is not rendered',
trigger: '.o_search_options:not(:has(.o_comparison_menu))',
trigger: ':not(:has(.o_comparison_menu))',
}]});
@@ -62,38 +62,23 @@ const projectSharingSteps = [...stepUtils.goToAppSteps("project.menu_main_pm", '
trigger: 'iframe ol.breadcrumb > li.o_back_button > a:contains(Project Sharing)',
content: 'Go back to the kanban view',
}, {
trigger: 'iframe .o_filter_menu > button',
content: 'click on filter menu in the search view',
trigger: 'iframe .o_searchview_dropdown_toggler',
content: 'open the search panel menu',
}, {
trigger: 'iframe .o_filter_menu > .dropdown-menu > .dropdown-item:first-child',
trigger: 'iframe .o_filter_menu .dropdown-item:first-child',
content: 'click on the first item in the filter menu',
}, {
trigger: 'iframe .o_group_by_menu > button',
content: 'click on group by menu in the search view',
}, {
trigger: 'iframe .o_group_by_menu > .dropdown-menu > .dropdown-item:first-child',
trigger: 'iframe .o_group_by_menu .dropdown-item:first-child',
content: 'click on the first item in the group by menu',
}, {
trigger: 'iframe .o_favorite_menu > button',
content: 'click on the favorite menu in the search view',
}, {
trigger: 'iframe .o_favorite_menu .o_add_favorite > button',
content: 'click to "save current search" button in favorite menu',
}, {
trigger: 'iframe .o_filter_menu > button',
content: 'click on filter menu in the search view',
}, {
trigger: 'iframe .o_filter_menu > .dropdown-menu > .dropdown-item:first-child',
trigger: 'iframe .o_filter_menu .dropdown-item:first-child',
content: 'click on the first item in the filter menu',
}, {
trigger: 'iframe .o_group_by_menu > button',
content: 'click on group by menu in the search view',
}, {
trigger: 'iframe .o_group_by_menu > .dropdown-menu > .dropdown-item:first-child',
trigger: 'iframe .o_group_by_menu .dropdown-item:first-child',
content: 'click on the first item in the group by menu',
}, {
trigger: 'iframe .o_favorite_menu > button',
content: 'click on the favorite menu in the search view',
}, {
trigger: 'iframe .o_favorite_menu .o_add_favorite > button',
content: 'click to "save current search" button in favorite menu',