diff --git a/addons/test_website/static/tests/tours/image_link.js b/addons/test_website/static/tests/tours/image_link.js index 5fea93d982e..3380d6bdfe6 100644 --- a/addons/test_website/static/tests/tours/image_link.js +++ b/addons/test_website/static/tests/tours/image_link.js @@ -6,6 +6,18 @@ import wTourUtils from 'website.tour_utils'; * The purpose of this tour is to check the link on image flow. */ +const selectImageSteps = [{ + content: "select block", + trigger: "iframe #wrapwrap .s_text_image", +}, { + content: "check link popover disappeared", + trigger: "iframe body:not(:has(.o_edit_menu_popover))", + run: () => {}, // check +}, { + content: "select image", + trigger: "iframe #wrapwrap .s_text_image img", +}]; + wTourUtils.registerEditionTour('test_image_link', { test: true, url: '/', @@ -14,20 +26,18 @@ wTourUtils.registerEditionTour('test_image_link', { wTourUtils.dragNDrop({ id: 's_text_image', name: 'Text - Image', - }), { - content: "select image", - trigger: "iframe #wrapwrap .s_text_image img", - }, { + }), + ...selectImageSteps, + { content: "enable link", trigger: "#oe_snippets we-customizeblock-options:has(we-title:contains('Image')) we-customizeblock-option:has(we-title:contains(Media)) we-button.fa-link", }, { content: "enter site URL", trigger: "#oe_snippets we-customizeblock-options:has(we-title:contains('Image')) we-input:contains(Your URL) input", run: "text odoo.com", - }, { - content: "select image", - trigger: "iframe #wrapwrap .s_text_image img", - }, { + }, + ...selectImageSteps, + { content: "check popover content has site URL", trigger: ".o_edit_menu_popover a.o_we_url_link[href='http://odoo.com/']:contains(http://odoo.com/)", run: () => {}, // check @@ -35,10 +45,9 @@ wTourUtils.registerEditionTour('test_image_link', { content: "remove URL", trigger: "#oe_snippets we-customizeblock-options:has(we-title:contains('Image')) we-input:contains(Your URL) input", run: "remove_text", - }, { - content: "select image", - trigger: "iframe #wrapwrap .s_text_image img", - }, { + }, + ...selectImageSteps, + { content: "check popover content has no URL", trigger: ".o_edit_menu_popover a.o_we_url_link:not([href]):contains(No URL specified)", run: () => {}, // check @@ -46,10 +55,9 @@ wTourUtils.registerEditionTour('test_image_link', { content: "enter email URL", trigger: "#oe_snippets we-customizeblock-options:has(we-title:contains('Image')) we-input:contains(Your URL) input", run: "text mailto:test@test.com", - }, { - content: "select image", - trigger: "iframe #wrapwrap .s_text_image img", - }, { + }, + ...selectImageSteps, + { content: "check popover content has mail URL", trigger: ".o_edit_menu_popover:has(.fa-envelope-o) a.o_we_url_link[href='mailto:test@test.com']:contains(mailto:test@test.com)", run: () => {}, // check @@ -57,10 +65,9 @@ wTourUtils.registerEditionTour('test_image_link', { content: "enter phone URL", trigger: "#oe_snippets we-customizeblock-options:has(we-title:contains('Image')) we-input:contains(Your URL) input", run: "text tel:555-2368", - }, { - content: "select image", - trigger: "iframe #wrapwrap .s_text_image img", - }, { + }, + ...selectImageSteps, + { content: "check popover content has phone URL", trigger: ".o_edit_menu_popover:has(.fa-phone) a.o_we_url_link[href='tel:555-2368']:contains(tel:555-2368)", run: () => {}, // check @@ -68,10 +75,9 @@ wTourUtils.registerEditionTour('test_image_link', { content: "remove URL", trigger: "#oe_snippets we-customizeblock-options:has(we-title:contains('Image')) we-input:contains(Your URL) input", run: "remove_text", - }, { - content: "select image", - trigger: "iframe #wrapwrap .s_text_image img", - }, { + }, + ...selectImageSteps, + { content: "check popover content has no URL", trigger: ".o_edit_menu_popover a.o_we_url_link:not([href]):contains(No URL specified)", run: () => {}, // check