@@ -59,8 +59,6 @@ test.describe('SendTransaction', () => {
59
59
60
60
const btnLocator = getButtonByText ( page , 'Review' ) ;
61
61
62
- await expectButtonToBeEnabled ( btnLocator ) ;
63
- await page . waitForTimeout ( 5000 ) ;
64
62
await expectButtonToBeEnabled ( btnLocator ) ;
65
63
await btnLocator . click ( ) ;
66
64
@@ -95,8 +93,6 @@ test.describe('SendTransaction', () => {
95
93
// make sure the button is enabled
96
94
const btnLocator = getButtonByText ( page , 'Review' ) ;
97
95
98
- await expectButtonToBeEnabled ( btnLocator ) ;
99
- await page . waitForTimeout ( 5000 ) ;
100
96
await expectButtonToBeEnabled ( btnLocator ) ;
101
97
await btnLocator . click ( ) ;
102
98
@@ -140,8 +136,6 @@ test.describe('SendTransaction', () => {
140
136
141
137
const btnLocator = getButtonByText ( page , 'Review' ) ;
142
138
143
- await expectButtonToBeEnabled ( btnLocator ) ;
144
- await page . waitForTimeout ( 5000 ) ;
145
139
await expectButtonToBeEnabled ( btnLocator ) ;
146
140
await btnLocator . click ( ) ;
147
141
@@ -173,12 +167,9 @@ test.describe('SendTransaction', () => {
173
167
174
168
// Waiting button change to Review in order to ensure that fee amount is updated
175
169
await page . waitForSelector ( 'button:has-text("Review")' ) ;
176
- await page . waitForTimeout ( 1000 ) ;
177
170
178
171
const btnLocator = getButtonByText ( page , 'Review' ) ;
179
172
180
- await expectButtonToBeEnabled ( btnLocator ) ;
181
- await page . waitForTimeout ( 5000 ) ;
182
173
await expectButtonToBeEnabled ( btnLocator ) ;
183
174
await btnLocator . click ( ) ;
184
175
@@ -215,12 +206,9 @@ test.describe('SendTransaction', () => {
215
206
216
207
// Waiting button change to Review in order to change fee amount
217
208
await page . waitForSelector ( 'button:has-text("Review")' ) ;
218
- await page . waitForTimeout ( 1000 ) ;
219
209
220
210
const btnLocator = getButtonByText ( page , 'Review' ) ;
221
211
222
- await expectButtonToBeEnabled ( btnLocator ) ;
223
- await page . waitForTimeout ( 5000 ) ;
224
212
await expectButtonToBeEnabled ( btnLocator ) ;
225
213
await btnLocator . click ( ) ;
226
214
@@ -253,27 +241,38 @@ test.describe('SendTransaction', () => {
253
241
254
242
// Waiting button change to Review in order to ensure that fee amount is updated
255
243
await page . waitForSelector ( 'button:has-text("Review")' ) ;
256
- await page . waitForTimeout ( 1000 ) ;
257
244
258
245
// Selecting and extracting regular fee amount
246
+ await expect
247
+ . poll (
248
+ async ( ) => {
249
+ return await getByAriaLabel ( page , 'fee value:Regular' ) . isVisible ( ) ;
250
+ } ,
251
+ { timeout : 10000 }
252
+ )
253
+ . toBeTruthy ( ) ;
259
254
const regularFeeComponent = getByAriaLabel ( page , 'fee value:Regular' ) ;
260
255
await regularFeeComponent . click ( ) ;
261
256
262
257
// Waiting button change to Review in order to ensure that fee amount is updated
263
258
await page . waitForSelector ( 'button:has-text("Review")' ) ;
264
- await page . waitForTimeout ( 1000 ) ;
265
259
266
260
const btnLocatorBeforeApprv = getButtonByText ( page , 'Review' ) ;
267
261
268
- await expectButtonToBeEnabled ( btnLocatorBeforeApprv ) ;
269
- await page . waitForTimeout ( 5000 ) ;
270
262
await expectButtonToBeEnabled ( btnLocatorBeforeApprv ) ;
271
263
await btnLocatorBeforeApprv . click ( ) ;
272
264
273
265
// Waiting button change to Approve in order to get updated fee amount
274
266
await page . waitForSelector ( 'button:has-text("Submit")' ) ;
275
- await page . waitForTimeout ( 1000 ) ;
276
267
268
+ await expect
269
+ . poll (
270
+ async ( ) => {
271
+ return await getButtonByText ( page , 'Back' ) . isVisible ( ) ;
272
+ } ,
273
+ { timeout : 10000 }
274
+ )
275
+ . toBeTruthy ( ) ;
277
276
// Going back to select other fee value
278
277
await getButtonByText ( page , 'Back' ) . click ( ) ;
279
278
@@ -283,27 +282,37 @@ test.describe('SendTransaction', () => {
283
282
284
283
// Waiting button change to Review in order to change fee amount
285
284
await page . waitForSelector ( 'button:has-text("Review")' ) ;
286
- await page . waitForTimeout ( 1000 ) ;
287
285
288
286
const btnLocator = getButtonByText ( page , 'Review' ) ;
289
287
290
- await expectButtonToBeEnabled ( btnLocator ) ;
291
- await page . waitForTimeout ( 5000 ) ;
292
288
await expectButtonToBeEnabled ( btnLocator ) ;
293
289
await btnLocator . click ( ) ;
294
290
295
291
// Waiting button change to Approve in order to get updated fee amount
296
292
await page . waitForSelector ( 'button:has-text("Submit")' ) ;
297
- await page . waitForTimeout ( 1000 ) ;
298
293
299
294
await hasText ( page , '0.001 ETH' ) ;
300
295
301
- await page . waitForTimeout ( 1000 ) ;
296
+ await expect
297
+ . poll (
298
+ async ( ) => {
299
+ return await getButtonByText ( page , 'Submit' ) . isEnabled ( ) ;
300
+ } ,
301
+ { timeout : 10000 }
302
+ )
303
+ . toBeTruthy ( ) ;
302
304
await getButtonByText ( page , 'Submit' ) . click ( ) ;
303
305
await hasText ( page , '0.001 ETH' ) ;
304
306
305
307
// Wait for transaction to be confirmed
306
- await hasText ( page , 'success' ) ;
308
+ await expect
309
+ . poll (
310
+ async ( ) => {
311
+ return await hasText ( page , 'success' ) ;
312
+ } ,
313
+ { timeout : 10000 }
314
+ )
315
+ . toBeTruthy ( ) ;
307
316
} ) ;
308
317
309
318
test ( 'Send max amount transaction' , async ( ) => {
@@ -337,15 +346,12 @@ test.describe('SendTransaction', () => {
337
346
// Fee values change
338
347
await new Promise ( ( resolve ) => setTimeout ( resolve , 3000 ) ) ;
339
348
340
- const maxAmountAfterFee = await getInputByName ( page , 'amount' ) . inputValue ( ) ;
341
-
342
349
// Submit transaction
343
350
344
351
const btnLocator = getButtonByText ( page , 'Review' ) ;
345
352
346
353
await expectButtonToBeEnabled ( btnLocator ) ;
347
- await page . waitForTimeout ( 5000 ) ;
348
- await expectButtonToBeEnabled ( btnLocator ) ;
354
+ const maxAmountAfterFee = await getInputByName ( page , 'amount' ) . inputValue ( ) ;
349
355
await btnLocator . click ( ) ;
350
356
351
357
// Approve transaction
0 commit comments