Skip to content

Commit 31c4176

Browse files
committed
Update place order flow
1 parent e80d9d9 commit 31c4176

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

tests/e2e-pw/specs/wcpay/shopper/shopper-wc-blocks-checkout-purchase.spec.ts

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ import { addWCBCheckoutPage } from '../../../utils/merchant';
1717
import { goToCheckoutWCB } from '../../../utils/shopper-navigation';
1818
import {
1919
addToCartFromShopPage,
20-
confirmCardAuthentication,
20+
confirmCardAuthenticationWCB,
2121
fillBillingAddressWCB,
2222
fillCardDetailsWCB,
23+
placeOrderWCB,
2324
} from '../../../utils/shopper';
2425
import { config } from '../../../config/default';
2526

@@ -49,14 +50,7 @@ describeif( shouldRunWCBlocksTests )(
4950
config.addresses.customer.billing
5051
);
5152
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 );
6054
} );
6155

6256
test( 'using a 3DS card', async () => {
@@ -70,10 +64,8 @@ describeif( shouldRunWCBlocksTests )(
7064
config.addresses.customer.billing
7165
);
7266
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 );
7769
await expect(
7870
shopperPage.getByRole( 'heading', {
7971
name: 'Order received',

0 commit comments

Comments
 (0)