Skip to content
Snippets Groups Projects
Commit 6f32c27d authored by qsm-odoo's avatar qsm-odoo
Browse files

[FIX] website: make gray colors test more robust

Since a recent change at [1], a race condition seems to occur in the
gray colors palette test. Indeed, the change removed some delay in the
hackish code that is meant to wait for CSS reload.

Instead of restoring that otherwise-useless delay, this commit actually
fixes an extra_trigger that was incorrectly made in this test when it
was introduced at [2].

In any case, we should develop a more consistent and uniformed way to
wait for a CSS reload during edition test tours. It is currently done
different ways in different tests.

Note: this targets 16.0 to fix the wrong extra_trigger at the source,
even though [1] was only made in later versions.

[1]: https://github.com/odoo/odoo/commit/c6f8f781150902f585e16087f4a3868a855f3bd8#diff-795af7752739f5f510f74e5ee9b5b04d18a851062a1a6b7350cbe406e30a409dL18
[2]: https://github.com/odoo/odoo/commit/ddf2e74b4cf503ba651174bc7f280bf2f31a215e



runbot-24371

closes odoo/odoo#133345

Signed-off-by: default avatarRomain Derie (rde) <rde@odoo.com>
parent 8a6a5a10
Branches
Tags
No related merge requests found
......@@ -2,6 +2,9 @@
import wTourUtils from 'website.tour_utils';
function waitForCSSReload() {
// TODO we should find a better way to wait for this in tests after CSS
// reload, it is currently done multiple different ways depending on the
// test.
return [
{
// This step is here because the option is applied but triggers a
......@@ -17,6 +20,11 @@ function waitForCSSReload() {
trigger: '.o_we_customize_theme_btn',
extra_trigger: '#o_scroll',
},
{
content: "Wait for no loading",
trigger: 'body:not(:has(.o_we_ui_loading)) iframe body:not(:has(.o_we_ui_loading))',
run: () => null,
},
];
}
......@@ -51,7 +59,6 @@ wTourUtils.registerWebsitePreviewTour('website_gray_color_palette', {
{
content: "Drag the saturation slider",
trigger: '.o_we_user_value_widget[data-param="gray-extra-saturation"]',
extra_trigger: ':not(:has(.o_we_ui_loading))',
run: () => {
const slider = document.querySelector('.o_we_user_value_widget[data-param="gray-extra-saturation"] input');
slider.value = 15;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment