fix for shopAddress Issue if shop address is not provided in the test

This commit is contained in:
kpatel8hs4io 2025-07-21 15:40:12 -04:00
parent 3c8212c8d7
commit 7d04b9eda2
2 changed files with 9 additions and 2 deletions

View file

@ -20,6 +20,7 @@ export class SchedulePage extends BasePage {
readonly saveZipButton: Locator;
readonly changeShopLocationLink: Locator;
readonly selectAShopOptions: Locator;
readonly yourSafeliteShop: Locator;
readonly firstAvailableDate: Locator;
readonly firstAvailableTime: Locator;
@ -46,6 +47,7 @@ export class SchedulePage extends BasePage {
this.saveZipButton = this.page.getByText('Save ZIP code', { 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");
this.allDayDropOffButton = this.page.locator("label[buttonlabel='Drop off all day']");
this.pickATimeButton = this.page.locator("label[buttonlabel='Pick a time']");
@ -86,9 +88,13 @@ export class SchedulePage extends BasePage {
await this.saveZipButton.click();
}
// await this.inShopButton.click();
await this.inShopButton.click();
// await this.selectAShopOptions.locator(`[buttonbodycopy="${appointmentDetails.shopAddress}"]`).scrollIntoViewIfNeeded().then(() => this.selectAShopOptions.locator(`[buttonbodycopy="${appointmentDetails.shopAddress}"]`).click());
}
if (appointmentDetails && (appointmentDetails.shopAddress === "" || appointmentDetails.shopAddress === undefined )) {
appointmentDetails.shopAddress = await this.yourSafeliteShop.getAttribute("buttonbodycopy") || "";
}
}
async scheduleMobile(testData: Partial<ITestData>) {

View file

@ -34,7 +34,8 @@ const cashReplaceMultiSlidingGlassDropoffData: Partial<ITestData> = {
// Override for drop-off service
appointmentDetails: {
serviceLocation: ServiceLocation.DropOff,
appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate
appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate,
shopAddress: "6826 Sawmill Rd, Columbus, OH 43235"
},
// Override vehicle details