Fix logic to address when drop off is not available

This commit is contained in:
JennyNou 2026-03-26 23:12:58 -04:00
parent ae93c84fe5
commit 63015e8c4a

View file

@ -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();