diff options
| author | Christophe Monniez <moc@odoo.com> | 2020-03-04 21:42:20 +0000 |
|---|---|---|
| committer | Christophe Monniez <moc@odoo.com> | 2020-03-05 08:06:02 +0000 |
| commit | bf3f67be280d90f4a3454e20b00df042c2cdca5c (patch) | |
| tree | c7b101fd2f686f8cf70966dfbb2524da8fa3047f /addons/web/static/src/js | |
| parent | 1a7e0fb01bb8669fe20b832b467f2c24fb0c25f3 (diff) | |
[IMP] web: add a light mode to clickEverywhere test
The test clickEverywhere may last a very long time when all modules are
installed. For that reason, it's not a standard test and we run it at
night.
Unfortunately, it may happen that an App menu breaks and that this
failure is only spotted the next morning.
With this commit, a light mode is added to the clickEverywhere test. In
this mode, only the app menus are tested.
Also, two python tests are added that use this mode and are launched as
standard tests.
closes odoo/odoo#46934
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/tools/test_menus.js | 7 | ||||
| -rw-r--r-- | addons/web/static/src/js/tools/test_menus_loader.js | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/addons/web/static/src/js/tools/test_menus.js b/addons/web/static/src/js/tools/test_menus.js index 1875c0e776e..9767aa29fed 100644 --- a/addons/web/static/src/js/tools/test_menus.js +++ b/addons/web/static/src/js/tools/test_menus.js @@ -9,6 +9,7 @@ var testedApps; var testedMenus; var blackListedMenus = ['base.menu_theme_store', 'base.menu_third_party']; + var appsMenusOnly = false; function createWebClientHooks() { var AbstractController = odoo.__DEBUG__.services['web.AbstractController']; @@ -45,7 +46,8 @@ } } - function clickEverywhere(menu_id){ + function clickEverywhere(menu_id, light){ + appsMenusOnly = light; setTimeout(_clickEverywhere, 1000, menu_id); } @@ -104,6 +106,7 @@ if (testedApps.indexOf(element.dataset.menuXmlid) >= 0) return Promise.resolve(); // Another infinite loop protection testedApps.push(element.dataset.menuXmlid); return testMenuItem(element).then(function () { + if (appsMenusOnly === true) return Promise.resolve(); var $subMenuItems; $subMenuItems = $('.o_menu_entry_lvl_1, .o_menu_entry_lvl_2, .o_menu_entry_lvl_3, .o_menu_entry_lvl_4'); var testMenuPromise = Promise.resolve(); @@ -172,6 +175,7 @@ * the click on each of them */ function testViews() { + if (appsMenusOnly === true) return Promise.resolve(); var $switches = $("nav.o_cp_switch_buttons > button:not(.active):visible"); var testSwitchPromise = Promise.resolve(); // chainDeferred($switches, testSwitchPromise, testViewSwitch # FIXME @@ -210,6 +214,7 @@ * Click on each filter in the control pannel */ function testFilters() { + if (appsMenusOnly === true) return Promise.resolve(); var filterProm = Promise.resolve(); // var $filters = $('div.o_control_panel div.btn-group.o_dropdown > ul.o_filters_menu > li:not(.o_add_custom_filter)'); var $filters = $('.o_filters_menu > .o_menu_item:not(.d-none)'); diff --git a/addons/web/static/src/js/tools/test_menus_loader.js b/addons/web/static/src/js/tools/test_menus_loader.js index d3e697cec75..160bb3e6b90 100644 --- a/addons/web/static/src/js/tools/test_menus_loader.js +++ b/addons/web/static/src/js/tools/test_menus_loader.js @@ -1,10 +1,10 @@ odoo.define('web.clickEverywhere', function (require) { "use strict"; var ajax = require('web.ajax'); - function startClickEverywhere(menu_id) { + function startClickEverywhere(menu_id, appsMenusOnly) { ajax.loadJS('web/static/src/js/tools/test_menus.js').then( function() { - clickEverywhere(menu_id); + clickEverywhere(menu_id, appsMenusOnly); } ); } |
