| 1 |
import { |
| 2 |
clickOnEditAndWaitEditMode, |
| 3 |
clickOnSave, |
| 4 |
registerWebsitePreviewTour, |
| 5 |
changeOptionInPopover, |
| 6 |
} from "@website/js/tours/tour_utils"; |
| 7 |
|
| 8 |
registerWebsitePreviewTour( |
| 9 |
"test_form_conditional_visibility_record_field", |
| 10 |
{ |
| 11 |
url: "/test_website/model_item/1", |
| 12 |
edition: true, |
| 13 |
}, |
| 14 |
() => [ |
| 15 |
{ |
| 16 |
content: "Select name field", |
| 17 |
trigger: ":iframe .s_website_form .s_website_form_input[name=name]", |
| 18 |
run: "click", |
| 19 |
}, |
| 20 |
...changeOptionInPopover("Field", "Visibility", "Visible only if"), |
| 21 |
{ |
| 22 |
content: "Open model selector", |
| 23 |
trigger: "button[id='hidden_condition_record_opt']:contains('Test Tag')", |
| 24 |
run: "click", |
| 25 |
}, |
| 26 |
{ |
| 27 |
content: "Set model to tag #2", |
| 28 |
trigger: ".o_popover div.o-dropdown-item:contains('Test Tag #2')", |
| 29 |
run: "click", |
| 30 |
}, |
| 31 |
...clickOnSave(), |
| 32 |
{ |
| 33 |
content: "Name field is hidden", |
| 34 |
trigger: ":iframe .s_website_form:has(.s_website_form_field_hidden_if.d-none)", |
| 35 |
}, |
| 36 |
...clickOnEditAndWaitEditMode(), |
| 37 |
|
| 38 |
{ |
| 39 |
content: "Select name field", |
| 40 |
trigger: ":iframe .s_website_form .s_website_form_input[name=name]", |
| 41 |
run: "click", |
| 42 |
}, |
| 43 |
{ |
| 44 |
content: "Open comparator dropdown", |
| 45 |
trigger: "button[id='hidden_condition_record_opt']:contains('Is equal to')", |
| 46 |
run: "click", |
| 47 |
}, |
| 48 |
{ |
| 49 |
content: "Set comparator to Is not equal", |
| 50 |
trigger: ".o_popover div.o-dropdown-item:contains('Is not equal to')", |
| 51 |
run: "click", |
| 52 |
}, |
| 53 |
...clickOnSave(), |
| 54 |
{ |
| 55 |
content: "Name field is shown", |
| 56 |
trigger: ":iframe .s_website_form:has(.s_website_form_field_hidden_if:not(.d-none))", |
| 57 |
}, |
| 58 |
], |
| 59 |
); |