[FIX] website: prevent edit menu tour to fail sometimes

The goal of this commit is to fix the race condition introduced by
[this commit]. Here were the problematic steps:
- Open the mega menu.
- When then mega menu is opened, scroll up.
- Open the mega menu after scroll.
Before this commit, what could happened was that the mega menu did not
have enough time to be closed after the scroll. Clicking on it would
then actually close it rather than open it as wanted. This commit adds
a step to ensure that the mega menu is closed before open it.

[this commit]: https://github.com/odoo/odoo/commit/9b1de9e28697edbb6e1fa88665294f983f60e37f

runbot-20660

closes odoo/odoo#119438

X-original-commit: abd0038de73a057eb9c34dc8d316b67d96fac409
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
This commit is contained in:
Louis (loco)
2023-04-25 05:06:51 +02:00
parent b65e7a4a10
commit d5f86d4995
@@ -250,6 +250,11 @@ wTourUtils.registerWebsitePreviewTour('edit_menus', {
.scrollIntoView(true);
}
},
{
content: "Check that the mega menu is closed",
trigger: 'iframe #top_menu .nav-item:contains("Megaaaaa!"):has(div[data-name="Mega Menu"]:not(.show))',
run:() => {}, // It's a check.
},
{
content: "Open the mega menu after scroll",
trigger: 'iframe #top_menu .nav-item a.o_mega_menu_toggle:contains("Megaaaaa!")',