Update locator and step for both inshop and mobile flow

This commit is contained in:
JennyNou 2025-08-04 15:56:16 -04:00
parent 132d186ab1
commit 2e0958391a

View file

@ -17,7 +17,7 @@ export class SchedulePage extends BasePage {
readonly militaryWarningMessage: Locator;
readonly changeZipButton: Locator;
readonly updateZipTextBox: Locator;
readonly saveZipButton: Locator;
readonly saveLocationButton: Locator;
readonly changeShopLocationLink: Locator;
readonly selectAShopOptions: Locator;
readonly yourSafeliteShop: Locator;
@ -37,14 +37,14 @@ export class SchedulePage extends BasePage {
super(page);
this.page = page;
this.inShopButton = this.page.getByText(/In-shop/);
this.mobileButton = this.page.locator('label[buttonlabel="Mobile"]');
this.inShopButton = this.page.locator('label[buttonlabel="You come to our store"]');
this.mobileButton = this.page.locator('label[buttonlabel="Our mobile shop comes to you"]');
this.RecalWarningMessage1 = this.page.getByText(/We're not able to provide mobile service/);
this.RecalWarningMessage2 = this.page.getByText(/advanced safety system recalibration needs to be done in our shop./);
this.militaryWarningMessage = this.page.locator('[class*="widget-name-AlertMilitaryBaseZipWidget"]');
this.changeZipButton = this.page.locator('a:has(span.sr-only:has-text("edit zip code"))');
this.updateZipTextBox = this.page.locator('#serviceZipCode').filter({ visible: true });
this.saveZipButton = this.page.getByText('Save ZIP code', { exact: true });
this.saveLocationButton = this.page.getByText('Save location', { exact: true });
this.changeShopLocationLink = this.page.locator(".shop-question a").filter({ hasText: "Change shop location " });
this.selectAShopOptions = this.page.locator('[class="shop-question"]');
this.yourSafeliteShop = this.page.locator("fieldset:has(#chooseShop) label");
@ -82,10 +82,10 @@ export class SchedulePage extends BasePage {
if (zipCodeMatch) {
const zipCode = zipCodeMatch[0];
// Enter the ZIP code into the updateZipTextBox
await this.changeZipButton.click();
await this.changeShopLocationLink.click();
await this.page.waitForTimeout(500);
await this.updateZipTextBox.fill(zipCode);
await this.saveZipButton.click();
await this.saveLocationButton.click();
}
await this.inShopButton.click();