Skip to content
Snippets Groups Projects
Commit 95fefe6c authored by Christophe Monniez's avatar Christophe Monniez
Browse files

[FIX] web: avoid some external links in click_all test


Since 78565b1d , 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: default avatarChristophe Monniez (moc) <moc@odoo.com>
parent 35829f20
No related branches found
No related tags found
No related merge requests found
......@@ -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){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment