Fix flaky locators

This commit is contained in:
JennyNou 2026-04-08 09:45:43 -04:00
parent e3f0eb44c8
commit 6b07ec4c33

View file

@ -31,8 +31,8 @@ export class SchedulePage extends BasePage {
super(page);
this.page = page;
this.inShopButton = this.page.locator('[buttonlabel="At a Safelite shop"]');
this.mobileButton = this.page.locator('[buttonlabel="Have Safelite come to me"]');
this.inShopButton = this.page.getByText('At a Safelite shop');
this.mobileButton = this.page.getByText('Have Safelite come to me');
// For in shop
this.moreLocationsButton = this.page.getByRole('button', { name: 'More Locations' });
// For mobile
@ -77,6 +77,7 @@ export class SchedulePage extends BasePage {
await (await this.getFirstNonDropOffTimeSlot()).click();
}
} else {
await this.inShopButton.click();
await (await this.getFirstNonDropOffTimeSlot()).click();
}
} else {