1
+ import { registry } from "@web/core/registry" ;
1
2
import {
2
- clickOnEditAndWaitEditMode ,
3
3
clickOnSave ,
4
4
registerWebsitePreviewTour ,
5
5
insertSnippet ,
@@ -19,94 +19,103 @@ registerWebsitePreviewTour(
19
19
groupName : "Contact & Forms" ,
20
20
} ) ,
21
21
...clickOnSave ( ) ,
22
+ ] ,
23
+ ) ;
24
+
25
+ registry . category ( 'web_tour.tours' ) . add ( 'donation_snippet_use' , {
26
+ url : '/' ,
27
+ steps : ( ) => [
22
28
// -- Testing the minimum amount --
23
29
{
24
30
content : "Enter a negative custom amount, testing the minimum amount" ,
25
- trigger : ":iframe #s_donation_amount_input" ,
31
+ trigger : "#s_donation_amount_input" ,
26
32
run : "edit 1" ,
27
33
} ,
28
34
{
29
35
content : "Donate with custom amount set" ,
30
- trigger : ":iframe .s_donation_donate_btn" ,
36
+ trigger : ".s_donation_donate_btn" ,
31
37
run : "click" ,
32
38
} ,
33
39
{
34
40
content : "Check if alert-danger element exists" ,
35
- trigger : ":iframe p.alert-danger" ,
41
+ trigger : "p.alert-danger" ,
36
42
} ,
37
43
// -- End of testing the minimum amount --
38
44
{
39
45
content : "Enter a custom amount" ,
40
- trigger : ":iframe #s_donation_amount_input" ,
46
+ trigger : "#s_donation_amount_input" ,
41
47
run : "edit 55" ,
42
48
} ,
43
49
{
44
50
content : "Donate with custom amount set" ,
45
- trigger : ":iframe .s_donation_donate_btn" ,
51
+ trigger : ".s_donation_donate_btn" ,
46
52
run : "click" ,
47
53
} ,
48
54
{
49
55
content : "Check if custom amount radio input is selected" ,
50
- trigger : ":iframe input#other_amount:checked" ,
56
+ trigger : "input#other_amount:checked" ,
51
57
} ,
52
58
{
53
59
content : "Check if custom amount radio input has value 55" ,
54
- trigger : ':iframe input#other_amount[value="55.0"]' ,
60
+ trigger : 'input#other_amount[value="55.0"]' ,
55
61
} ,
56
62
{
57
63
content : "Select the amount of 25" ,
58
- trigger : ":iframe input#amount_1" ,
64
+ trigger : "input#amount_1" ,
59
65
run : "click" ,
60
66
} ,
61
67
{
62
68
content : "Verify that amount_1 is checked" ,
63
- trigger : ":iframe input#amount_1:checked" ,
69
+ trigger : "input#amount_1:checked" ,
64
70
} ,
65
71
{
66
72
content : "Verify that other_amount is not checked" ,
67
- trigger : ":iframe input#other_amount:not(:checked)" ,
73
+ trigger : "input#other_amount:not(:checked)" ,
68
74
} ,
69
75
{
70
76
content : "Click on the custom amount radio button" ,
71
- trigger : ":iframe input#other_amount" ,
77
+ trigger : "input#other_amount" ,
72
78
run : "click" ,
73
79
} ,
74
80
{
75
81
content : "Submit the donation form" ,
76
- trigger : ":iframe button[name='o_payment_submit_button']" ,
82
+ trigger : "button[name='o_payment_submit_button']" ,
77
83
run : "click" ,
78
84
} ,
79
85
{
80
86
content : "Check if the warning message is displayed" ,
81
- trigger : ":iframe .o_donation_payment_form:has(small#warning_message_id)" ,
87
+ trigger : ".o_donation_payment_form:has(small#warning_message_id)" ,
82
88
} ,
83
89
{
84
90
content : "Enter an amount less than the minimum value" ,
85
- trigger : ":iframe input#other_amount_value" ,
91
+ trigger : "input#other_amount_value" ,
86
92
run : "edit 1" ,
87
93
} ,
88
94
{
89
95
content :
90
96
"Verify whether the minimum value warning message is displayed while other warning messages remain hidden" ,
91
97
trigger :
92
- ":iframe small#warning_min_message_id:contains('The minimum donation amount is $5.'), :iframe .o_donation_payment_form:has(small#warning_message_id.d-none)" ,
98
+ "small#warning_min_message_id:contains('The minimum donation amount is $5.'), .o_donation_payment_form:has(small#warning_message_id.d-none)" ,
93
99
} ,
94
100
{
95
101
content : "Click on the first radio button" ,
96
- trigger : ":iframe input[name='o_donation_amount']:first-child" ,
102
+ trigger : "input[name='o_donation_amount']:first-child" ,
97
103
run : "click" ,
98
104
} ,
99
105
{
100
106
content : "Ensure the custom amount value is cleared" ,
101
- trigger :
102
- ":iframe input#other_amount_value:empty, :iframe #warning_min_message_id.d-none" ,
107
+ trigger : "input#other_amount_value:empty, #warning_min_message_id.d-none" ,
103
108
} ,
104
- {
105
- content : "Go to home page" ,
106
- trigger : ":iframe a[href='/'].nav-link" ,
107
- run : "click" ,
108
- } ,
109
- ...clickOnEditAndWaitEditMode ( ) ,
109
+ ] ,
110
+ } ) ;
111
+
112
+ registerWebsitePreviewTour (
113
+ "donation_snippet_edition_2" ,
114
+ {
115
+ url : "/" ,
116
+ edition : true ,
117
+ } ,
118
+ ( ) => [
110
119
{
111
120
content : "Click on 'Custom Amount' button" ,
112
121
trigger : ":iframe .s_donation_donate_btn" ,
@@ -115,45 +124,51 @@ registerWebsitePreviewTour(
115
124
changeOption ( "Donation" , "we-toggler" ) ,
116
125
changeOption ( "Donation" , '[data-name="slider_opt"]' ) ,
117
126
...clickOnSave ( ) ,
127
+ ] ,
128
+ ) ;
129
+
130
+ registry . category ( 'web_tour.tours' ) . add ( 'donation_snippet_use_2' , {
131
+ url : '/' ,
132
+ steps : ( ) => [
118
133
{
119
134
content : "Click on $10 button" ,
120
- trigger : ":iframe .s_donation_btn_description button" ,
135
+ trigger : ".s_donation_btn_description button" ,
121
136
run : "click" ,
122
137
} ,
123
138
{
124
139
content : "Donate using the selected amount" ,
125
- trigger : ":iframe .s_donation_donate_btn" ,
140
+ trigger : ".s_donation_donate_btn" ,
126
141
run : "click" ,
127
142
} ,
128
143
{
129
144
content : "Click on the 'Amount to donate' input field" ,
130
- trigger : ":iframe input#other_amount_value" ,
145
+ trigger : "input#other_amount_value" ,
131
146
run : "click" ,
132
147
} ,
133
148
{
134
149
content : "Change custom amount to 67" ,
135
- trigger : ":iframe input[name='o_donation_amount'][type='number']" ,
150
+ trigger : "input[name='o_donation_amount'][type='number']" ,
136
151
run : "edit 67" ,
137
152
} ,
138
153
{
139
154
content : "Select the custom amount radio button" ,
140
- trigger : ":iframe input#other_amount" ,
155
+ trigger : "input#other_amount" ,
141
156
run : "click" ,
142
157
} ,
143
158
{
144
159
content : "Submit the donation form" ,
145
- trigger : ":iframe button[name='o_payment_submit_button']" ,
160
+ trigger : "button[name='o_payment_submit_button']" ,
146
161
run : "click" ,
147
162
} ,
148
163
{
149
- trigger : ":iframe body:contains(Your payment has been processed.)" ,
164
+ trigger : "body:contains(Your payment has been processed.)" ,
150
165
} ,
151
166
{
152
167
content : "Verify that the amount displayed is 67" ,
153
- trigger : ':iframe span.oe_currency_value:contains("67.00")' ,
168
+ trigger : 'span.oe_currency_value:contains("67.00")' ,
154
169
} ,
155
170
{
156
- trigger : ":iframe [name=o_payment_status_alert]:contains(thank you!)" ,
171
+ trigger : "[name=o_payment_status_alert]:contains(thank you!)" ,
157
172
} ,
158
- ]
159
- ) ;
173
+ ] ,
174
+ } ) ;
0 commit comments