Fix flaky locators
This commit is contained in:
parent
e3f0eb44c8
commit
6b07ec4c33
1 changed files with 3 additions and 2 deletions
|
|
@ -31,8 +31,8 @@ export class SchedulePage extends BasePage {
|
||||||
super(page);
|
super(page);
|
||||||
this.page = page;
|
this.page = page;
|
||||||
|
|
||||||
this.inShopButton = this.page.locator('[buttonlabel="At a Safelite shop"]');
|
this.inShopButton = this.page.getByText('At a Safelite shop');
|
||||||
this.mobileButton = this.page.locator('[buttonlabel="Have Safelite come to me"]');
|
this.mobileButton = this.page.getByText('Have Safelite come to me');
|
||||||
// For in shop
|
// For in shop
|
||||||
this.moreLocationsButton = this.page.getByRole('button', { name: 'More Locations' });
|
this.moreLocationsButton = this.page.getByRole('button', { name: 'More Locations' });
|
||||||
// For mobile
|
// For mobile
|
||||||
|
|
@ -77,6 +77,7 @@ export class SchedulePage extends BasePage {
|
||||||
await (await this.getFirstNonDropOffTimeSlot()).click();
|
await (await this.getFirstNonDropOffTimeSlot()).click();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
await this.inShopButton.click();
|
||||||
await (await this.getFirstNonDropOffTimeSlot()).click();
|
await (await this.getFirstNonDropOffTimeSlot()).click();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue