From 6b07ec4c33f63102e572af2f418242167a77594d Mon Sep 17 00:00:00 2001 From: JennyNou Date: Wed, 8 Apr 2026 09:45:43 -0400 Subject: [PATCH] Fix flaky locators --- playwright-tests/pages/SchedulePage.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/playwright-tests/pages/SchedulePage.ts b/playwright-tests/pages/SchedulePage.ts index 8c8f3f8c..ede5668b 100644 --- a/playwright-tests/pages/SchedulePage.ts +++ b/playwright-tests/pages/SchedulePage.ts @@ -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 {