[FIX] website: fix the extra menu editing test
Starting from The "unbreakable menu fix" on `16.0` (see: [1]), the state of the website extra menu was stored before every "resize" adaptation, so it can be possible to reopen it if it was already opened. On `17.0`, the same behaviour was fixed using the `odooEditor` > `withoutRollback()` mechanism (see: [2]), and a step was added to the `edit_menus` test (`clickOnExtraMenuItem`) to open the extra menu after the "edit mode resize" [3]. The forward port of [1], on `17.0` was adapted to keep the main fix from [2], and removed the tour step since the extra menu will be automatically opened if it was already open before the "resize". Now, if we have a menu with no overflowing items before the resize, and after switching to "edit" mode an extra menu was added, this menu will be closed by default which makes the test fail without the step in [3]. The goal of this commit is to fix this behaviour by simply restoring the `clickOnExtraMenuItem` step with a simple tweak: We don't click if the extra menu is already opened to prevent closing it again. Remark: the test failed on `17.0` but the commit is targeting `16.0` to prevent any test failure linked to the "extra menu auto open" feature. [1]: https://github.com/odoo/odoo/commit/2598cc9ef7fe89a0ce5e375bca6f6a781f6ffdf7 [2]: https://github.com/odoo/odoo/commit/cbed990924887eb529056d89a042a92ba27b825b Related to opw-3484742 Related to task-3439226 closes odoo/odoo#157290 X-original-commit: 42bcc3ef284ca355e2323641176573b53e7d2e28 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com> Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
This commit is contained in:
@@ -331,7 +331,8 @@ function clickOnExtraMenuItem(stepOptions, backend = false) {
|
||||
trigger: `${backend ? "iframe" : ""} .top_menu`,
|
||||
run: function () {
|
||||
const extraMenuButton = this.$anchor[0].querySelector('.o_extra_menu_items a.nav-link');
|
||||
if (extraMenuButton) {
|
||||
// Don't click on the extra menu button if it's already visible.
|
||||
if (extraMenuButton && !extraMenuButton.classList.contains("show")) {
|
||||
extraMenuButton.click();
|
||||
}
|
||||
},
|
||||
|
||||
@@ -116,6 +116,7 @@ wTourUtils.registerWebsitePreviewTour('edit_menus', {
|
||||
},
|
||||
// Edit the menu item from the "edit menu" popover button
|
||||
...wTourUtils.clickOnEditAndWaitEditMode(),
|
||||
wTourUtils.clickOnExtraMenuItem({}, true),
|
||||
{
|
||||
content: "Click on the 'Modnar' link",
|
||||
trigger: 'iframe .top_menu .nav-item a:contains("Modnar")',
|
||||
|
||||
Reference in New Issue
Block a user