Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
update click for edit button
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley authored and tarhi-saad committed Oct 10, 2023
1 parent a15f117 commit b6b67c4
Showing 1 changed file with 10 additions and 22 deletions.
32 changes: 10 additions & 22 deletions tests/e2e/tests/checkout/checkout.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,34 +126,22 @@ export class CheckoutPage {
}

async editBillingDetails() {
const editButton = await this.page
.locator(
'.wc-block-checkout__billing-fields .wc-block-components-address-card__edit'
)
.isVisible();
const editButton = this.page.locator(
'.wc-block-checkout__billing-fields .wc-block-components-address-card__edit'
);

if ( editButton ) {
await this.page
.locator(
'.wc-block-checkout__billing-fields .wc-block-components-address-card__edit'
)
.click();
if ( await editButton.isVisible() ) {
await editButton.click();
}
}

async editShippingDetails() {
const editButton = await this.page
.locator(
'.wc-block-checkout__shipping-fields .wc-block-components-address-card__edit'
)
.isVisible();
const editButton = this.page.locator(
'.wc-block-checkout__shipping-fields .wc-block-components-address-card__edit'
);

if ( editButton ) {
await this.page
.locator(
'.wc-block-checkout__shipping-fields .wc-block-components-address-card__edit'
)
.click();
if ( await editButton.isVisible() ) {
await editButton.click();
}
}

Expand Down

0 comments on commit b6b67c4

Please sign in to comment.