fix for shopAddress Issue if shop address is not provided in the test
This commit is contained in:
parent
3c8212c8d7
commit
7d04b9eda2
2 changed files with 9 additions and 2 deletions
|
|
@ -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>) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue