diff --git a/playwright-tests/pages/HomePage.ts b/playwright-tests/pages/HomePage.ts index e2db5ac26..52ceca875 100644 --- a/playwright-tests/pages/HomePage.ts +++ b/playwright-tests/pages/HomePage.ts @@ -20,9 +20,8 @@ export class HomePage extends BasePage { readonly paymentOptionDropdown: Locator; readonly viewQuoteButton: Locator; - //Zip Entry - readonly enterServiceZipTextBox: Locator; - readonly zipEntryLetsGetStartedButton: Locator; + //Zip Entry + readonly widgetZipEntryField: Locator; readonly getQuoteAndScheduleButton: Locator; url = process.env['BASE_URL']!; @@ -31,7 +30,7 @@ export class HomePage extends BasePage { super(page); this.page = page; - this.letsGetStartedButton = this.page.locator('#zipCodeTextboxButton'); + this.letsGetStartedButton = this.page.getByRole('button', { name: 'Let\'s get started' }); this.cusmodalPopup = this.page.locator('#Cusmodalpopup'); this.closePopupButton = this.page.getByRole('button', { name: '×' }); @@ -47,8 +46,7 @@ export class HomePage extends BasePage { this.viewQuoteButton = this.page.locator('#ctaSubmit'); //Zip Entry - this.enterServiceZipTextBox = this.page.locator('#zipCodeTextbox'); - this.zipEntryLetsGetStartedButton = this.page.locator('#zipCodeTextbox'); + this.widgetZipEntryField = this.page.getByRole('textbox', { name: 'Enter service ZIP code' }); this.getQuoteAndScheduleButton = this.page.getByLabel('main').getByRole('link', { name: 'Get quote + schedule' }); } @@ -63,7 +61,7 @@ export class HomePage extends BasePage { async letsGetStarted(zip: string, enterFunnelWithZip: boolean) { if (enterFunnelWithZip) { - await this.zipEntryLetsGetStartedButton.fill(zip); + await this.widgetZipEntryField.fill(zip); /* await this.letsGetStartedButton.evaluate((element, zip) => { const currentHref = element.getAttribute('href') || ''; element.setAttribute('href', `${currentHref}?zipCode=${zip}`);