From af5bf85d344553bb1cc1315b07650962800fe775 Mon Sep 17 00:00:00 2001 From: Benoit Socias Date: Tue, 3 May 2022 08:39:33 +0000 Subject: [PATCH] [FIX] web_editor, website: increase stability of ace test tour This is an attempt at fixing a runbot race condition. It was executed succesfully without any error on Multi build around 200 times on runbot. Since [1] the reset button could be clicked before the HTML editor was reloaded. The `MutationObserver` in `tour_service.js` is debounced. Because of this the states used to detect tour steps triggers might differ between executions. With the Reset button of the HTML editor not being hidden in the rendered template, it might be detected before it gets hidden during the `start` of `ace.js`. This commit makes sure the the editor is both closed then reopened with the Reset button visible before clicking on it, and also makes sure the Reset button is not visible by default upon rendering. [1]: https://github.com/odoo/odoo/commit/d20468c3463927a54c34688769a22b3949c5c465 runbot-3674 closes odoo/odoo#90453 X-original-commit: b35f127c86c1d271a76dae7186a96190e8558c73 Signed-off-by: Romain Derie (rde) --- addons/web_editor/static/src/xml/ace.xml | 2 +- addons/website/static/tests/tours/html_editor.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/xml/ace.xml b/addons/web_editor/static/src/xml/ace.xml index be9fe53dd87..46f05469a78 100644 --- a/addons/web_editor/static/src/xml/ace.xml +++ b/addons/web_editor/static/src/xml/ace.xml @@ -45,7 +45,7 @@
- +
diff --git a/addons/website/static/tests/tours/html_editor.js b/addons/website/static/tests/tours/html_editor.js index b554e8844aa..130b16fabef 100644 --- a/addons/website/static/tests/tours/html_editor.js +++ b/addons/website/static/tests/tours/html_editor.js @@ -211,6 +211,11 @@ tour.register('test_html_editor_scss', { extra_trigger: `div.ace_line:contains("${demoCssModif}")`, trigger: ".o_ace_view_editor button[data-action=save]", }, + { + content: "wait for reload", + trigger: ":not(.o_ace_view_editor)", + run: function () {}, // it's a check + }, { content: "reset view (after reload, html editor should have been reopened where it was)", trigger: '#ace-view-id button[data-action="reset"]',