@@ -7,10 +7,11 @@ import { test, expect, Page } from '@playwright/test';
7
7
* Internal dependencies
8
8
*/
9
9
import * as shopper from '../../../utils/shopper' ;
10
- import { getMerchant , getShopper } from '../../../utils/helpers' ;
10
+ import { describeif , getMerchant , getShopper } from '../../../utils/helpers' ;
11
11
import * as merchant from '../../../utils/merchant' ;
12
12
import { config } from '../../../config/default' ;
13
13
import { goToCheckoutWCB } from '../../../utils/shopper-navigation' ;
14
+ import { shouldRunWCBlocksTests } from '../../../utils/constants' ;
14
15
15
16
test . describe ( 'Alipay Checkout' , ( ) => {
16
17
let merchantPage : Page ;
@@ -63,45 +64,47 @@ test.describe( 'Alipay Checkout', () => {
63
64
}
64
65
) ;
65
66
66
- test (
67
+ describeif ( shouldRunWCBlocksTests ) (
67
68
'checkout on block-based checkout page' ,
68
69
{ tag : '@critical' } ,
69
- async ( ) => {
70
- await shopper . setupProductCheckout (
71
- shopperPage ,
72
- [ [ config . products . cap , 1 ] ] ,
73
- config . addresses . customer . billing
74
- ) ;
75
- await goToCheckoutWCB ( shopperPage ) ;
76
- await shopper . fillBillingAddressWCB (
77
- shopperPage ,
78
- config . addresses . customer . billing
79
- ) ;
80
-
81
- await shopperPage
82
- . getByRole ( 'radio' , {
83
- name : 'Alipay' ,
84
- } )
85
- . click ( ) ;
86
-
87
- await shopper . placeOrderWCB ( shopperPage , false ) ;
88
-
89
- await expect (
90
- shopperPage . getByText ( / A l i p a y t e s t p a y m e n t p a g e / )
91
- ) . toBeVisible ( ) ;
92
-
93
- await shopperPage . getByText ( 'Authorize Test Payment' ) . click ( ) ;
94
-
95
- await expect (
96
- shopperPage . getByRole ( 'heading' , {
97
- name : 'Order received' ,
98
- } )
99
- ) . toBeVisible ( ) ;
100
- await expect (
101
- shopperPage . getByRole ( 'img' , {
102
- name : 'Alipay' ,
103
- } )
104
- ) . toBeVisible ( ) ;
70
+ ( ) => {
71
+ test ( 'completes payment successfully' , async ( ) => {
72
+ await shopper . setupProductCheckout (
73
+ shopperPage ,
74
+ [ [ config . products . cap , 1 ] ] ,
75
+ config . addresses . customer . billing
76
+ ) ;
77
+ await goToCheckoutWCB ( shopperPage ) ;
78
+ await shopper . fillBillingAddressWCB (
79
+ shopperPage ,
80
+ config . addresses . customer . billing
81
+ ) ;
82
+
83
+ await shopperPage
84
+ . getByRole ( 'radio' , {
85
+ name : 'Alipay' ,
86
+ } )
87
+ . click ( ) ;
88
+
89
+ await shopper . placeOrderWCB ( shopperPage , false ) ;
90
+
91
+ await expect (
92
+ shopperPage . getByText ( / A l i p a y t e s t p a y m e n t p a g e / )
93
+ ) . toBeVisible ( ) ;
94
+
95
+ await shopperPage . getByText ( 'Authorize Test Payment' ) . click ( ) ;
96
+
97
+ await expect (
98
+ shopperPage . getByRole ( 'heading' , {
99
+ name : 'Order received' ,
100
+ } )
101
+ ) . toBeVisible ( ) ;
102
+ await expect (
103
+ shopperPage . getByRole ( 'img' , {
104
+ name : 'Alipay' ,
105
+ } )
106
+ ) . toBeVisible ( ) ;
107
+ } ) ;
105
108
}
106
109
) ;
107
110
} ) ;
0 commit comments