@@ -51,86 +51,73 @@ const selectFieldByLabel = (label) => {
51
51
run : "click" ,
52
52
} ] ;
53
53
} ;
54
- const selectButtonByText = function ( text ) {
55
- return [
56
- {
57
- content : "Open the select" ,
58
- trigger :
59
- "div[data-container-title='Field'] div[data-label='Visibility'] button.btn-primary" ,
60
- run : "click" ,
61
- } ,
62
- {
63
- content : "Click on the option" ,
64
- trigger : `.o_popover div[role="menuitem"]:contains("${ text } ")` ,
65
- run : "click" ,
66
- } ,
67
- ] ;
54
+ const selectButtonByText = function ( text , dropdownContent ) {
55
+ return [ {
56
+ content : "Open the select" ,
57
+ trigger : `.o_customize_tab button:contains("${ text } ")` ,
58
+ run : "click" ,
59
+ } ,
60
+ {
61
+ content : "Click on the option" ,
62
+ trigger : `.o_popover div.dropdown-item:contains("${ dropdownContent } ")` ,
63
+ run : "click" ,
64
+ } ] ;
68
65
} ;
69
- const selectButtonByData = function ( data ) {
70
- return [
71
- {
72
- content : "Open the select" ,
73
- trigger : "div[data-label='Type'] button.btn-primary" ,
74
- run : "click" ,
75
- } ,
76
- {
77
- content : "Click on the option" ,
78
- trigger : `.o_popover [${ data } ]` ,
79
- run : "click" ,
80
- } ,
81
- ] ;
66
+ const selectButtonByData = function ( text , data , name ) {
67
+ return [ {
68
+ content : "Open the select" ,
69
+ trigger : `.o_customize_tab button:contains('${ text } ')` ,
70
+ run : "click" ,
71
+ } , {
72
+ content : "Click on the option" ,
73
+ trigger : `.o_popover div[${ data } ][data-action-value="${ name } "]` ,
74
+ run : "click" ,
75
+ } ] ;
82
76
} ;
83
- const addField = function (
84
- name ,
85
- type ,
86
- label ,
87
- required ,
88
- isCustom ,
89
- display = { visibility : VISIBLE , condition : "" }
90
- ) {
91
- const data = isCustom ? `data-action-value="${ name } "` : `data-existing-field="${ name } "` ;
77
+ const addField = function ( name , type , label , required , isCustom ,
78
+ display = { visibility : VISIBLE , condition : "" } ) {
79
+ const data = isCustom ? "data-action-id='customField'" : "data-action-id='existingField'" ;
92
80
const ret = [
93
- {
94
- trigger : ":iframe .s_website_form_field" ,
95
- } ,
96
- {
97
- content : "Select form" ,
98
- trigger : ":iframe section.s_website_form" ,
99
- run : "click" ,
100
- } ,
101
- {
102
- content : "Add field" ,
103
- trigger : "[data-container-title=Form] button:contains('+ Field')" ,
104
- run : "click" ,
105
- } ,
106
- ...selectButtonByData ( data ) ,
107
- {
108
- content : "Wait for field to load" ,
109
- trigger : `:iframe .s_website_form_field[data-type="${ name } "],:iframe .s_website_form_input[name="${ name } "]` , //custom or existing field
110
- } ,
111
- ...selectButtonByText ( display . visibility ) ,
112
- ] ;
113
- let testText = ":iframe .s_website_form_field" ;
81
+ {
82
+ trigger : ":iframe .s_website_form_field" ,
83
+ } ,
84
+ {
85
+ content : "Select form" ,
86
+ trigger : ':iframe section.s_website_form' ,
87
+ run : "click" ,
88
+ } , {
89
+ content : "Add field" ,
90
+ trigger : ".o_customize_tab button[title='Add a new field at the end']" ,
91
+ run : "click" ,
92
+ } ,
93
+ ...selectButtonByData ( "Text" , data , name ) ,
94
+ {
95
+ content : "Wait for field to load" ,
96
+ trigger : `:iframe .s_website_form_field[data-type="${ name } "],:iframe .s_website_form_input[name="${ name } "]` , //custom or existing field
97
+ } ,
98
+ ...selectButtonByText ( "Always Visible" , display . visibility ) ,
99
+ ] ;
100
+ let testText = ':iframe .s_website_form_field' ;
114
101
if ( display . condition ) {
115
102
ret . push ( {
116
103
content : "Set the visibility condition" ,
117
- trigger : 'we-input [data-attribute-name=" visibilityCondition" ] input' ,
104
+ trigger : ".o_customize_tab div [data-attribute-action=' visibilityCondition' ] input" ,
118
105
run : `edit ${ display . condition } && press Tab` ,
119
106
} ) ;
120
107
}
121
108
if ( required ) {
122
109
testText += ".s_website_form_required" ;
123
110
ret . push ( {
124
111
content : "Mark the field as required" ,
125
- trigger : "div[data-action-id='toggleRequired'] .form-switch input" ,
112
+ trigger : ".o_customize_tab div[data-action-id='toggleRequired'] input[type='checkbox'] " ,
126
113
run : "click" ,
127
114
} ) ;
128
115
}
129
116
if ( label ) {
130
117
testText += `:has(label:contains(${ label } ))` ;
131
118
ret . push ( {
132
119
content : "Change the label text" ,
133
- trigger : "div[data-action-id='setLabelText'] input" ,
120
+ trigger : ".o_customize_tab div[data-action-id='setLabelText'] input" ,
134
121
run : `edit ${ label } && press Tab` ,
135
122
} ) ;
136
123
}
@@ -159,38 +146,34 @@ registerWebsitePreviewTour("website_form_editor_tour", {
159
146
edition : true ,
160
147
} , ( ) => [
161
148
// Drop a form builder snippet and configure it
162
- {
163
- content : "Drop the form snippet" ,
164
- trigger : '#oe_snippets .oe_snippet .oe_snippet_thumbnail[data-snippet=s_website_form]' ,
165
- run : "drag_and_drop :iframe #wrap" ,
166
- } ,
149
+ ...insertSnippet ( { id : "s_title_form" , name : "Contact & Forms" , groupName : "Contact & Forms" } ) ,
167
150
{
168
151
trigger : ":iframe .s_website_form_field" ,
169
152
} ,
170
153
{
171
154
content : "Select form by clicking on an input field" ,
172
- trigger : ' :iframe section.s_website_form input' ,
155
+ trigger : " :iframe .s_website_form_field .s_website_form_input" ,
173
156
run : "click" ,
174
157
} , {
175
158
content : "Verify that the form editor appeared" ,
176
- trigger : '.o_we_customize_panel .snippet-option-WebsiteFormEditor' ,
159
+ trigger : ".o_customize_tab div[data-container-title='Form']" ,
177
160
} ,
178
161
goBackToBlocks ( ) ,
179
162
{
180
163
trigger : ":iframe .s_website_form_field" ,
181
164
} ,
182
165
{
183
166
content : "Select form by clicking on a text area" ,
184
- trigger : ' :iframe section.s_website_form textarea' ,
167
+ trigger : " :iframe .s_website_form_field textarea.s_website_form_input" ,
185
168
run : "click" ,
186
169
} ,
187
170
{
188
171
content : "Verify that the form editor appeared" ,
189
- trigger : '.o_we_customize_panel .snippet-option-WebsiteFormEditor' ,
172
+ trigger : ".o_customize_tab div[data-container-title='Form']" ,
190
173
} ,
191
174
{
192
175
content : "Rename and leave the field label" ,
193
- trigger : 'we-input [data-set-label-text ] input' ,
176
+ trigger : '.o_customize_tab div [data-action-id="setLabelText" ] input' ,
194
177
run : "edit Renamed && click body" ,
195
178
} ,
196
179
goBackToBlocks ( ) ,
@@ -202,7 +185,7 @@ registerWebsitePreviewTour("website_form_editor_tour", {
202
185
trigger : ':iframe section.s_website_form' ,
203
186
run : "click" ,
204
187
} ,
205
- ...selectButtonByText ( 'Send an E-mail' ) ,
188
+ ...selectButtonByText ( 'Send an E-mail' , 'Send an E-mail' ) ,
206
189
{
207
190
content : "Form has a model name" ,
208
191
trigger : ':iframe section.s_website_form form[data-model_name="mail.mail"]' ,
@@ -213,46 +196,64 @@ registerWebsitePreviewTour("website_form_editor_tour", {
213
196
run : "click" ,
214
197
} , {
215
198
content : 'Change the label position of the phone field' ,
216
- trigger : 'we- button[data-select-label-position=" right"]' ,
199
+ trigger : ".o_customize_tab div[data-label='Position'] button[data-action-value=' right']" ,
217
200
run : "click" ,
218
201
} ,
219
202
...addCustomField ( "char" , "text" , "Conditional Visibility Check 1" , false ) ,
220
203
...addCustomField ( "char" , "text" , "Conditional Visibility Check 2" , false ) ,
221
- ...selectButtonByData ( "data-set-visibility='conditional'" ) ,
222
- ...selectButtonByData ( "data-set-visibility-dependency='Conditional Visibility Check 1'" ) ,
204
+ ...selectButtonByData ( "Always Visible" , "data-action-id='setVisibility'" , "conditional" ) ,
205
+ ...selectButtonByData (
206
+ "Your Name" ,
207
+ "data-action-id='setVisibilityDependency'" ,
208
+ "Conditional Visibility Check 1"
209
+ ) ,
223
210
...addCustomField ( "char" , "text" , "Conditional Visibility Check 2" , false ) ,
224
211
...selectFieldByLabel ( "Conditional Visibility Check 1" ) ,
225
- ...selectButtonByData ( "data-set-visibility='conditional'" ) ,
212
+ ...selectButtonByData ( "Always Visible" , "data-action-id='setVisibility'" , "conditional" ) ,
213
+ {
214
+ content : "Open list of the visibility selector of Conditional Visibility Check 1" ,
215
+ trigger : ".o_customize_tab button:contains('Your Name')" ,
216
+ run : "click" ,
217
+ } ,
226
218
{
227
219
content : "Check that 'Conditional Visibility Check 2' is not in the list of the visibility selector of Conditional Visibility Check 1" ,
228
- trigger : "we-select[data-name='hidden_condition_opt'] :not(:has(we-button [data-set-visibility-dependency ='Conditional Visibility Check 2']))" ,
220
+ trigger : ".o_popover div :not(:has([data-action-value ='Conditional Visibility Check 2']))" ,
229
221
} ,
230
222
...addCustomField ( "char" , "text" , "Conditional Visibility Check 3" , false ) ,
231
223
...addCustomField ( "char" , "text" , "Conditional Visibility Check 4" , false ) ,
232
- ...selectButtonByData ( "data-set-visibility='conditional'" ) ,
233
- ...selectButtonByData ( "data-set-visibility-dependency='Conditional Visibility Check 3'" ) ,
224
+ ...selectButtonByData ( "Always Visible" , "data-action-id='setVisibility'" , "conditional" ) ,
225
+ ...selectButtonByData (
226
+ "Your Name" ,
227
+ "data-action-id='setVisibilityDependency'" ,
228
+ "Conditional Visibility Check 3"
229
+ ) ,
234
230
{
235
231
content : "Change the label of 'Conditional Visibility Check 4' and change it to 'Conditional Visibility Check 3'" ,
236
- trigger : 'we-input [data-set-label-text ] input' ,
232
+ trigger : ".o_customize_tab div [data-action-id='setLabelText' ] input" ,
237
233
// TODO: remove && click body
238
234
run : "edit Conditional Visibility Check 3 && click body" ,
239
235
} ,
240
236
{
241
237
content : "Check that the conditional visibility of the renamed field is removed" ,
242
- trigger : "we-customizeblock-option.snippet-option-WebsiteFieldEditor we-select:contains('Visibility'):has(we-toggler: contains('Always Visible') )" ,
238
+ trigger : ".o_customize_tab div[data-container-title='Field'] button: contains('None' )" ,
243
239
} ,
244
240
...addCustomField ( "char" , "text" , "Conditional Visibility Check 5" , false ) ,
245
241
...addCustomField ( "char" , "text" , "Conditional Visibility Check 6" , false ) ,
246
- ...selectButtonByData ( "data-set-visibility='conditional' " ) ,
242
+ ...selectButtonByData ( "Always Visible" , " data-action-id='setVisibility'" , "conditional ") ,
247
243
{
248
244
content : "Change the label of 'Conditional Visibility Check 6' and change it to 'Conditional Visibility Check 5'" ,
249
- trigger : 'we-input [data-set-label-text ] input' ,
245
+ trigger : ".o_customize_tab div [data-action-id='setLabelText' ] input" ,
250
246
// TODO: remove && click body
251
247
run : "edit Conditional Visibility Check 5 && click body" ,
252
248
} ,
249
+ {
250
+ content : "Open list of the visibility selector of Conditional Visibility Check 1" ,
251
+ trigger : ".o_customize_tab button:contains('Your Name')" ,
252
+ run : "click" ,
253
+ } ,
253
254
{
254
255
content : "Check that 'Conditional Visibility Check 5' is not in the list of the renamed field" ,
255
- trigger : "we-customizeblock-option.snippet-option-WebsiteFieldEditor we-select[data-name='hidden_condition_opt'] :not(:has(we-button:contains( 'Conditional Visibility Check 5') ))" ,
256
+ trigger : ".o_popover div :not(:has([data-action-value= 'Conditional Visibility Check 5'] ))" ,
256
257
} ,
257
258
...addExistingField ( 'email_cc' , 'text' , 'Test conditional visibility' , false , { visibility : CONDITIONALVISIBILITY , condition : 'odoo' } ) ,
258
259
{
@@ -263,18 +264,22 @@ registerWebsitePreviewTour("website_form_editor_tour", {
263
264
...addCustomField ( "char" , "text" , "dependent" , false , { visibility : CONDITIONALVISIBILITY } ) ,
264
265
...addCustomField ( "selection" , "radio" , "dependency" , false ) ,
265
266
...selectFieldByLabel ( "dependent" ) ,
266
- ...selectButtonByData ( 'data-set-visibility-dependency="dependency"' ) ,
267
+ ...selectButtonByData (
268
+ "Your Name" ,
269
+ "data-action-id='setVisibilityDependency'" ,
270
+ "dependency"
271
+ ) ,
267
272
...selectFieldByLabel ( "dependency" ) ,
268
- ...selectButtonByData ( ' data-custom-field=" char"' ) ,
273
+ ...selectButtonByData ( "Radio Buttons" , " data-action-id='customField'" , " char") ,
269
274
...selectFieldByLabel ( "dependent" ) ,
270
275
{
271
276
content : "Open the select" ,
272
- trigger : 'we-select:has(we-button[data-set-visibility="visible"]) we-toggler' ,
277
+ trigger : ".o_customize_tab button:contains('Always Visible')" ,
273
278
run : "click" ,
274
279
} ,
275
280
{
276
281
content : "Check that the field no longer has conditional visibility" ,
277
- trigger : "we-select we-button [data-set-visibility ='visible'].active" ,
282
+ trigger : ".o_popover div [data-action-value ='visible'].active" ,
278
283
} ,
279
284
280
285
...addExistingField ( 'date' , 'text' , 'Test Date' , true ) ,
@@ -288,25 +293,25 @@ registerWebsitePreviewTour("website_form_editor_tour", {
288
293
...addCustomField ( 'one2many' , 'checkbox' , 'Products' , true ) ,
289
294
{
290
295
content : "Change Option 1 label" ,
291
- trigger : 'we-list table input:eq(0)' ,
296
+ trigger : ".o_we_table_wrapper table input[name='display_name'] :eq(0)" ,
292
297
run : "edit Iphone && press Tab" ,
293
298
} , {
294
299
content : "Change Option 2 label" ,
295
- trigger : 'we-list table input:eq(1)' ,
300
+ trigger : ".o_we_table_wrapper table input[name='display_name'] :eq(1)" ,
296
301
run : "edit Galaxy S && press Tab" ,
297
302
} , {
298
303
content : "Change first Option 3 label" ,
299
- trigger : 'we-list table input:eq(2)' ,
304
+ trigger : ".o_we_table_wrapper table input[name='display_name'] :eq(2)" ,
300
305
run : "edit Xperia && press Tab" ,
301
306
} ,
302
307
{
303
308
content : "Click on Add new Checkbox" ,
304
- trigger : 'we-list we- button.o_we_list_add_optional' ,
309
+ trigger : " button.builder_list_add_item" ,
305
310
run : "click" ,
306
311
} ,
307
312
{
308
313
content : "Change added Option label" ,
309
- trigger : 'we-list table input:eq(3)' ,
314
+ trigger : ".o_we_table_wrapper table input[name='display_name'] :eq(3)" ,
310
315
run : "edit Wiko Stairway && press Tab" ,
311
316
} , {
312
317
content : "Check the resulting field" ,
@@ -317,7 +322,7 @@ registerWebsitePreviewTour("website_form_editor_tour", {
317
322
":has(.checkbox:has(label:contains('Xperia')):has(input[type='checkbox'][required]))" +
318
323
":has(.checkbox:has(label:contains('Wiko Stairway')):has(input[type='checkbox'][required]))" ,
319
324
} ,
320
- ...selectButtonByData ( ' data-multi-checkbox-display=" vertical"' ) ,
325
+ ...selectButtonByData ( "Horizontal" , " data-action-id='multiCheckboxDisplay'" , " vertical") ,
321
326
{
322
327
content : "Check the resulting field" ,
323
328
trigger : ":iframe .s_website_form_field.s_website_form_custom.s_website_form_required" +
@@ -328,10 +333,10 @@ registerWebsitePreviewTour("website_form_editor_tour", {
328
333
":has(.checkbox:has(label:contains('Wiko Stairway')):has(input[type='checkbox'][required]))" ,
329
334
} ,
330
335
// Check conditional visibility for the relational fields
331
- ...selectButtonByData ( "data-set-visibility='conditional' " ) ,
332
- ...selectButtonByData ( "data-set-visibility-dependency='recipient_ids' " ) ,
333
- ...selectButtonByText ( "Is not equal to" ) ,
334
- ...selectButtonByText ( "Mitchell Admin" ) ,
336
+ ...selectButtonByData ( "Always Visible" , " data-action-id='setVisibility'" , "conditional ") ,
337
+ ...selectButtonByData ( "Your Name" , " data-action-id='setVisibilityDependency'" , "recipient_ids ") ,
338
+ ...selectButtonByText ( "Is equal to" , "Is not equal to") ,
339
+ ...selectButtonByText ( "Joel Willis" , " Mitchell Admin") ,
335
340
...clickOnSave ( ) ,
336
341
{
337
342
content : "Check 'products' field is visible." ,
0 commit comments