[IMP] test_themes, theme_test_custo: add new test theme for tests

This commit introduces a new theme for tests purpose.
The goal is to be able to create records and simulate a real use case
without only testing through unit tests in python.
For instance, with this commit, we now fully test:
- menu creation
- page creation
- new header & footer template
- new image shape & background shape

This will be extended later to be able to test other stuff too, maybe
like changing the website logo (not supported yet). Also, our existing
standalone test in themes should use this theme instead of nano to not
rely on a real theme that might change.

Courtesy of NMI as this theme is partly based on his job.

closes odoo/design-themes#586

Related: odoo/odoo#99099
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
Romain Derie
2022-08-29 21:55:51 +00:00
parent ca449f01f8
commit 0e2497b8e8
23 changed files with 530 additions and 6 deletions
@@ -0,0 +1,64 @@
/** @odoo-module */
import wTourUtils from 'website.tour_utils';
wTourUtils.registerEditionTour('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.clickOnEdit(),
{
content: 'Click on footer',
// TODO: this extra_trigger should be part of the `clickOnEdit` util
extra_trigger: "#oe_snippets.o_loaded",
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.
},
]);