From 63015e8c4a0c69cee9e59be26f54798052deded0 Mon Sep 17 00:00:00 2001 From: JennyNou Date: Thu, 26 Mar 2026 23:12:58 -0400 Subject: [PATCH] Fix logic to address when drop off is not available --- playwright-tests/pages/SchedulePage.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/playwright-tests/pages/SchedulePage.ts b/playwright-tests/pages/SchedulePage.ts index 1fe05bee..8c8f3f8c 100644 --- a/playwright-tests/pages/SchedulePage.ts +++ b/playwright-tests/pages/SchedulePage.ts @@ -69,10 +69,15 @@ export class SchedulePage extends BasePage { 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() + + if (await this.dropOffButton.isVisible()) { + await this.dropOffButton.waitFor({ state: 'visible', timeout: 5000 }); + await this.dropOffButton.click() } else { - 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 + await (await this.getFirstNonDropOffTimeSlot()).click(); + } + } else { + await (await this.getFirstNonDropOffTimeSlot()).click(); } } else { await this.selectFirstAvailableTime();