File: editable_root_as_custom_snippet.js

package info (click to toggle)
odoo 18.0.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 878,716 kB
  • sloc: javascript: 927,937; python: 685,670; xml: 388,524; sh: 1,033; sql: 415; makefile: 26
file content (43 lines) | stat: -rw-r--r-- 1,316 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/** @odoo-module **/

import {
    changeOption,
    clickOnEditAndWaitEditMode,
    clickOnSave,
    clickOnSnippet,
    insertSnippet,
    registerWebsitePreviewTour,
} from '@website/js/tours/tour_utils';

registerWebsitePreviewTour("editable_root_as_custom_snippet", {
    edition: true,
    url: '/custom-page',
}, () => [
    ...clickOnSnippet('.s_title.custom[data-oe-model][data-oe-id][data-oe-field][data-oe-xpath]'),
    changeOption('SnippetSave', 'we-button'),
    {
        content: "Confirm modal",
        trigger: '.modal-footer .btn-primary',
        run: "click",
    },
    {
        content: "Wait for the custom category to appear in the panel",
        trigger: '.oe_snippet[name="Custom"]',
    },
    ...clickOnSave(),
    {
        content: "Go to homepage",
        trigger: ':iframe a[href="/"].nav-link',
        run: "click",
    },
    {
        content: "Wait to land on homepage",
        trigger: ':iframe a[href="/"].nav-link.active',
    },
    ...clickOnEditAndWaitEditMode(),
    ...insertSnippet({id: "s_title", name: "Custom Title", groupName: "Custom"}),
    {
        content: "Check that the custom snippet does not have branding",
        trigger: ':iframe #wrap .s_title.custom:not([data-oe-model]):not([data-oe-id]):not([data-oe-field]):not([data-oe-xpath])',
    },
]);