Select bank transfer explicitly on customer payment page e2e test (#51210)

Select bank transfer explicitly

Co-authored-by: Jon Lane <jon.lane@automattic.com>
This commit is contained in:
Jonathan Lane 2024-09-06 13:24:44 -07:00 committed by GitHub
parent 36f85ef0c6
commit 43cc912bba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 31 additions and 19 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: dev
Explicitly select the payment method on the customer payment page e2e test

View File

@ -100,15 +100,22 @@ test.describe(
test( 'can pay for the order through the customer payment page', async ( { test( 'can pay for the order through the customer payment page', async ( {
page, page,
} ) => { } ) => {
await test.step( 'Load the customer payment page', async () => {
// key required, so can't go directly to the customer payment page // key required, so can't go directly to the customer payment page
await page.goto( await page.goto(
`wp-admin/admin.php?page=wc-orders&action=edit&id=${ orderId }` `wp-admin/admin.php?page=wc-orders&action=edit&id=${ orderId }`
); );
await page.locator( 'label[for=order_status] > a' ).click(); await page.locator( 'label[for=order_status] > a' ).click();
} );
await test.step( 'Select payment method and pay for the order', async () => {
// explicitly select the payment method
await page.getByText( 'Direct bank transfer' ).click();
// pay for the order // pay for the order
await page.locator( 'button#place_order' ).click(); await page
.getByRole( 'button', { name: 'Pay for order' } )
.click();
} );
await test.step( 'Verify the order received page', async () => {
// Verify we landed on the order received page // Verify we landed on the order received page
await expect( await expect(
page.getByText( 'Your order has been received' ) page.getByText( 'Your order has been received' )
@ -120,5 +127,6 @@ test.describe(
await page.getByText( `Total: $${ productPrice }` ).count() await page.getByText( `Total: $${ productPrice }` ).count()
).toBeGreaterThan( 0 ); ).toBeGreaterThan( 0 );
} ); } );
} );
} }
); );