diff --git a/addons/website/static/tests/tours/website_style_edition.js b/addons/website/static/tests/tours/website_style_edition.js index 35742e13520..cb54682cc9b 100644 --- a/addons/website/static/tests/tours/website_style_edition.js +++ b/addons/website/static/tests/tours/website_style_edition.js @@ -5,6 +5,13 @@ const wTourUtils = require("website.tour_utils"); const TARGET_FONT_SIZE = 30; +const checkFontSize = function (actions) { + const style = actions.tip_widget.el.ownerDocument.defaultView.getComputedStyle(this.$anchor[0]); + if (style.fontSize !== `${TARGET_FONT_SIZE}px`) { + console.error(`Expected the font-size to be equal to ${TARGET_FONT_SIZE}px but found ${style.fontSize} instead`); + } +}; + wTourUtils.registerWebsitePreviewTour("website_style_edition", { test: true, url: '/', @@ -17,19 +24,23 @@ wTourUtils.registerWebsitePreviewTour("website_style_edition", { content: "Change font size", trigger: '[data-variable="font-size-base"] input', run: `text_blur ${TARGET_FONT_SIZE}`, -}, -...wTourUtils.clickOnSave(), { +}, { content: "Check the font size was properly adapted", + trigger: 'iframe #wrapwrap', + // Waiting the CSS to be reloaded: the code adds a new assets bundle with + // a #t=... at the end then removes the old one. + extra_trigger: 'iframe html:not(:has(link[href$="web.assets_frontend.min.css"]))', + run: checkFontSize, +}, +...wTourUtils.clickOnSave(), +{ + content: "Check the font size is still ok outside of edit mode", trigger: 'iframe body:not(.editor_enable) #wrapwrap', - run: function (actions) { - const style = actions.tip_widget.el.ownerDocument.defaultView.getComputedStyle(this.$anchor[0]); - if (style.fontSize !== `${TARGET_FONT_SIZE}px`) { - console.error(`Expected the font-size to be equal to ${TARGET_FONT_SIZE}px but found ${style.fontSize} instead`); - } - }, + run: checkFontSize, }, wTourUtils.clickOnEdit(), -wTourUtils.goToTheme(), { +wTourUtils.goToTheme(), +{ content: "Click on the Background Image selection", trigger: '[data-customize-body-bg-type="\'image\'"]:not(.active)', extra_trigger: '[data-customize-body-bg-type="NONE"].active',