Skip to content

Commit 069eca1

Browse files
Update checks on place order button for WC blocks
1 parent e40174b commit 069eca1

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ describeif( shouldRunWCBlocksTests )(
100100
await shopper.placeOrderWCB( shopperPage, false );
101101

102102
if ( auth ) {
103+
const placeOrderButton = shopperPage.locator(
104+
'.wc-block-components-checkout-place-order-button'
105+
);
106+
await expect( placeOrderButton ).toBeDisabled();
107+
await expect( placeOrderButton ).toHaveClass(
108+
/wc-block-components-button--loading/
109+
);
103110
await shopper.confirmCardAuthentication( shopperPage );
104111
}
105112

tests/e2e-pw/utils/shopper.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,20 +143,15 @@ export const placeOrderWCB = async (
143143
page: Page,
144144
confirmOrderReceived = true
145145
) => {
146-
const placeOrderButton = page.locator(
147-
'.wc-block-components-checkout-place-order-button'
148-
);
146+
const placeOrderButton = page.getByRole( 'button', {
147+
name: 'Place Order',
148+
} );
149149

150150
await placeOrderButton.focus();
151151
await waitForUiRefresh( page );
152152

153153
await placeOrderButton.click();
154154

155-
await expect( placeOrderButton ).toBeDisabled();
156-
await expect( placeOrderButton ).toHaveClass(
157-
/wc-block-components-button--loading/
158-
);
159-
160155
if ( confirmOrderReceived ) {
161156
await page.waitForURL( /\/order-received\// );
162157
await expect(

0 commit comments

Comments
 (0)