@@ -3,78 +3,86 @@ import {
33 clickOnSnippet ,
44 insertSnippet ,
55 registerWebsitePreviewTour ,
6+ changeOptionInPopover ,
67} from "@website/js/tours/tour_utils" ;
78
89function removeSelectedBlock ( ) {
910 return {
1011 content : "Remove selected block" ,
11- trigger : '#oe_snippets we-customizeblock-options:nth-last-child(3) . oe_snippet_remove' ,
12+ trigger : ".o-overlay-container .o_overlay_options . oe_snippet_remove" ,
1213 run : "click" ,
1314 } ;
1415}
1516
16- registerWebsitePreviewTour ( 'snippet_empty_parent_autoremove' , {
17- url : '/' ,
18- edition : true ,
19- } , ( ) => [
20- // Base case: remove both columns from text - image
21- ...insertSnippet ( {
22- id : 's_text_image' ,
23- name : 'Text - Image' ,
24- groupName : "Content" ,
25- } ) ,
17+ registerWebsitePreviewTour (
18+ "snippet_empty_parent_autoremove" ,
2619 {
27- content : "Click on second column" ,
28- trigger : ':iframe #wrap .s_text_image .row > :nth-child(2)' ,
29- run : "click" ,
30- } ,
31- removeSelectedBlock ( ) ,
32- {
33- content : "Click on first column" ,
34- trigger : ':iframe #wrap .s_text_image .row > :first-child' ,
35- run : "click" ,
36- } ,
37- removeSelectedBlock ( ) ,
38- {
39- content : "Check that #wrap is empty" ,
40- trigger : ':iframe #wrap:empty' ,
41- } ,
42-
43- // Cover: test that parallax, bg-filter and shape are not treated as content
44- ...insertSnippet ( {
45- id : 's_cover' ,
46- name : 'Cover' ,
47- groupName : "Intro" ,
48- } ) ,
49- ...clickOnSnippet ( {
50- id : 's_cover' ,
51- name : 'Cover' ,
52- } ) ,
53- // Add a shape
54- changeOption ( 'ColoredLevelBackground' , 'Shape' ) ,
55- {
56- content : "Check that the parallax element is present" ,
57- trigger : ':iframe #wrap .s_cover .s_parallax_bg' ,
58- } ,
59- {
60- content : "Check that the filter element is present" ,
61- trigger : ':iframe #wrap .s_cover .o_we_bg_filter' ,
62- } ,
63- {
64- content : "Check that the shape element is present" ,
65- trigger : ':iframe #wrap .s_cover .o_we_shape' ,
66- } ,
67- // Add a column
68- changeOption ( 'layout_column' , 'we-toggler' ) ,
69- changeOption ( 'layout_column' , '[data-select-count="1"]' ) ,
70- {
71- content : "Click on the created column" ,
72- trigger : ':iframe #wrap .s_cover .row > :first-child' ,
73- run : "click" ,
74- } ,
75- removeSelectedBlock ( ) ,
76- {
77- content : "Check that #wrap is empty" ,
78- trigger : ':iframe #wrap:empty' ,
20+ url : "/" ,
21+ edition : true ,
7922 } ,
80- ] ) ;
23+ ( ) => [
24+ // Base case: remove both columns from text - image
25+ ...insertSnippet ( {
26+ id : "s_text_image" ,
27+ name : "Text - Image" ,
28+ groupName : "Content" ,
29+ } ) ,
30+ {
31+ content : "Click on second column" ,
32+ trigger : ":iframe #wrap .s_text_image .row > :nth-child(2)" ,
33+ run : "click" ,
34+ } ,
35+ removeSelectedBlock ( ) ,
36+ {
37+ content : "Click on first column" ,
38+ trigger : ":iframe #wrap .s_text_image .row > :first-child" ,
39+ run : "click" ,
40+ } ,
41+ removeSelectedBlock ( ) ,
42+ {
43+ content : "Check that #wrap is empty" ,
44+ trigger : ":iframe #wrap:empty" ,
45+ } ,
46+ // Cover: test that parallax, bg-filter and shape are not treated as content
47+ ...insertSnippet ( {
48+ id : "s_cover" ,
49+ name : "Cover" ,
50+ groupName : "Intro" ,
51+ } ) ,
52+ ...clickOnSnippet ( {
53+ id : "s_cover" ,
54+ name : "Cover" ,
55+ } ) ,
56+ // Add a shape
57+ changeOption ( "Cover" , "toggleBgShape" ) ,
58+ {
59+ content : "Click on the back button" ,
60+ trigger : ".o_pager_nav_angle" ,
61+ run : "click" ,
62+ } ,
63+ {
64+ content : "Check that the parallax element is present" ,
65+ trigger : ":iframe #wrap .s_cover .s_parallax_bg" ,
66+ } ,
67+ {
68+ content : "Check that the filter element is present" ,
69+ trigger : ":iframe #wrap .s_cover .o_we_bg_filter" ,
70+ } ,
71+ {
72+ content : "Check that the shape element is present" ,
73+ trigger : ":iframe #wrap .s_cover .o_we_shape" ,
74+ } ,
75+ // Add a column
76+ ...changeOptionInPopover ( "Cover" , "Layout" , "[data-action-value='1']" ) ,
77+ {
78+ content : "Click on the created column" ,
79+ trigger : ":iframe #wrap .s_cover .row > :first-child" ,
80+ run : "click" ,
81+ } ,
82+ removeSelectedBlock ( ) ,
83+ {
84+ content : "Check that #wrap is empty" ,
85+ trigger : ":iframe #wrap:empty" ,
86+ } ,
87+ ]
88+ ) ;
0 commit comments