[e2e tests] Update customer-payment-page spec to be theme agnostic (#45888)

This commit is contained in:
Adrian Moldovan 2024-03-25 17:03:30 +02:00 committed by GitHub
parent c5c68f5b68
commit 2403baca01
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 10 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: dev
E2E tests: make payment page tests more resilient to theme changes

View File

@ -79,9 +79,9 @@ test.describe( 'WooCommerce Merchant Flow: Orders > Customer Payment Page', () =
await page.locator( 'label[for=order_status] > a' ).click();
// verify we landed on the customer payment page
await expect( page.locator( 'h1.entry-title' ) ).toContainText(
'Pay for order'
);
await expect(
page.getByText( 'You are paying for a guest order.' )
).toBeVisible();
await expect( page.locator( 'td.product-name' ) ).toContainText(
productName
);
@ -101,14 +101,14 @@ test.describe( 'WooCommerce Merchant Flow: Orders > Customer Payment Page', () =
await page.locator( 'button#place_order' ).click();
// Verify we landed on the order received page
await expect( page.locator( 'h1.entry-title' ) ).toContainText(
'Order received'
);
await expect(
page.locator( 'li.woocommerce-order-overview__order.order' )
).toContainText( orderId.toString() );
page.getByText( 'Your order has been received' )
).toBeVisible();
await expect(
page.locator( 'span.woocommerce-Price-amount.amount >> nth=0' )
).toContainText( productPrice );
page.getByText( `Order number: ${ orderId }` )
).toBeVisible();
await expect(
await page.getByText( `Total: $${ productPrice }` ).count()
).toBeGreaterThan( 0 );
} );
} );