From 7d04b9eda26927e8438176050f2743c7c41f5d3c Mon Sep 17 00:00:00 2001 From: kpatel8hs4io <31411746+kpatel8hs4io@users.noreply.github.com> Date: Mon, 21 Jul 2025 15:40:12 -0400 Subject: [PATCH] fix for shopAddress Issue if shop address is not provided in the test --- playwright-tests/pages/SchedulePage.ts | 8 +++++++- .../tests/CashReplaceMultiSlidingGlassDropoff.ts | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/playwright-tests/pages/SchedulePage.ts b/playwright-tests/pages/SchedulePage.ts index 80bc0486f..6956611b1 100644 --- a/playwright-tests/pages/SchedulePage.ts +++ b/playwright-tests/pages/SchedulePage.ts @@ -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) { diff --git a/playwright-tests/tests/CashReplaceMultiSlidingGlassDropoff.ts b/playwright-tests/tests/CashReplaceMultiSlidingGlassDropoff.ts index d2a54d58f..2da4c6f5e 100644 --- a/playwright-tests/tests/CashReplaceMultiSlidingGlassDropoff.ts +++ b/playwright-tests/tests/CashReplaceMultiSlidingGlassDropoff.ts @@ -34,7 +34,8 @@ const cashReplaceMultiSlidingGlassDropoffData: Partial = { // 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