Files
design-themes/theme_test_custo/static/tests/tours/theme_menu_hierarchies.js
T
Soukéina Bojabza 103e544835 [FIX] theme_test_custo: consider the top_menu navbar class in tests
In PR [1], the duplicated navbars ids `o_main_nav` and `top_menu` are
replaced by classes, to avoid having the same ids multiple times in the
DOM. Note that for stability, the ids are kept for the desktop view
navbar.

This commit adapts the tests so they now consider the classes and not
the ids.

[1]: https://github.com/odoo/odoo/pull/146492

task-3609531

closes odoo/design-themes#778

X-original-commit: f10d814809
Related: odoo/odoo#155482
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2024-02-29 22:01:22 +00:00

63 lines
2.6 KiB
JavaScript

/** @odoo-module */
import wTourUtils from '@website/js/tours/tour_utils';
wTourUtils.registerWebsitePreviewTour('theme_menu_hierarchies', {
url: '/example',
test: true,
}, () => [
{
content: 'Check Mega Menu is correctly created',
trigger: "iframe .top_menu a.o_mega_menu_toggle",
}, {
content: 'Check Mega Menu content',
trigger: "iframe .top_menu div.o_mega_menu.show .fa-cube",
run: () => null, // It's a check.
}, {
content: 'Check new top level menu is correctly created',
trigger: 'iframe .top_menu .nav-item.dropdown .dropdown-toggle:contains("Example 1")',
}, {
content: 'Check sub menu are correctly created',
trigger: 'iframe .top_menu .dropdown-menu.show a.dropdown-item:contains("Item 1")',
run: () => null, // It's a check.
}, {
content: 'The new menu hierarchy should not be included in the navbar',
trigger: 'iframe body:not(:has(.top_menu a[href="/dogs"]))',
run: () => null, // It's a check.
}, {
content: 'The new menu hierarchy should be inside the footer',
trigger: 'iframe footer ul li a[href="/dogs"]',
run: () => null, // It's a check.
},
...wTourUtils.clickOnEditAndWaitEditMode(),
{
content: 'Click on footer',
trigger: 'iframe footer',
}, {
content: 'The theme custom footer template should be listed and selected',
trigger: 'we-select[data-variable="footer-template"] we-toggler img[src*="/theme_test_custo"]',
run: () => null, // It's a check.
}, {
content: 'Click on header',
trigger: 'iframe header',
}, {
content: 'The theme custom header template should be listed and selected',
trigger: 'we-select[data-variable="header-template"] we-toggler img[src*="/theme_test_custo"]',
run: () => null, // It's a check.
}, {
content: 'Click on image which has a shape',
trigger: 'iframe #wrap .s_text_image img[data-shape]',
}, {
content: 'The theme custom "Blob 01" shape should be listed and selected',
trigger: 'we-select[data-name="shape_img_opt"] we-toggler:contains("Blob 01")',
run: () => null, // It's a check.
}, {
content: 'Click on section which has a bg shape',
trigger: 'iframe #wrap .s_text_block[data-oe-shape-data]',
}, {
content: 'The theme custom "Curve 01" shape should be listed and selected',
trigger: 'we-select[data-name="bg_shape_opt"] we-toggler:contains("Curve 01")',
run: () => null, // It's a check.
},
]);