Debian Codegraph @

addons/website_sale/static/tests/tours/website_sale_restricted_editor_ui.js

raw symbols SCIP
1 import { stepUtils } from "@web_tour/tour_utils";
2 import { registerWebsitePreviewTour } from '@website/js/tours/tour_utils';
3
4 registerWebsitePreviewTour('website_sale_restricted_editor_ui', {
5 url: `/shop`,
6 }, () => [
7 {
8 content: "Open the site menu to check what is inside",
9 trigger: '[data-menu-xmlid="website.menu_site"]',
10 run: "click",
11 },
12 {
13 // Not very robust but still nice to have an extra check as this is the
14 // main purpose of this tour
15 content: "First check the user is not a designer",
16 trigger: '.dropdown-menu:has([data-menu-xmlid="website_sale.menu_product_pages"]):not(:has([data-menu-xmlid="website.menu_website_pages_list"]))',
17 run: "click",
18 },
19 {
20 // Wait for the possibility to edit to appear
21 trigger: ".o_menu_systray button:contains('Edit')",
22 },
23 {
24 content: "Ensure the publish and 'edit-in-backend' buttons are not shown",
25 trigger: '.o_menu_systray:not(:has(.form-switch)):not(:has(.o_website_edit_in_backend))',
26 run: "click",
27 },
28 stepUtils.waitIframeIsReady(),
29 {
30 content: "Navigate to the first product",
31 trigger: ':iframe .oe_product_image_link',
32 run: "click",
33 },
34 {
35 content: "Click on publish/unpublish",
36 trigger: '.o_website_publish_container a:has(input:checked)',
37 run: "click",
38 },
39 {
40 trigger:
41 ".o_menu_systray_item:not([data-processing]) .form-switch:has(input:not(:checked))",
42 },
43 {
44 content: "Click on edit-in-backend",
45 trigger: '.o_menu_systray .o_website_edit_in_backend a',
46 run: "click",
47 },
48 {
49 content: "Check that you landed on a form view and that the record was unpublished",
50 trigger: '.o-form-buttonbox [name="is_published"] .fa-globe.text-danger',
51 },
52 ]);