[FIX] web: clickbot: correctly select first level menus

Before this commit, when we wanted to select first level menus
inside an app (i.e. menus available in the navbar), we could by
mistake select sub-menus if the dropdown was opened (e.g. if it
was previously tested). For instance, it happened in the 'Apps'
app. It then led to wrong index computation, and a traceback. As
a consequence, the nightly build failed as the clickEverywhere test
didn't pass.
This commit is contained in:
Aaron Bohy
2021-06-22 09:02:40 +00:00
parent 3f399ac3a8
commit 36370207b7
@@ -158,7 +158,7 @@
*/
async function getNextMenu() {
const menus = document.querySelectorAll(
".o_menu_sections .o_dropdown_toggler, .o_menu_sections .o_dropdown_item"
".o_menu_sections > .o_dropdown > .o_dropdown_toggler, .o_menu_sections > .o_dropdown_item"
);
if (menuIndex === menus.length) {
menuIndex = 0;
@@ -374,7 +374,7 @@
async function _clickEverywhere(xmlId) {
ensureSetup();
console.log("Starting ClickEverywhere test");
console.log(`Odoo flavor: ${isEnterprise} ? 'Enterprise' : 'Community'`);
console.log(`Odoo flavor: ${isEnterprise ? "Enterprise" : "Community"}`);
const startTime = performance.now();
testedApps = [];
testedMenus = [];