Fix logic to address when drop off is not available
This commit is contained in:
parent
ae93c84fe5
commit
63015e8c4a
1 changed files with 8 additions and 3 deletions
|
|
@ -69,10 +69,15 @@ export class SchedulePage extends BasePage {
|
||||||
if (await this.inShopButton.isVisible()){
|
if (await this.inShopButton.isVisible()){
|
||||||
await this.inShopButton.waitFor({ state: 'visible', timeout: 5000 });
|
await this.inShopButton.waitFor({ state: 'visible', timeout: 5000 });
|
||||||
await this.inShopButton.click();
|
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 {
|
} 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 {
|
} else {
|
||||||
await this.selectFirstAvailableTime();
|
await this.selectFirstAvailableTime();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue