From d22cd89a605b3edca835ceb09891de936796a656 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 25 Jul 2022 12:43:18 +0000 Subject: [PATCH] [FIX] web: opt clickall out of form edition check We can't really know where the clickall tour will end, and if it ends on the settings action things are rather difficult as saving or discarding the settings form returns to the edition mode. Part-of: odoo/odoo#96517 --- addons/web/static/src/webclient/clickbot/clickbot.js | 5 ++--- addons/web/tests/test_click_everywhere.py | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/addons/web/static/src/webclient/clickbot/clickbot.js b/addons/web/static/src/webclient/clickbot/clickbot.js index 7d1301d76f4..53619a2aa70 100644 --- a/addons/web/static/src/webclient/clickbot/clickbot.js +++ b/addons/web/static/src/webclient/clickbot/clickbot.js @@ -443,12 +443,11 @@ } await testApp(app); } else { - app = await getNextApp(); - while (app) { + while (app = await getNextApp()) { await testApp(app); - app = await getNextApp(); } } + console.log("Test took", (performance.now() - startTime) / 1000, "seconds"); console.log("Successfully tested", testedApps.length, " apps"); console.log("Successfully tested", testedMenus.length - testedApps.length, "menus"); diff --git a/addons/web/tests/test_click_everywhere.py b/addons/web/tests/test_click_everywhere.py index 78ad2ad9976..e8957c403ee 100644 --- a/addons/web/tests/test_click_everywhere.py +++ b/addons/web/tests/test_click_everywhere.py @@ -8,7 +8,7 @@ _logger = logging.getLogger(__name__) @odoo.tests.tagged('click_all', 'post_install', '-at_install', '-standard') class TestMenusAdmin(odoo.tests.HttpCase): - + allow_end_on_form = True def test_01_click_everywhere_as_admin(self): menus = self.env['ir.ui.menu'].load_menus(False) for app_id in menus['root']['children']: @@ -20,7 +20,7 @@ class TestMenusAdmin(odoo.tests.HttpCase): @odoo.tests.tagged('click_all', 'post_install', '-at_install', '-standard') class TestMenusDemo(odoo.tests.HttpCase): - + allow_end_on_form = True def test_01_click_everywhere_as_demo(self): user_demo = self.env.ref("base.user_demo") menus = self.env['ir.ui.menu'].with_user(user_demo.id).load_menus(False) @@ -32,12 +32,12 @@ class TestMenusDemo(odoo.tests.HttpCase): @odoo.tests.tagged('post_install', '-at_install') class TestMenusAdminLight(odoo.tests.HttpCase): - + allow_end_on_form = True def test_01_click_apps_menus_as_admin(self): self.browser_js("/web", "odoo.__DEBUG__.services['web.clickEverywhere'](undefined, true);", "odoo.isReady === true", login="admin", timeout=120) @odoo.tests.tagged('post_install', '-at_install',) class TestMenusDemoLight(odoo.tests.HttpCase): - + allow_end_on_form = True def test_01_click_apps_menus_as_demo(self): self.browser_js("/web", "odoo.__DEBUG__.services['web.clickEverywhere'](undefined, true);", "odoo.isReady === true", login="demo", timeout=120)