From d232267ba0bd78282d4f68c137f43bde7612c73c Mon Sep 17 00:00:00 2001 From: JennyNou Date: Tue, 24 Mar 2026 11:00:11 -0400 Subject: [PATCH] Fix for flakiness in validation flow --- playwright-tests/pages/AfterpayPage.ts | 3 +-- playwright-tests/pages/SchedulePage.ts | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/playwright-tests/pages/AfterpayPage.ts b/playwright-tests/pages/AfterpayPage.ts index 2eb7e690..98c66131 100644 --- a/playwright-tests/pages/AfterpayPage.ts +++ b/playwright-tests/pages/AfterpayPage.ts @@ -37,8 +37,7 @@ export class AfterpayPage extends BasePage { async executeAfterpayPayment(paymentDetails: IPaymentDetails, claimDetails: IClaimDetails, servicePackage: ServicePackage) { await this.login(paymentDetails.password!); - try { - await this.confirmButton.waitFor({ state: 'visible', timeout: 5000 }); + try {await this.confirmButton.waitFor({ state: 'visible', timeout: 5000 }); await this.confirmButton.isVisible() await this.confirmButton.click(); } catch { diff --git a/playwright-tests/pages/SchedulePage.ts b/playwright-tests/pages/SchedulePage.ts index 60dd87d1..d6544208 100644 --- a/playwright-tests/pages/SchedulePage.ts +++ b/playwright-tests/pages/SchedulePage.ts @@ -57,12 +57,14 @@ export class SchedulePage extends BasePage { async scheduleInShop(appointmentDetails?: IAppointmentDetails){ if (appointmentDetails?.serviceLocation === ServiceLocation.InShop) { - await this.inShopButton.waitFor({ state: 'visible', timeout: 5000 }); + try {await this.inShopButton.waitFor({ state: 'visible', timeout: 5000 }); await this.inShopButton.isVisible() await this.inShopButton.click(); await (await this.getFirstNonDropOffTimeSlot()).click(); - } else if (await this.inShopButton.isHidden()) { + } catch { + await this.inShopButton.isHidden() await (await this.getFirstNonDropOffTimeSlot()).click(); + } } else if (appointmentDetails?.serviceLocation === ServiceLocation.DropOff) { if (await this.inShopButton.isVisible()){ await this.inShopButton.waitFor({ state: 'visible', timeout: 5000 });