From 74a98ea0be3678466e303583d3d322892d9b75e3 Mon Sep 17 00:00:00 2001 From: Romain Derie Date: Wed, 13 Feb 2019 18:02:00 +0000 Subject: [PATCH] [FIX] website: adapt tests to new editor and new html editor Scss tour was broken due to recent task that shows only 2 new custom scss files if not in edit mode. As the tests was trying to read `website.ui.scss` that is now in debug mode in a filter, it would not be found. Html tour was broken due to new editor that changed the save process. For some reason, after the drag & drop of a snippet, clicking fast on save would not fire RPCs as it would not be considered as dirty. (Editor would then close, you would still see the modifications even if nothing was saved on DB) closes odoo/odoo#31067 --- addons/website/static/src/js/html_editor.test.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/website/static/src/js/html_editor.test.js b/addons/website/static/src/js/html_editor.test.js index 6c7633cf7aa..99f93eb069a 100644 --- a/addons/website/static/src/js/html_editor.test.js +++ b/addons/website/static/src/js/html_editor.test.js @@ -23,7 +23,7 @@ tour.register('html_editor_multiple_templates', { }, { content: "save the page", - extra_trigger: '#wrapwrap .s_cover', + extra_trigger: '#oe_structure_test_ui.o_dirty', trigger: "#web_editor-top-edit button[data-action=save]", }, // 2. Edit generic aboutus view @@ -99,17 +99,17 @@ tour.register('test_html_editor_scss', { trigger: '.o_ace_type_switcher_choice[data-type="scss"]', }, { - content: "select 'website.ui.scss'", - trigger: '#ace-scss-list', + content: "select 'user_custom_rules'", + trigger: 'body:has(#ace-scss-list option:contains("user_custom_rules"))', run: function () { - var scssId = $('#ace-scss-list option:contains("website.ui")').val(); + var scssId = $('#ace-scss-list option:contains("user_custom_rules")').val(); $('#ace-scss-list').val(scssId).trigger('change'); }, }, // 2. Edit that file and ensure it was saved then reset it { content: "add some scss content in the file", - trigger: 'div.ace_line .ace_variable:contains("body.o_connected_user")', + trigger: 'div.ace_line .ace_comment:contains("footer {")', run: function () { ace.edit('ace-view-editor').getSession().insert({row: 2, column: 0}, '#wrap {display: none;}\n'); },