@@ -17,9 +17,10 @@ import { addWCBCheckoutPage } from '../../../utils/merchant';
17
17
import { goToCheckoutWCB } from '../../../utils/shopper-navigation' ;
18
18
import {
19
19
addToCartFromShopPage ,
20
- confirmCardAuthentication ,
20
+ confirmCardAuthenticationWCB ,
21
21
fillBillingAddressWCB ,
22
22
fillCardDetailsWCB ,
23
+ placeOrderWCB ,
23
24
} from '../../../utils/shopper' ;
24
25
import { config } from '../../../config/default' ;
25
26
@@ -49,14 +50,7 @@ describeif( shouldRunWCBlocksTests )(
49
50
config . addresses . customer . billing
50
51
) ;
51
52
await fillCardDetailsWCB ( shopperPage , config . cards . basic ) ;
52
- await shopperPage
53
- . getByRole ( 'button' , { name : 'Place Order' } )
54
- . click ( ) ;
55
- await expect (
56
- shopperPage . getByRole ( 'heading' , {
57
- name : 'Order received' ,
58
- } )
59
- ) . toBeVisible ( ) ;
53
+ await placeOrderWCB ( shopperPage ) ;
60
54
} ) ;
61
55
62
56
test ( 'using a 3DS card' , async ( ) => {
@@ -70,10 +64,8 @@ describeif( shouldRunWCBlocksTests )(
70
64
config . addresses . customer . billing
71
65
) ;
72
66
await fillCardDetailsWCB ( shopperPage , config . cards [ '3ds' ] ) ;
73
- await shopperPage
74
- . getByRole ( 'button' , { name : 'Place Order' } )
75
- . click ( ) ;
76
- await confirmCardAuthentication ( shopperPage ) ;
67
+ await placeOrderWCB ( shopperPage , false ) ;
68
+ await confirmCardAuthenticationWCB ( shopperPage ) ;
77
69
await expect (
78
70
shopperPage . getByRole ( 'heading' , {
79
71
name : 'Order received' ,
0 commit comments