Fix validation for inshop and dropoff

This commit is contained in:
JennyNou 2026-03-22 22:51:35 -04:00
parent bc5331bd65
commit 1941bd8eb0

View file

@ -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