Merge pull request #3109 from Safelite/jnou/fix-pw-test-cont-783
Fixing Playwright test by updating locator on Safelite Content homepage
This commit is contained in:
commit
22a806c8c0
1 changed files with 5 additions and 7 deletions
|
|
@ -20,9 +20,8 @@ export class HomePage extends BasePage {
|
||||||
readonly paymentOptionDropdown: Locator;
|
readonly paymentOptionDropdown: Locator;
|
||||||
readonly viewQuoteButton: Locator;
|
readonly viewQuoteButton: Locator;
|
||||||
|
|
||||||
//Zip Entry
|
//Zip Entry
|
||||||
readonly enterServiceZipTextBox: Locator;
|
readonly widgetZipEntryField: Locator;
|
||||||
readonly zipEntryLetsGetStartedButton: Locator;
|
|
||||||
readonly getQuoteAndScheduleButton: Locator;
|
readonly getQuoteAndScheduleButton: Locator;
|
||||||
|
|
||||||
url = process.env['BASE_URL']!;
|
url = process.env['BASE_URL']!;
|
||||||
|
|
@ -31,7 +30,7 @@ export class HomePage extends BasePage {
|
||||||
super(page);
|
super(page);
|
||||||
|
|
||||||
this.page = 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.cusmodalPopup = this.page.locator('#Cusmodalpopup');
|
||||||
this.closePopupButton = this.page.getByRole('button', { name: '×' });
|
this.closePopupButton = this.page.getByRole('button', { name: '×' });
|
||||||
|
|
||||||
|
|
@ -47,8 +46,7 @@ export class HomePage extends BasePage {
|
||||||
this.viewQuoteButton = this.page.locator('#ctaSubmit');
|
this.viewQuoteButton = this.page.locator('#ctaSubmit');
|
||||||
|
|
||||||
//Zip Entry
|
//Zip Entry
|
||||||
this.enterServiceZipTextBox = this.page.locator('#zipCodeTextbox');
|
this.widgetZipEntryField = this.page.getByRole('textbox', { name: 'Enter service ZIP code' });
|
||||||
this.zipEntryLetsGetStartedButton = this.page.locator('#zipCodeTextbox');
|
|
||||||
this.getQuoteAndScheduleButton = this.page.getByLabel('main').getByRole('link', { name: 'Get quote + schedule' });
|
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) {
|
async letsGetStarted(zip: string, enterFunnelWithZip: boolean) {
|
||||||
if (enterFunnelWithZip) {
|
if (enterFunnelWithZip) {
|
||||||
await this.zipEntryLetsGetStartedButton.fill(zip);
|
await this.widgetZipEntryField.fill(zip);
|
||||||
/* await this.letsGetStartedButton.evaluate((element, zip) => {
|
/* await this.letsGetStartedButton.evaluate((element, zip) => {
|
||||||
const currentHref = element.getAttribute('href') || '';
|
const currentHref = element.getAttribute('href') || '';
|
||||||
element.setAttribute('href', `${currentHref}?zipCode=${zip}`);
|
element.setAttribute('href', `${currentHref}?zipCode=${zip}`);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue