From 1941bd8eb07e6b7c6bcd45abfcc9ed88befbbecb Mon Sep 17 00:00:00 2001 From: JennyNou Date: Sun, 22 Mar 2026 22:51:35 -0400 Subject: [PATCH] Fix validation for inshop and dropoff --- playwright-tests/pages/SchedulePage.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/playwright-tests/pages/SchedulePage.ts b/playwright-tests/pages/SchedulePage.ts index e48a3a8a..60dd87d1 100644 --- a/playwright-tests/pages/SchedulePage.ts +++ b/playwright-tests/pages/SchedulePage.ts @@ -56,16 +56,19 @@ export class SchedulePage extends BasePage { // Select in shop and schedule async scheduleInShop(appointmentDetails?: IAppointmentDetails){ - if (await this.inShopButton.isVisible()) { + if (appointmentDetails?.serviceLocation === ServiceLocation.InShop) { 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() && appointmentDetails?.serviceLocation === ServiceLocation.InShop) { + } else if (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 }); await this.inShopButton.click(); + await this.dropOffButton.waitFor({ state: 'visible', timeout: 5000 }); + await this.dropOffButton.click() } else { await this.dropOffButton.waitFor({ state: 'visible', timeout: 5000 }); await this.dropOffButton.isVisible() ? await this.dropOffButton.click() : await (await this.getFirstNonDropOffTimeSlot()).click(); // drop off is available in the morning for same day so this is here to avoid flaky tests