Skip to content

Commit

Permalink
Merge pull request #246 from woocommerce/fix/e2e-wc-9.2
Browse files Browse the repository at this point in the history
Fix E2E tests for WooCommerce 9.2
  • Loading branch information
vikrampm1 authored Aug 23, 2024
2 parents b3bb08b + aed881a commit 8e9d526
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/e2e/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,13 @@ export async function editPayfastSetting( {page, settings} ) {
}
}

const waitForURLPromise = page.waitForURL(
'**/wp-admin/admin.php?page=wc-settings&tab=checkout&section=wc_gateway_payfast' );
const submitButtonLocator = await page.locator( 'text=Save changes' );
await submitButtonLocator.click();
await waitForURLPromise;
if ( await submitButtonLocator.isEnabled() ) {
const waitForURLPromise = page.waitForURL(
'**/wp-admin/admin.php?page=wc-settings&tab=checkout&section=wc_gateway_payfast' );
await submitButtonLocator.click();
await waitForURLPromise;
}
}

/**
Expand Down Expand Up @@ -225,7 +227,7 @@ export async function goToOrderEditPage( {page, orderId} ){
export async function blockFillBillingDetails(page, customerDetails) {
const card = await page.locator('.wc-block-components-address-card');
if (await card.isVisible()) {
await card.locator('a.wc-block-components-address-card__edit').click();
await card.locator('.wc-block-components-address-card__edit').click();
}

await page.getByLabel( 'First name' ).fill( customerDetails.firstname );
Expand Down

0 comments on commit 8e9d526

Please sign in to comment.