diff options
| author | Christophe Monniez <moc@odoo.com> | 2019-09-04 13:33:15 +0000 |
|---|---|---|
| committer | Christophe Monniez <moc@odoo.com> | 2019-09-04 13:33:15 +0000 |
| commit | 95fefe6cc53c5a732046e7b1fa50c2924005d2c3 (patch) | |
| tree | 7787665a300b2722bcebd6c4f17d6f03f91bb386 /addons/web/static | |
| parent | 35829f203124c0b333df29b2583d5b7863a94dae (diff) | |
[FIX] web: avoid some external links in click_all test
Since 78565b1dc933 , two menus with an act_url action drive the user to
external websites. This makes the click_all test very fragile.
With this commit the Apps menus "Theme Store" and "Third-Party Apps" are
black-listed in the click_all test.
Also, it happens that a filter which is not supposed to work in some
circumstances is simply hidden. Actually, the click_all test sets that
filter and leads to a crash.
With this commit, for a more realistic use case, the click_all test does
not activate hidden filters.
closes odoo/odoo#36433
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Diffstat (limited to 'addons/web/static')
| -rw-r--r-- | addons/web/static/src/js/tools/test_menus.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/web/static/src/js/tools/test_menus.js b/addons/web/static/src/js/tools/test_menus.js index 82a4ed26c0e..df089c01fcf 100644 --- a/addons/web/static/src/js/tools/test_menus.js +++ b/addons/web/static/src/js/tools/test_menus.js @@ -8,6 +8,7 @@ var viewUpdateCount = 0; var testedApps; var testedMenus; + var blackListedMenus = ['base.menu_theme_store', 'base.menu_third_party']; function createWebClientHooks() { var AbstractController = odoo.__DEBUG__.services['web.AbstractController']; @@ -126,6 +127,7 @@ if (testedMenus.indexOf(element.dataset.menuXmlid) >= 0) return Promise.resolve(); // Avoid infinite loop console.log("Testing menu", element.innerText.trim(), " ", element.dataset.menuXmlid); testedMenus.push(element.dataset.menuXmlid); + if (blackListedMenus.includes(element.dataset.menuXmlid)) return Promise.resolve(); // Skip black listed menus var startActionCount = clientActionCount; _click($(element)); var isModal = false; @@ -203,7 +205,7 @@ function testFilters() { 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'); + var $filters = $('.o_filters_menu > .o_menu_item:not(.d-none)'); console.log("Testing " + $filters.length + " filters"); var filter_ids = _.compact(_.map($filters, function(f) { return f.dataset.id})); filter_ids.forEach(function(filter_id){ |
