From b9f6372a68434516448d433aa7a0e9bce7054b28 Mon Sep 17 00:00:00 2001 From: JennyNou Date: Wed, 8 Apr 2026 09:46:19 -0400 Subject: [PATCH] Update locator to fix flakiness when selecting address --- playwright-tests/pages/PolicyHolderDetailsPage.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playwright-tests/pages/PolicyHolderDetailsPage.ts b/playwright-tests/pages/PolicyHolderDetailsPage.ts index d7ab5125..dd708f64 100644 --- a/playwright-tests/pages/PolicyHolderDetailsPage.ts +++ b/playwright-tests/pages/PolicyHolderDetailsPage.ts @@ -48,8 +48,8 @@ export class PolicyHolderDetailsPage extends BasePage { await this.addressInputBox.pressSequentially(customerDetails.address.street); // Wait for suggestions to load (Google Places has a slight delay) - await this.page.locator('.pac-item').first().waitFor({ state: 'visible', timeout: 6000 }); - + await this.page.locator('.pac-item').first().waitFor({ state: 'attached', timeout: 6000 }); + await this.page.locator('.pac-item').first().isVisible(); // Click the first result await this.page.locator('.pac-item').first().click();