|
1 | 1 | import {
|
2 |
| - changeOption, |
3 | 2 | clickOnExtraMenuItem,
|
4 | 3 | clickOnSave,
|
| 4 | + openLinkPopup, |
5 | 5 | registerWebsitePreviewTour,
|
6 | 6 | } from "@website/js/tours/tour_utils";
|
7 | 7 |
|
@@ -123,14 +123,10 @@ registerWebsitePreviewTour("megamenu_active_nav_link", {
|
123 | 123 | edition: true,
|
124 | 124 | }, () => [
|
125 | 125 | // Add a megamenu item to the top menu.
|
126 |
| - { |
127 |
| - content: "Click on a menu item", |
128 |
| - trigger: ":iframe .top_menu .nav-item a", |
129 |
| - run: "click", |
130 |
| - }, |
| 126 | + ...openLinkPopup(":iframe .top_menu .nav-item a:contains('Home')", "Home"), |
131 | 127 | {
|
132 | 128 | content: "Click on 'Link' to open Link Dialog",
|
133 |
| - trigger: ":iframe .o_edit_menu_popover a.js_edit_menu", |
| 129 | + trigger: ".o-we-linkpopover a.js_edit_menu", |
134 | 130 | run: "click",
|
135 | 131 | },
|
136 | 132 | {
|
@@ -160,49 +156,23 @@ registerWebsitePreviewTour("megamenu_active_nav_link", {
|
160 | 156 | run: "click",
|
161 | 157 | },
|
162 | 158 | {
|
163 |
| - trigger: "#oe_snippets.o_loaded", |
| 159 | + trigger: "body:not(:has(.modal))", |
164 | 160 | },
|
165 | 161 | {
|
166 | 162 | content: "Check for the new mega menu",
|
167 | 163 | trigger: `:iframe .top_menu:has(.nav-item a.o_mega_menu_toggle:contains("Megatron"))`,
|
168 | 164 | },
|
169 |
| - { |
170 |
| - trigger: ".o_website_preview.editor_enable.editor_has_snippets:not(.o_is_blocked)" |
171 |
| - }, |
172 | 165 | clickOnExtraMenuItem({}, true),
|
173 | 166 | toggleMegaMenu({}),
|
| 167 | + ...openLinkPopup(":iframe .s_mega_menu_odoo_menu .nav-link:contains('Laptops')", "Laptops"), |
174 | 168 | {
|
175 |
| - content: "Select the first menu link of the first column", |
176 |
| - trigger: ":iframe .s_mega_menu_odoo_menu .row > div:first-child .nav a", |
177 |
| - async run(actions) { |
178 |
| - await actions.click(); |
179 |
| - const iframeDocument = document.querySelector('.o_iframe').contentDocument; |
180 |
| - const range = iframeDocument.createRange(); |
181 |
| - range.selectNodeContents(this.anchor); |
182 |
| - const sel = iframeDocument.getSelection(); |
183 |
| - sel.removeAllRanges(); |
184 |
| - sel.addRange(range); |
185 |
| - }, |
186 |
| - }, |
187 |
| - { |
188 |
| - content: "Click 'edit link' button if URL input is now shown", |
189 |
| - trigger: "#create-link", |
190 |
| - async run(actions) { |
191 |
| - // Note: the 'create-link' button is always here, however the input |
192 |
| - // for the URL might not be. |
193 |
| - // We have to consider both cases: |
194 |
| - // 1. Single-app website build: a few menu, so no extra menu added |
195 |
| - // and the URL input is shown |
196 |
| - // 2. Multi-app website build: many menu, so extra menu added |
197 |
| - // and the URL input is not shown |
198 |
| - if (!document.querySelector("#o_link_dialog_url_input")) { |
199 |
| - await actions.click(); |
200 |
| - } |
201 |
| - }, |
| 169 | + content: "Click on 'Edit Link'", |
| 170 | + trigger: ".o-we-linkpopover a.o_we_edit_link", |
| 171 | + run: "click", |
202 | 172 | },
|
203 | 173 | {
|
204 | 174 | content: "Change the link",
|
205 |
| - trigger: "#o_link_dialog_url_input", |
| 175 | + trigger: ".o-we-linkpopover input.o_we_href_input_link", |
206 | 176 | run: "edit /new_page"
|
207 | 177 | },
|
208 | 178 | ...clickOnSave(),
|
|
0 commit comments