@@ -8,16 +8,19 @@ import {
8
8
TEST_DATE_VALUE ,
9
9
THREEDS2_CHALLENGE_PASSWORD
10
10
} from '../../../utils/constants' ;
11
+ import { URL_MAP } from '../../../../fixtures/URL_MAP' ;
11
12
12
13
test . describe ( 'Bcmc payments with dual branding' , ( ) => {
13
14
test . describe ( 'Bancontact (BCMC) / Maestro brands' , ( ) => {
14
15
test . describe ( 'Selecting the Bancontact brand' , ( ) => {
15
16
test ( 'should submit the bcmc payment' , async ( { bcmc } ) => {
17
+ await bcmc . goto ( URL_MAP . bcmc ) ;
18
+
16
19
await bcmc . isComponentVisible ( ) ;
17
20
18
21
await bcmc . fillCardNumber ( BCMC_CARD ) ;
19
22
await bcmc . fillExpiryDate ( TEST_DATE_VALUE ) ;
20
- await bcmc . waitForVisibleDualBrands ( ) ;
23
+ await bcmc . waitForVisibleBrands ( ) ;
21
24
22
25
const [ firstBrand , secondBrand ] = await bcmc . brands ;
23
26
expect ( firstBrand ) . toHaveAttribute ( 'data-value' , 'bcmc' ) ;
@@ -31,16 +34,18 @@ test.describe('Bcmc payments with dual branding', () => {
31
34
} ) ;
32
35
33
36
test ( 'should not submit the bcmc payment with incomplete form data' , async ( { bcmc } ) => {
37
+ await bcmc . goto ( URL_MAP . bcmc ) ;
34
38
await bcmc . isComponentVisible ( ) ;
35
39
await bcmc . fillCardNumber ( BCMC_CARD ) ;
36
- await bcmc . waitForVisibleDualBrands ( ) ;
40
+ await bcmc . waitForVisibleBrands ( ) ;
37
41
await bcmc . selectBrand ( 'Bancontact card' ) ;
38
42
await bcmc . pay ( ) ;
39
43
40
44
await expect ( bcmc . expiryDateErrorElement ) . toHaveText ( 'Enter the expiry date' ) ;
41
45
} ) ;
42
46
43
47
test ( 'should not submit the bcmc payment with invalid bcmc card number' , async ( { bcmc } ) => {
48
+ await bcmc . goto ( URL_MAP . bcmc ) ;
44
49
await bcmc . isComponentVisible ( ) ;
45
50
await bcmc . fillCardNumber ( `${ BCMC_CARD } 111` ) ;
46
51
await bcmc . pay ( ) ;
@@ -51,11 +56,12 @@ test.describe('Bcmc payments with dual branding', () => {
51
56
52
57
test . describe ( 'Selecting the maestro brand' , ( ) => {
53
58
test ( 'should submit the maestro payment' , async ( { bcmc } ) => {
59
+ await bcmc . goto ( URL_MAP . bcmc ) ;
54
60
await bcmc . isComponentVisible ( ) ;
55
61
56
62
await bcmc . fillCardNumber ( BCMC_CARD ) ;
57
63
await bcmc . fillExpiryDate ( TEST_DATE_VALUE ) ;
58
- await bcmc . waitForVisibleDualBrands ( ) ;
64
+ await bcmc . waitForVisibleBrands ( ) ;
59
65
60
66
const [ firstBrand , secondBrand ] = await bcmc . brands ;
61
67
expect ( firstBrand ) . toHaveAttribute ( 'data-value' , 'bcmc' ) ;
@@ -68,16 +74,18 @@ test.describe('Bcmc payments with dual branding', () => {
68
74
} ) ;
69
75
70
76
test ( 'should not submit the maestro payment with incomplete form data' , async ( { bcmc } ) => {
77
+ await bcmc . goto ( URL_MAP . bcmc ) ;
71
78
await bcmc . isComponentVisible ( ) ;
72
79
await bcmc . fillCardNumber ( BCMC_CARD ) ;
73
- await bcmc . waitForVisibleDualBrands ( ) ;
80
+ await bcmc . waitForVisibleBrands ( ) ;
74
81
await bcmc . selectBrand ( 'Maestro' ) ;
75
82
await bcmc . pay ( ) ;
76
83
77
84
await expect ( bcmc . expiryDateErrorElement ) . toHaveText ( 'Enter the expiry date' ) ;
78
85
} ) ;
79
86
80
87
test ( 'should not submit the maestro payment with invalid maestro card number' , async ( { bcmc } ) => {
88
+ await bcmc . goto ( URL_MAP . bcmc ) ;
81
89
await bcmc . isComponentVisible ( ) ;
82
90
await bcmc . fillCardNumber ( `${ BCMC_CARD } 111` ) ;
83
91
await bcmc . pay ( ) ;
@@ -90,11 +98,12 @@ test.describe('Bcmc payments with dual branding', () => {
90
98
test . describe ( 'Bancontact (BCMC) / Visa Debit brands' , ( ) => {
91
99
test . describe ( 'Selecting the Bancontact brand' , ( ) => {
92
100
test ( 'should submit the bcmc payment' , async ( { bcmc } ) => {
101
+ await bcmc . goto ( URL_MAP . bcmc ) ;
93
102
await bcmc . isComponentVisible ( ) ;
94
103
95
104
await bcmc . fillCardNumber ( BCMC_DUAL_BRANDED_VISA ) ;
96
105
await bcmc . fillExpiryDate ( TEST_DATE_VALUE ) ;
97
- await bcmc . waitForVisibleDualBrands ( ) ;
106
+ await bcmc . waitForVisibleBrands ( ) ;
98
107
99
108
const [ firstBrand , secondBrand ] = await bcmc . brands ;
100
109
expect ( firstBrand ) . toHaveAttribute ( 'data-value' , 'bcmc' ) ;
@@ -108,16 +117,18 @@ test.describe('Bcmc payments with dual branding', () => {
108
117
} ) ;
109
118
110
119
test ( 'should not submit the bcmc payment with incomplete form data' , async ( { bcmc } ) => {
120
+ await bcmc . goto ( URL_MAP . bcmc ) ;
111
121
await bcmc . isComponentVisible ( ) ;
112
122
await bcmc . fillCardNumber ( BCMC_DUAL_BRANDED_VISA ) ;
113
- await bcmc . waitForVisibleDualBrands ( ) ;
123
+ await bcmc . waitForVisibleBrands ( ) ;
114
124
await bcmc . selectBrand ( 'Bancontact card' ) ;
115
125
await bcmc . pay ( ) ;
116
126
117
127
await expect ( bcmc . expiryDateErrorElement ) . toHaveText ( 'Enter the expiry date' ) ;
118
128
} ) ;
119
129
120
130
test ( 'should not submit the bcmc payment with invalid bcmc card number' , async ( { bcmc } ) => {
131
+ await bcmc . goto ( URL_MAP . bcmc ) ;
121
132
await bcmc . isComponentVisible ( ) ;
122
133
await bcmc . fillCardNumber ( `${ BCMC_DUAL_BRANDED_VISA } 111` ) ;
123
134
await bcmc . pay ( ) ;
@@ -128,11 +139,12 @@ test.describe('Bcmc payments with dual branding', () => {
128
139
129
140
test . describe ( 'Selecting the visa brand' , ( ) => {
130
141
test ( 'should submit the visa payment' , async ( { bcmc } ) => {
142
+ await bcmc . goto ( URL_MAP . bcmc ) ;
131
143
await bcmc . isComponentVisible ( ) ;
132
144
133
145
await bcmc . fillCardNumber ( BCMC_DUAL_BRANDED_VISA ) ;
134
146
await bcmc . fillExpiryDate ( TEST_DATE_VALUE ) ;
135
- await bcmc . waitForVisibleDualBrands ( ) ;
147
+ await bcmc . waitForVisibleBrands ( ) ;
136
148
137
149
const [ firstBrand , secondBrand ] = await bcmc . brands ;
138
150
expect ( firstBrand ) . toHaveAttribute ( 'data-value' , 'bcmc' ) ;
@@ -148,11 +160,12 @@ test.describe('Bcmc payments with dual branding', () => {
148
160
} ) ;
149
161
150
162
test ( 'should not submit the visa payment with incomplete form data' , async ( { bcmc } ) => {
163
+ await bcmc . goto ( URL_MAP . bcmc ) ;
151
164
await bcmc . isComponentVisible ( ) ;
152
165
153
166
await bcmc . fillCardNumber ( BCMC_DUAL_BRANDED_VISA ) ;
154
167
await bcmc . fillExpiryDate ( TEST_DATE_VALUE ) ;
155
- await bcmc . waitForVisibleDualBrands ( ) ;
168
+ await bcmc . waitForVisibleBrands ( ) ;
156
169
157
170
await bcmc . selectBrand ( / v i s a / i) ;
158
171
await bcmc . pay ( ) ;
@@ -161,6 +174,7 @@ test.describe('Bcmc payments with dual branding', () => {
161
174
} ) ;
162
175
163
176
test ( 'should not submit the visa payment with invalid visa card number' , async ( { bcmc } ) => {
177
+ await bcmc . goto ( URL_MAP . bcmc ) ;
164
178
await bcmc . isComponentVisible ( ) ;
165
179
await bcmc . fillCardNumber ( `${ BCMC_DUAL_BRANDED_VISA } 111` ) ;
166
180
await bcmc . pay ( ) ;
@@ -173,11 +187,12 @@ test.describe('Bcmc payments with dual branding', () => {
173
187
test . describe ( 'Bancontact (BCMC) / MC brands' , ( ) => {
174
188
test . describe ( 'Selecting the Bancontact brand' , ( ) => {
175
189
test ( 'should submit the bcmc payment' , async ( { bcmc } ) => {
190
+ await bcmc . goto ( URL_MAP . bcmc ) ;
176
191
await bcmc . isComponentVisible ( ) ;
177
192
178
193
await bcmc . fillCardNumber ( BCMC_DUAL_BRANDED_MC ) ;
179
194
await bcmc . fillExpiryDate ( TEST_DATE_VALUE ) ;
180
- await bcmc . waitForVisibleDualBrands ( ) ;
195
+ await bcmc . waitForVisibleBrands ( ) ;
181
196
182
197
const [ firstBrand , secondBrand ] = await bcmc . brands ;
183
198
expect ( firstBrand ) . toHaveAttribute ( 'data-value' , 'bcmc' ) ;
@@ -190,16 +205,18 @@ test.describe('Bcmc payments with dual branding', () => {
190
205
} ) ;
191
206
192
207
test ( 'should not submit the bcmc payment with incomplete form data' , async ( { bcmc } ) => {
208
+ await bcmc . goto ( URL_MAP . bcmc ) ;
193
209
await bcmc . isComponentVisible ( ) ;
194
210
await bcmc . fillCardNumber ( BCMC_DUAL_BRANDED_MC ) ;
195
- await bcmc . waitForVisibleDualBrands ( ) ;
211
+ await bcmc . waitForVisibleBrands ( ) ;
196
212
await bcmc . selectBrand ( 'Bancontact card' ) ;
197
213
await bcmc . pay ( ) ;
198
214
199
215
await expect ( bcmc . expiryDateErrorElement ) . toHaveText ( 'Enter the expiry date' ) ;
200
216
} ) ;
201
217
202
218
test ( 'should not submit the bcmc payment with invalid bcmc card number' , async ( { bcmc } ) => {
219
+ await bcmc . goto ( URL_MAP . bcmc ) ;
203
220
await bcmc . isComponentVisible ( ) ;
204
221
await bcmc . fillCardNumber ( `${ BCMC_DUAL_BRANDED_MC } 111` ) ;
205
222
await bcmc . pay ( ) ;
@@ -210,11 +227,12 @@ test.describe('Bcmc payments with dual branding', () => {
210
227
211
228
test . describe ( 'Selecting the mc brand' , ( ) => {
212
229
test ( 'should submit the mc payment' , async ( { bcmc } ) => {
230
+ await bcmc . goto ( URL_MAP . bcmc ) ;
213
231
await bcmc . isComponentVisible ( ) ;
214
232
215
233
await bcmc . fillCardNumber ( BCMC_DUAL_BRANDED_MC ) ;
216
234
await bcmc . fillExpiryDate ( TEST_DATE_VALUE ) ;
217
- await bcmc . waitForVisibleDualBrands ( ) ;
235
+ await bcmc . waitForVisibleBrands ( ) ;
218
236
219
237
const [ firstBrand , secondBrand ] = await bcmc . brands ;
220
238
expect ( firstBrand ) . toHaveAttribute ( 'data-value' , 'bcmc' ) ;
@@ -228,11 +246,12 @@ test.describe('Bcmc payments with dual branding', () => {
228
246
} ) ;
229
247
230
248
test ( 'should not submit the mc payment with incomplete form data' , async ( { bcmc } ) => {
249
+ await bcmc . goto ( URL_MAP . bcmc ) ;
231
250
await bcmc . isComponentVisible ( ) ;
232
251
233
252
await bcmc . fillCardNumber ( BCMC_DUAL_BRANDED_MC ) ;
234
253
await bcmc . fillExpiryDate ( TEST_DATE_VALUE ) ;
235
- await bcmc . waitForVisibleDualBrands ( ) ;
254
+ await bcmc . waitForVisibleBrands ( ) ;
236
255
237
256
await bcmc . selectBrand ( 'MasterCard' ) ;
238
257
await bcmc . pay ( ) ;
@@ -241,6 +260,7 @@ test.describe('Bcmc payments with dual branding', () => {
241
260
} ) ;
242
261
243
262
test ( 'should not submit the mc payment with invalid mc card number' , async ( { bcmc } ) => {
263
+ await bcmc . goto ( URL_MAP . bcmc ) ;
244
264
await bcmc . isComponentVisible ( ) ;
245
265
await bcmc . fillCardNumber ( `${ BCMC_DUAL_BRANDED_MC } 111` ) ;
246
266
await bcmc . pay ( ) ;
0 commit comments