Skip to content

Commit

Permalink
Update place order flow with a shared function
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoumpierre committed Feb 10, 2025
1 parent fa4d5ac commit d55fa21
Showing 1 changed file with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,10 @@ describeif( shouldRunSubscriptionsTests )(
} );

test( 'should be able to purchase a subscription', async () => {
await shopper.addToCartFromShopPage(
page,
config.products.subscription_signup_fee
);

await shopper.setupCheckout( page, customerBillingConfig );
await shopper.selectPaymentMethod( page );
await shopper.fillCardDetails( page, config.cards.basic );
await shopper.placeOrder( page );
await expect(
page.getByRole( 'heading', { name: 'Order received' } )
).toBeVisible();
await shopper.placeOrderWithOptions( page, {
product: config.products.subscription_signup_fee,
billingAddress: customerBillingConfig,
} );

subscriptionId = await page
.getByLabel( 'View subscription number' )
Expand Down Expand Up @@ -70,6 +62,7 @@ describeif( shouldRunSubscriptionsTests )(
).toBeVisible();
await shopper.focusPlaceOrderButton( page );
await shopper.placeOrder( page );
await page.waitForURL( /\/order-received\// );
await expect(
page.getByRole( 'heading', { name: 'Order received' } )
).toBeVisible();
Expand Down

0 comments on commit d55fa21

Please sign in to comment.