From c49228220dc049dc789a1edaadcf3248999f74e9 Mon Sep 17 00:00:00 2001 From: maguire-arman Date: Tue, 20 May 2025 10:42:49 -0400 Subject: [PATCH 01/36] Adds support for heavy truck insurance flow Adds a new test case for a big truck insurance flow. This includes updating the test data to include a flag for heavy trucks and the zip code. Renames `isHeavyTruckVehicle` to `isHeavyTruckVehicleAlert` for clarity. --- .../business-logic/types/IAlertFlags.ts | 2 +- .../business-logic/types/ITestData.ts | 1 + .../pages/VehicleSelectionPage.ts | 12 ++- playwright-tests/tests/0000__M.test.ts | 2 + .../tests/BigTruckInsuranceVerifiedFlow.ts | 80 +++++++++++++++++++ .../alert-validation/alert0001_HeavyTruck.ts | 2 +- 6 files changed, 94 insertions(+), 5 deletions(-) create mode 100644 playwright-tests/tests/BigTruckInsuranceVerifiedFlow.ts diff --git a/playwright-tests/business-logic/types/IAlertFlags.ts b/playwright-tests/business-logic/types/IAlertFlags.ts index b13f30bbc..7943ed6be 100644 --- a/playwright-tests/business-logic/types/IAlertFlags.ts +++ b/playwright-tests/business-logic/types/IAlertFlags.ts @@ -1,5 +1,5 @@ export default interface IAlertFlags { - isHeavyTruckVehicle?: boolean, + isHeavyTruckVehicleAlert?: boolean, isRepairReplace?: boolean, isSplitWindshield?: boolean, isRepairOnly?: boolean, diff --git a/playwright-tests/business-logic/types/ITestData.ts b/playwright-tests/business-logic/types/ITestData.ts index 76d0e4534..dab74efcf 100644 --- a/playwright-tests/business-logic/types/ITestData.ts +++ b/playwright-tests/business-logic/types/ITestData.ts @@ -29,6 +29,7 @@ export interface ITestData { endorsements: IEndorsementDetails[], hasOemEndorsement: boolean, // OEM Endorsement does not appear on endorsements page, so it has a separate flag.s skipEstimatePage: boolean, + isHeavyTruck: boolean, isRecalVehicle: boolean, canNotRecal: boolean, dynamicRecal: boolean, diff --git a/playwright-tests/pages/VehicleSelectionPage.ts b/playwright-tests/pages/VehicleSelectionPage.ts index f554639a5..6e78cfe6d 100644 --- a/playwright-tests/pages/VehicleSelectionPage.ts +++ b/playwright-tests/pages/VehicleSelectionPage.ts @@ -11,6 +11,7 @@ export class VehicleSelectionPage extends BasePage { readonly makeDropdown: Locator; readonly modelDropdown: Locator; readonly styleDropdown: Locator; + readonly zipCodeTextBox: Locator; readonly discontinuedServiceAlert: Locator; url = process.env['BASE_URL']! + '/fmg/?fmgPage=vehicle'; @@ -22,6 +23,7 @@ export class VehicleSelectionPage extends BasePage { this.makeDropdown = this.page.locator('#makeQuestionField'); this.modelDropdown = this.page.locator('#modelQuestionField'); this.styleDropdown = this.page.locator('#styleQuestionField'); + this.zipCodeTextBox = this.page.getByRole('textbox', { name: 'Zip code' }); this.discontinuedServiceAlert = this.page.locator('.alert-danger.widget-name-AlertNoServiceWidget'); // this.validateURL(this.url); } @@ -48,13 +50,17 @@ export class VehicleSelectionPage extends BasePage { @step("VehicleSelectionPage >> Select Vehicle: ") async handleVehicleSelectionPage(testData: Partial) { await this.validateProgressBar("4"); - const { vehicleDetails } = testData; - const { isHeavyTruckVehicle, isSplitWindshield } = testData.alertFlags || {}; + const { vehicleDetails, isHeavyTruck, customerDetails } = testData; + const { isHeavyTruckVehicleAlert, isSplitWindshield } = testData.alertFlags || {}; await this.selectVehicle(vehicleDetails!); + + if (isHeavyTruck) { + await this.zipCodeTextBox.fill(customerDetails?.address.postalCode!); + } // Handle alert conditions for vehicle selection - if (isHeavyTruckVehicle || isSplitWindshield) { + if (isHeavyTruckVehicleAlert || isSplitWindshield) { await this.checkForAlertMessages(); throw new TestSuccessAlert('Both assertions are met successfully.'); } diff --git a/playwright-tests/tests/0000__M.test.ts b/playwright-tests/tests/0000__M.test.ts index b51c8dd5e..d504bf24e 100644 --- a/playwright-tests/tests/0000__M.test.ts +++ b/playwright-tests/tests/0000__M.test.ts @@ -31,6 +31,7 @@ import cashRepairInShopAfterPayTests from "./CashRepairInShopAfterPay"; import cashRepairInShopPayPalTests from "./CashRepairInShopPayPal"; import cashReplaceMultiSlidingGlassDropoffTests from "./CashReplaceMultiSlidingGlassDropoff"; import cashReplaceMultiGlassMobileTests from "./CashReplaceMultiGlassMobile"; +import insuranceBigTruckVerifiedTests from "./BigTruckInsuranceVerifiedFlow"; /** * Master Test Runner @@ -67,6 +68,7 @@ const allStandardTests = [ {name: "CashReplaceWiperPromoInshop", tests: cashReplaceWiperPromoInShopTests}, {name: "InsuranceAcuityPaypal", tests: insuranceAcuityPaypalTests}, {name: "InsuranceITAC21stCentury", tests: insuranceITAC21stCenturyTests}, + {name: "BigTruckInsuranceVerifiedFlow", tests: insuranceBigTruckVerifiedTests}, // {name: "InsuranceGeico", tests: insuranceGeicoTests}, // {name: "InsuranceITACOptimizedPriceValidationAllState", tests: insuranceITACOptimizedPriceValidationAllStateTests} diff --git a/playwright-tests/tests/BigTruckInsuranceVerifiedFlow.ts b/playwright-tests/tests/BigTruckInsuranceVerifiedFlow.ts new file mode 100644 index 000000000..a97e64912 --- /dev/null +++ b/playwright-tests/tests/BigTruckInsuranceVerifiedFlow.ts @@ -0,0 +1,80 @@ +//Imports here +import { ITestData } from "@business-logic/types/ITestData" +import { PaymentMethod, AppointmentType, DamageType, PaymentType } from "@business-logic/types/Enums"; +import TestCase from "@business-logic/types/TestCase"; +import { VehicleLookupType } from "@business-logic/types/Enums"; +import { getDefaultTestData, setFakerSeedFromTestName } from "@business-logic/constants/DefaultTestData"; + +// Set the seed based on test name for consistent but unique data +setFakerSeedFromTestName("InsuranceBigTruckVerified"); + +// Now get the test data with the seeded faker +const insuranceBigTruckVerifiedData: Partial = { + ...getDefaultTestData(), // Get default data with current seed + + // Key feature: Insurance flow with GEICO + paymentMethod: PaymentMethod.Insurance, + + // Insurance claim flags + isDuplicateClaim: true, + isPolicyFound: true, + isUseVehicleOnPolicy: true, + isHeavyTruck: true, + + // Override customer details with specific name and California location + customerDetails: { + ...getDefaultTestData().customerDetails!, + firstName: 'Big', + lastName: 'Truck', + address: { + ...getDefaultTestData().customerDetails!.address, + city: 'Ontario', + state: 'California', + postalCode: '55414' + } + }, + + + // Insurance claim details + claimDetails: { + client: 'USAA', + policyNumber: 'Mock900040BigTruck', + policyDeductible: 2000.00, + damageDate: new Date(new Date().setDate(new Date().getDate() - 1)).toLocaleDateString('en-US', {month: '2-digit', day: '2-digit', year: 'numeric'}), + damageCause: DamageType.Rock + }, + + // Hyundai vehicle details with VIN lookup + vehicleDetails: { + ...getDefaultTestData().vehicleDetails!, + year: '2025', + make: 'Peterbilt', + model: '579', + style: 'conventional cab', + vin: '1XPBDP9X6SD693446', + vehicleLookupType: VehicleLookupType.Vin, + }, + + // No need to override vehicleDamage as it already defaults to WindshieldCrack + + // Override for in-shop appointment + appointmentDetails: { + serviceLocation: AppointmentType.InShop, + shopAddress: '504 Malcolm Ave SE, Minneapolis, MN 55414', + appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate + }, + + // Override payment details (empty because we skip payment method page in insurance flow) + paymentDetails: {} +} + +const insuranceBigTruckVerifiedTests: TestCase[] = []; + +const tc = new TestCase({ + name: `InsuranceBigTruckVerified`, + tags: ['@E2E','@InsuranceBigTruckVerified', '@test_report', '@Insurance'], + testData: insuranceBigTruckVerifiedData +}, undefined, 'InsuranceBigTruckVerified'); +insuranceBigTruckVerifiedTests.push(tc); + +export default insuranceBigTruckVerifiedTests; \ No newline at end of file diff --git a/playwright-tests/tests/alert-validation/alert0001_HeavyTruck.ts b/playwright-tests/tests/alert-validation/alert0001_HeavyTruck.ts index dad46ecd5..9a881d4e5 100644 --- a/playwright-tests/tests/alert-validation/alert0001_HeavyTruck.ts +++ b/playwright-tests/tests/alert-validation/alert0001_HeavyTruck.ts @@ -18,7 +18,7 @@ const heavyTruckData: Partial = { style: 'conventional cab' }, alertFlags: { - isHeavyTruckVehicle: true + isHeavyTruckVehicleAlert: true }, vehicleDamage: [ VehicleDamage.WindshieldOneChip, From 5925f0765317d4e7b74deeeda1a11d71622c3cc3 Mon Sep 17 00:00:00 2001 From: maguire-arman Date: Tue, 20 May 2025 11:27:08 -0400 Subject: [PATCH 02/36] fixed address for big truck location --- playwright-tests/tests/BigTruckInsuranceVerifiedFlow.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright-tests/tests/BigTruckInsuranceVerifiedFlow.ts b/playwright-tests/tests/BigTruckInsuranceVerifiedFlow.ts index a97e64912..78832afd5 100644 --- a/playwright-tests/tests/BigTruckInsuranceVerifiedFlow.ts +++ b/playwright-tests/tests/BigTruckInsuranceVerifiedFlow.ts @@ -60,7 +60,7 @@ const insuranceBigTruckVerifiedData: Partial = { // Override for in-shop appointment appointmentDetails: { serviceLocation: AppointmentType.InShop, - shopAddress: '504 Malcolm Ave SE, Minneapolis, MN 55414', + shopAddress: '504 Malcolm Ave Se, Minneapolis, MN 55414', appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate }, From 2b16a6b2fdf01c362c64afb975c53a59b9f7d0ed Mon Sep 17 00:00:00 2001 From: maguire-arman Date: Tue, 20 May 2025 11:28:09 -0400 Subject: [PATCH 03/36] Corrects deductible validation on order confirmation Ensures the order confirmation page accurately displays the policy deductible amount for insurance users. Previously, it incorrectly validated the service package amount against a hardcoded value instead of the policy deductible. --- playwright-tests/pages/OrderConfirmationPage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright-tests/pages/OrderConfirmationPage.ts b/playwright-tests/pages/OrderConfirmationPage.ts index 6e513d7d2..c66f95497 100644 --- a/playwright-tests/pages/OrderConfirmationPage.ts +++ b/playwright-tests/pages/OrderConfirmationPage.ts @@ -102,7 +102,7 @@ export class OrderConfirmationPage extends BasePage { } else { // Price validations for insurance users if (servicePackage === ServicePackage.GlassOnly) { - expect.soft(servicePackageAmt).toEqual(0); + expect.soft(servicePackageAmt).toEqual(claimDetails?.policyDeductible); } else { expect.soft(servicePackageAmt).toBeGreaterThan(0); } From 9c13fec5a2448c496c7b43bf6f673eedf6658583 Mon Sep 17 00:00:00 2001 From: Jenny Nou Date: Tue, 20 May 2025 15:56:58 -0400 Subject: [PATCH 04/36] Added policy zip to test data --- playwright-tests/business-logic/types/ITestData.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/playwright-tests/business-logic/types/ITestData.ts b/playwright-tests/business-logic/types/ITestData.ts index dab74efcf..ec616fb83 100644 --- a/playwright-tests/business-logic/types/ITestData.ts +++ b/playwright-tests/business-logic/types/ITestData.ts @@ -33,5 +33,6 @@ export interface ITestData { isRecalVehicle: boolean, canNotRecal: boolean, dynamicRecal: boolean, - promoCode: string + promoCode: string, + policyZip: string } \ No newline at end of file From 152043dfd94e0f378812204161ea0cf25c85ad1d Mon Sep 17 00:00:00 2001 From: Jenny Nou Date: Tue, 20 May 2025 15:57:56 -0400 Subject: [PATCH 05/36] Renamed big truck insurance test file --- playwright-tests/tests/0000__M.test.ts | 4 ++-- ...InsuranceVerifiedFlow.ts => InsuranceBigTruckVerified.ts} | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) rename playwright-tests/tests/{BigTruckInsuranceVerifiedFlow.ts => InsuranceBigTruckVerified.ts} (95%) diff --git a/playwright-tests/tests/0000__M.test.ts b/playwright-tests/tests/0000__M.test.ts index d504bf24e..e09acec35 100644 --- a/playwright-tests/tests/0000__M.test.ts +++ b/playwright-tests/tests/0000__M.test.ts @@ -31,7 +31,7 @@ import cashRepairInShopAfterPayTests from "./CashRepairInShopAfterPay"; import cashRepairInShopPayPalTests from "./CashRepairInShopPayPal"; import cashReplaceMultiSlidingGlassDropoffTests from "./CashReplaceMultiSlidingGlassDropoff"; import cashReplaceMultiGlassMobileTests from "./CashReplaceMultiGlassMobile"; -import insuranceBigTruckVerifiedTests from "./BigTruckInsuranceVerifiedFlow"; +import insuranceBigTruckVerifiedTests from "./InsuranceBigTruckVerified"; /** * Master Test Runner @@ -68,7 +68,7 @@ const allStandardTests = [ {name: "CashReplaceWiperPromoInshop", tests: cashReplaceWiperPromoInShopTests}, {name: "InsuranceAcuityPaypal", tests: insuranceAcuityPaypalTests}, {name: "InsuranceITAC21stCentury", tests: insuranceITAC21stCenturyTests}, - {name: "BigTruckInsuranceVerifiedFlow", tests: insuranceBigTruckVerifiedTests}, + {name: "InsuranceBigTruckVerified", tests: insuranceBigTruckVerifiedTests}, // {name: "InsuranceGeico", tests: insuranceGeicoTests}, // {name: "InsuranceITACOptimizedPriceValidationAllState", tests: insuranceITACOptimizedPriceValidationAllStateTests} diff --git a/playwright-tests/tests/BigTruckInsuranceVerifiedFlow.ts b/playwright-tests/tests/InsuranceBigTruckVerified.ts similarity index 95% rename from playwright-tests/tests/BigTruckInsuranceVerifiedFlow.ts rename to playwright-tests/tests/InsuranceBigTruckVerified.ts index 78832afd5..f06e9171d 100644 --- a/playwright-tests/tests/BigTruckInsuranceVerifiedFlow.ts +++ b/playwright-tests/tests/InsuranceBigTruckVerified.ts @@ -30,7 +30,7 @@ const insuranceBigTruckVerifiedData: Partial = { ...getDefaultTestData().customerDetails!.address, city: 'Ontario', state: 'California', - postalCode: '55414' + postalCode: '43085' } }, @@ -40,6 +40,7 @@ const insuranceBigTruckVerifiedData: Partial = { client: 'USAA', policyNumber: 'Mock900040BigTruck', policyDeductible: 2000.00, + policyZip: '55414', damageDate: new Date(new Date().setDate(new Date().getDate() - 1)).toLocaleDateString('en-US', {month: '2-digit', day: '2-digit', year: 'numeric'}), damageCause: DamageType.Rock }, @@ -60,7 +61,7 @@ const insuranceBigTruckVerifiedData: Partial = { // Override for in-shop appointment appointmentDetails: { serviceLocation: AppointmentType.InShop, - shopAddress: '504 Malcolm Ave Se, Minneapolis, MN 55414', + shopAddress: '5719 Brandt Pike, Dayton, OH 45424', appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate }, From ef1efe0fe0a5fd783c508f36e1192613f575206c Mon Sep 17 00:00:00 2001 From: gc-carlin Date: Thu, 29 May 2025 16:59:17 -0400 Subject: [PATCH 06/36] Cash switch to insurance - needs fixing --- ...placeSwitchToInsuranceProgressiveNoComp.ts | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 playwright-tests/tests/CashReplaceSwitchToInsuranceProgressiveNoComp.ts diff --git a/playwright-tests/tests/CashReplaceSwitchToInsuranceProgressiveNoComp.ts b/playwright-tests/tests/CashReplaceSwitchToInsuranceProgressiveNoComp.ts new file mode 100644 index 000000000..8b7f2a2e3 --- /dev/null +++ b/playwright-tests/tests/CashReplaceSwitchToInsuranceProgressiveNoComp.ts @@ -0,0 +1,67 @@ +//Imports here +import { ITestData } from "@business-logic/types/ITestData"; +import { PaymentMethod, AppointmentType, DamageType, VehicleLookupType, PaymentType } from "@business-logic/types/Enums"; +import TestCase from "@business-logic/types/TestCase"; +import { getDefaultTestData, setFakerSeedFromTestName } from "@business-logic/constants/DefaultTestData"; + +// Set the seed for consistent data generation +setFakerSeedFromTestName("CashReplaceSwitchToInsuranceProgressiveNoComp"); + +// Define insurance test data for Progressive +const cashReplaceSwitchToInsuranceProgressiveNoCompData: Partial = { + ...getDefaultTestData(), + + // Override customer details based on provided ZIP code + customerDetails: { + ...getDefaultTestData().customerDetails!, + address: { + ...getDefaultTestData().customerDetails!.address, + postalCode: "70458", + }, + }, + + // Vehicle details for a 2012 Chrysler 300 + vehicleDetails: { + ...getDefaultTestData().vehicleDetails!, + year: "2015", + make: "Acura", + model: "MDX", + style: "4 door utility", + vehicleLookupType: VehicleLookupType.Vin, + }, + + // Override payment details + paymentDetails: { + paymentType: PaymentType.PayWithInsurance, // Ensures insurance payment method is selected + }, + + // Insurance claim details + claimDetails: { + client: "Progressive", + policyNumber: "Mock495646B", + policyDeductible: 0, + damageDate: new Date(new Date().setDate(new Date().getDate() - 1)).toLocaleDateString("en-US", { month: "2-digit", day: "2-digit", year: "numeric" }), + damageCause: DamageType.Rock, + }, + + // Override appointment details for in-shop service + appointmentDetails: { + serviceLocation: AppointmentType.InShop, + shopAddress: "8985 Yellow Brick Rd, Rosedale, MD 21237", + appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate, + }, + + +}; + +// Create and register the test case +const cashReplaceSwitchToInsuranceProgressiveNoCompTests: TestCase[] = []; + +const tc = new TestCase({ + name: `CashReplaceSwitchToInsuranceProgressiveNoComp`, + tags: ["@E2E", "@CashReplaceSwitchToInsuranceProgressiveNoComp", "@test_report", "@Insurance"], + testData: cashReplaceSwitchToInsuranceProgressiveNoCompData, +}, undefined, "CashReplaceSwitchToInsuranceProgressiveNoComp"); +cashReplaceSwitchToInsuranceProgressiveNoCompTests.push(tc); + +export default cashReplaceSwitchToInsuranceProgressiveNoCompTests; From 8f83f4184d4671a1797472ad1c8a91324fe561b0 Mon Sep 17 00:00:00 2001 From: Minojhini Valaiyapathi Date: Tue, 3 Jun 2025 10:05:25 -0400 Subject: [PATCH 07/36] CASH-697 - Passing AI-Generated Summary to SSR when Transferring from Scarlett to Salesforce Chat --- .../sierra-webchat/sierra-webchat.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/digital-components/sierra-webchat/sierra-webchat.vue b/src/digital-components/sierra-webchat/sierra-webchat.vue index 2a114616a..8210e9075 100644 --- a/src/digital-components/sierra-webchat/sierra-webchat.vue +++ b/src/digital-components/sierra-webchat/sierra-webchat.vue @@ -94,8 +94,16 @@ export default { FirstName: transfer.data.first_name, LastName: transfer.data.last_name, Email: transfer.data.email, - Subject: transfer.data.chat_summary, // for now passing in chat_summery in Subject. But this will be changed in future. + Subject: transfer.data.chat_summary, }; + window.embedded_svc.settings.extraPrechatFormDetails = [ + { + label: "Scarlett AI Summary", + value: transfer.data.chat_summary, + transcriptFields: ["Scarlett_AI_Summary__c"], + displayToAgent: true, + }, + ]; if ( window.embedded_svc.liveAgentAPI && typeof window.embedded_svc.liveAgentAPI.startChat === "function" From d7a32b582a9c0e5054db95de987bedcdccc4bdd9 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Tue, 3 Jun 2025 14:59:52 -0400 Subject: [PATCH 08/36] Switch away from paypal when navigating back to payment --- src/router/methods/route-logic/payment.js | 14 ++++++++++++++ src/router/methods/routes.js | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 src/router/methods/route-logic/payment.js diff --git a/src/router/methods/route-logic/payment.js b/src/router/methods/route-logic/payment.js new file mode 100644 index 000000000..73f2b5cac --- /dev/null +++ b/src/router/methods/route-logic/payment.js @@ -0,0 +1,14 @@ +import store from "@/store"; +import { storeActions } from "@/constants/store-actions"; +import { paymentMethods } from "@/constants/payment-method-constants"; +import { debugLog } from "@/helpers/debug-log-helper"; + +export async function paymentBeforeEnter(to, from) { + const piaType = store.getters.order?.payment?.piaType; + debugLog(`Entering payment with type =`, piaType); + + if (piaType === paymentMethods.PAYPAL) { + debugLog(`Changing to payment type =`, paymentMethods.CREDIT_CARD); + await store.dispatch(storeActions.SAVE_PAYMENT_METHOD_CHOICE, paymentMethods.CREDIT_CARD); + } +} diff --git a/src/router/methods/routes.js b/src/router/methods/routes.js index 19c802aae..c029ce2cb 100644 --- a/src/router/methods/routes.js +++ b/src/router/methods/routes.js @@ -11,6 +11,7 @@ import { autoRouteBeforeEnter } from "@/router/methods/route-logic/auto-route"; import { errorBeforeEnter } from "@/router/methods/route-logic/error"; import { restartBeforeEnter } from "@/router/methods/route-logic/restart"; import { paymentMethodBeforeEnter } from "@/router/methods/route-logic/payment-method"; +import { paymentBeforeEnter } from "@/router/methods/route-logic/payment"; export const routes = [ // Non-virtual pages. @@ -32,7 +33,7 @@ export const routes = [ createRoute(routeData.SCHEDULE), createRoute(routeData.CUSTOMER_DETAILS), createRoute(routeData.PAYMENT_METHOD, paymentMethodBeforeEnter), - createRoute(routeData.PAYMENT), + createRoute(routeData.PAYMENT, paymentBeforeEnter), createRoute(routeData.PAYMENT_PIA_RETURN), createRoute(routeData.CONFIRMATION), createRoute(routeData.RETURN_USER), From f5ecb1148a91c9bf4243f732926cd994f08c13b6 Mon Sep 17 00:00:00 2001 From: JennyNou <167806377+JennyNou@users.noreply.github.com> Date: Wed, 4 Jun 2025 11:29:34 -0400 Subject: [PATCH 09/36] Added condition for validation --- playwright-tests/pages/PaymentMethodPage.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/playwright-tests/pages/PaymentMethodPage.ts b/playwright-tests/pages/PaymentMethodPage.ts index 240d0e03e..c57caaeef 100644 --- a/playwright-tests/pages/PaymentMethodPage.ts +++ b/playwright-tests/pages/PaymentMethodPage.ts @@ -357,10 +357,12 @@ l } let isCaliforniaState = localStorage.order.serviceLocation.state as string == 'CA' ? true : false; let hasRecalPart: boolean = false; + let canSafeliteRecalibrate: boolean = false; if (!isRepair) { hasRecalPart = localStorage.order.lineItems.glassParts.find((item: any) => item.requiresRecalibration === true) ? true : false; + canSafeliteRecalibrate = localStorage.order.lineItems.glassParts.find((item: any) => item.canSafeliteRecalibrate === true) ? true : false; } - let recalRequired = !isRepair && (isInsurance || isCaliforniaState) && hasRecalPart + let recalRequired = !isRepair && (isInsurance || isCaliforniaState) && hasRecalPart && canSafeliteRecalibrate let stringForRepair: string[] = ["Expert windshield repair", "Exclusive resin sealant", "Nationwide lifetime guarantee"]; let stringIfRecal = isRepair ? "" From c2abf5d7aaaa7b9ee4e05d484bb02cc35f7cd88c Mon Sep 17 00:00:00 2001 From: JennyNou <167806377+JennyNou@users.noreply.github.com> Date: Wed, 4 Jun 2025 11:30:00 -0400 Subject: [PATCH 10/36] Updated heavy truck naming --- playwright-tests/pages/VehicleSelectionPage.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playwright-tests/pages/VehicleSelectionPage.ts b/playwright-tests/pages/VehicleSelectionPage.ts index 21be579d3..c2d638d12 100644 --- a/playwright-tests/pages/VehicleSelectionPage.ts +++ b/playwright-tests/pages/VehicleSelectionPage.ts @@ -51,8 +51,8 @@ export class VehicleSelectionPage extends BasePage { @step("VehicleSelectionPage >> Select Vehicle: ") async handleVehicleSelectionPage(testData: Partial) { await this.validateProgressBar(ProgressBarPercentages.VehicleSelectionPage); - const { vehicleDetails } = testData; - const { isHeavyTruckVehicle, isSplitWindshield } = testData.alertFlags || {}; + const { vehicleDetails, isHeavyTruck, customerDetails } = testData; + const { isHeavyTruckVehicleAlert, isSplitWindshield } = testData.alertFlags || {}; await this.selectVehicle(vehicleDetails!); From 8c167a4d479125c397ccf693451d7366a9b90561 Mon Sep 17 00:00:00 2001 From: Minojhini Valaiyapathi Date: Wed, 4 Jun 2025 12:47:21 -0400 Subject: [PATCH 11/36] CASH-804 - prevent First Available Appointment Date from Resetting --- src/store/index.js | 43 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index c3ad4996e..efeec700c 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1072,6 +1072,11 @@ export const getters = { }, }; +const timeSlotCallFlags = { + shop: false, + mobile: false, +}; + function getNonFalseValuesOfPropertyInArrayOfObjects(array, propertyName) { return (array ?? []).map((x) => x[propertyName]).filter((x) => x); } @@ -2059,20 +2064,31 @@ export const actions = { }, }; - return globalMethods.callHttpClient({ + let hasCalled = timeSlotCallFlags.shop; + if (!hasCalled) { + timeSlotCallFlags.shop = true; + } + + const options = { method: endpoints.GetShopTimeSlots.method, endpoint: endpoints.GetShopTimeSlots.url, payload: payload, logApiCall: true, pageNameToLog: pageNameToLog, - additionalSuccessEventDataHandler: (response) => + }; + + // Only set handler if this is the very first call in this session + if (!hasCalled) { + options.additionalSuccessEventDataHandler = (response) => getTimeSlotsAdditionalEventData( response.data.provisionalTriggers, order.serviceLocation.zipCode, response.data.days?.[0]?.date, shopAppointmentType - ), - }); + ); + } + + return globalMethods.callHttpClient(options); }, getMobileTimeSlots(context, { payload: { startDate, endDate }, pageNameToLog }) { @@ -2116,19 +2132,30 @@ export const actions = { zipCode: order.serviceLocation.zipCode, }; - return globalMethods.callHttpClient({ + let hasCalled = timeSlotCallFlags.mobile; + if (!hasCalled) { + timeSlotCallFlags.mobile = true; + } + + const options = { method: endpoints.GetMobileTimeSlots.method, endpoint: endpoints.GetMobileTimeSlots.url, payload: payload, logApiCall: true, pageNameToLog: pageNameToLog, - additionalSuccessEventDataHandler: (response) => + }; + + // Only set handler if this is the very first call in this session + if (!hasCalled) { + options.additionalSuccessEventDataHandler = (response) => getTimeSlotsAdditionalEventData( response.data.provisionalTriggers, order.serviceLocation.zipCode, response.data.days?.[0]?.date - ), - }); + ); + } + + return globalMethods.callHttpClient(options); }, getMobilePremiumFee(context, { pageNameToLog }) { From 50a900afeb87bf7a66e97b14c3a6dae851bcced7 Mon Sep 17 00:00:00 2001 From: Minojhini Valaiyapathi Date: Wed, 4 Jun 2025 14:08:13 -0400 Subject: [PATCH 12/36] CASH-804 - Re arranged the order of export and private functions --- src/store/index.js | 252 ++++++++++++++++++++++----------------------- 1 file changed, 126 insertions(+), 126 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index efeec700c..073a50e23 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1072,38 +1072,6 @@ export const getters = { }, }; -const timeSlotCallFlags = { - shop: false, - mobile: false, -}; - -function getNonFalseValuesOfPropertyInArrayOfObjects(array, propertyName) { - return (array ?? []).map((x) => x[propertyName]).filter((x) => x); -} - -function getTimeSlotsAdditionalEventData( - provisionalTriggers, - zipCode, - firstAvailableAppointmentDateString, - shopAppointmentType -) { - var numberOfDays = null; - if (firstAvailableAppointmentDateString) - numberOfDays = getDateDifferenceInDays( - new Date().toISOString().split("T")[0], - firstAvailableAppointmentDateString - ); - - if (shopAppointmentType) - return `FirstAvailableAppointment:${numberOfDays},Zip:${zipCode},ShopAppointmentType:${shopAppointmentType},ProvisionalTriggers:${provisionalTriggers.join( - "," - )}`; - else - return `FirstAvailableAppointment:${numberOfDays},Zip:${zipCode},ProvisionalTriggers:${provisionalTriggers.join( - "," - )}`; -} - // Export Actions export const actions = { // Vehicle API Actions @@ -3484,100 +3452,6 @@ export default createStore({ actions, }); -// Private Functions - -function getHasRecalibrationPart(state) { - return containsRecalParts(state.order.lineItems); -} - -function sortArrayOfObjectsByPropertyValue(arrayOfObjects, propertyName) { - if (!arrayOfObjects) return null; - - return arrayOfObjects.sort((a, b) => { - if (a[propertyName] < b[propertyName]) return -1; - else if (a[propertyName] > b[propertyName]) return 1; - else return 0; - }); -} - -function convertGlassPieceNamingForApi(glassArray) { - if (!glassArray || glassArray.length === 0) return []; - - // check if array already converted. (likely when a session has been saved previously and then reloaded) - if (glassArray[0].location !== undefined) { - return glassArray; - } - - const converted = []; - glassArray.forEach((glass) => { - converted.push({ - location: glass.glassLocation, - name: glass.glassName, - }); - }); - return converted; -} - -function convertResultsForApi(resultsArray) { - if (!resultsArray) return []; - const converted = []; - resultsArray.forEach((answer) => { - converted.push({ - location: answer.glassLocation, - name: answer.glassName, - result: answer.result, - }); - }); - return converted; -} - -function convertGlassPieceNamingFromApi(glassArray) { - glassArray.forEach((glass) => { - glass.glassLocation = glass.glassPiece.location; - glass.glassName = glass.glassPiece.name; - delete glass.glassPiece; - return glass; - }); - return glassArray; -} - -function addPricesToLineItems(lineItems, pricingLineItems) { - lineItems.forEach((lineItem) => { - const lineItemIndex = pricingLineItems.findIndex( - (pricingLineItem) => pricingLineItem.partNumber === lineItem.partNumber - ); - - if (lineItem.childParts) { - addPricesToLineItems(lineItem.childParts, pricingLineItems); - } - - const pricedLineItem = pricingLineItems.splice(lineItemIndex, 1)[0]; - lineItem.laborAmount = pricedLineItem.laborAmount; - lineItem.sellingPrice = pricedLineItem.sellingPrice; - lineItem.kitPrice = pricedLineItem.kitPrice; - lineItem.salesTax = pricedLineItem.salesTax; - }); - - return lineItems; -} - -function addTaxesToPricedLineItems(pricedLineItems, taxingLineItems = []) { - pricedLineItems.forEach((pricedLineItem) => { - const lineItemIndex = taxingLineItems.findIndex( - (taxingLineItem) => taxingLineItem.partNumber === pricedLineItem.partNumber - ); - - if (pricedLineItem.childParts) { - addTaxesToPricedLineItems(pricedLineItem.childParts, taxingLineItems); - } - - const taxedLineItem = taxingLineItems.splice(lineItemIndex, 1)[0]; - pricedLineItem.salesTax = taxedLineItem?.salesTax ?? 0; - }); - - return pricedLineItems; -} - export function mapTaxedLineItemsToStoreFormat(availableLineItems, storeLineItems) { // clone the lineItems array because what we're passing in is referencing the store directly const lineItems = deepClone(storeLineItems); @@ -3685,6 +3559,127 @@ export function getArrayOfAllLineItemsAndChildParts(lineItems) { return consolidatedLineItemsArray; } +// Private Functions + +function getNonFalseValuesOfPropertyInArrayOfObjects(array, propertyName) { + return (array ?? []).map((x) => x[propertyName]).filter((x) => x); +} + +function getTimeSlotsAdditionalEventData( + provisionalTriggers, + zipCode, + firstAvailableAppointmentDateString, + shopAppointmentType +) { + var numberOfDays = null; + if (firstAvailableAppointmentDateString) + numberOfDays = getDateDifferenceInDays( + new Date().toISOString().split("T")[0], + firstAvailableAppointmentDateString + ); + + if (shopAppointmentType) + return `FirstAvailableAppointment:${numberOfDays},Zip:${zipCode},ShopAppointmentType:${shopAppointmentType},ProvisionalTriggers:${provisionalTriggers.join( + "," + )}`; + else + return `FirstAvailableAppointment:${numberOfDays},Zip:${zipCode},ProvisionalTriggers:${provisionalTriggers.join( + "," + )}`; +} + +function getHasRecalibrationPart(state) { + return containsRecalParts(state.order.lineItems); +} + +function sortArrayOfObjectsByPropertyValue(arrayOfObjects, propertyName) { + if (!arrayOfObjects) return null; + + return arrayOfObjects.sort((a, b) => { + if (a[propertyName] < b[propertyName]) return -1; + else if (a[propertyName] > b[propertyName]) return 1; + else return 0; + }); +} + +function convertGlassPieceNamingForApi(glassArray) { + if (!glassArray || glassArray.length === 0) return []; + + // check if array already converted. (likely when a session has been saved previously and then reloaded) + if (glassArray[0].location !== undefined) { + return glassArray; + } + + const converted = []; + glassArray.forEach((glass) => { + converted.push({ + location: glass.glassLocation, + name: glass.glassName, + }); + }); + return converted; +} + +function convertResultsForApi(resultsArray) { + if (!resultsArray) return []; + const converted = []; + resultsArray.forEach((answer) => { + converted.push({ + location: answer.glassLocation, + name: answer.glassName, + result: answer.result, + }); + }); + return converted; +} + +function convertGlassPieceNamingFromApi(glassArray) { + glassArray.forEach((glass) => { + glass.glassLocation = glass.glassPiece.location; + glass.glassName = glass.glassPiece.name; + delete glass.glassPiece; + return glass; + }); + return glassArray; +} + +function addPricesToLineItems(lineItems, pricingLineItems) { + lineItems.forEach((lineItem) => { + const lineItemIndex = pricingLineItems.findIndex( + (pricingLineItem) => pricingLineItem.partNumber === lineItem.partNumber + ); + + if (lineItem.childParts) { + addPricesToLineItems(lineItem.childParts, pricingLineItems); + } + + const pricedLineItem = pricingLineItems.splice(lineItemIndex, 1)[0]; + lineItem.laborAmount = pricedLineItem.laborAmount; + lineItem.sellingPrice = pricedLineItem.sellingPrice; + lineItem.kitPrice = pricedLineItem.kitPrice; + lineItem.salesTax = pricedLineItem.salesTax; + }); + + return lineItems; +} + +function addTaxesToPricedLineItems(pricedLineItems, taxingLineItems = []) { + pricedLineItems.forEach((pricedLineItem) => { + const lineItemIndex = taxingLineItems.findIndex( + (taxingLineItem) => taxingLineItem.partNumber === pricedLineItem.partNumber + ); + + if (pricedLineItem.childParts) { + addTaxesToPricedLineItems(pricedLineItem.childParts, taxingLineItems); + } + + const taxedLineItem = taxingLineItems.splice(lineItemIndex, 1)[0]; + pricedLineItem.salesTax = taxedLineItem?.salesTax ?? 0; + }); + + return pricedLineItems; +} + function getFlattenedArrayOfLineItemsWithChildParts(lineItems, childPartRecursiveCall = false) { let flattenedArray = []; lineItems?.forEach((lineItem) => { @@ -3993,3 +3988,8 @@ function getExternalParameterDefaultState() { function saveExternalParameterState(externalParameterState) { window.sessionStorage.setItem("externalParameterState", JSON.stringify(externalParameterState)); } + +const timeSlotCallFlags = { + shop: false, + mobile: false, +}; From b3fd46350fb1a6f5cfdca59ba858c61228fa7fae Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Thu, 5 Jun 2025 14:04:44 -0400 Subject: [PATCH 13/36] Remove premature consumption of zip query --- src/layouts/estimate/estimate.vue | 4 ++-- src/router/methods/helpers/querystring-stash.js | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index 811cd1a86..2818d2ecb 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -62,7 +62,7 @@ import { saveSession } from "@/helpers/heritage-integration/order-helper.js"; import baseMixin from "@/mixins/base-mixin.js"; import { queryStrings } from "@/constants/query-strings"; import { nextTick } from "vue"; -import { consumeQueryFromStash } from "@/router/methods/helpers/querystring-stash"; +import { peekQueryFromStash } from "@/router/methods/helpers/querystring-stash"; // Define Validation Rules defineRule("zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED)); @@ -100,7 +100,7 @@ export default { } const zip = - consumeQueryFromStash(queryStrings.ZIP_CODE) ?? + peekQueryFromStash(queryStrings.ZIP_CODE) ?? store.getters.order.serviceLocation.zipCode; var vinByAddressPromise; diff --git a/src/router/methods/helpers/querystring-stash.js b/src/router/methods/helpers/querystring-stash.js index 96b206572..b000f8feb 100644 --- a/src/router/methods/helpers/querystring-stash.js +++ b/src/router/methods/helpers/querystring-stash.js @@ -1,4 +1,5 @@ import { reactive } from "vue"; +import { debugLog } from "@/helpers/debug-log-helper"; const queryStash = reactive({ queries: [], @@ -27,10 +28,18 @@ export function stashAllQueries(toRoute) { } function getStashedQuery(key) { + debugLog(`Fetching querystring with key:`, key); const match = queryStash.queries.find( (entry) => entry?.key?.toLowerCase() === key?.toLowerCase() ); + if (match) { + debugLog(`Found result:`, match.value); + debugLog(`Already consumed:`, match.used); + } else { + debugLog(`Found no result`); + } + return match; } From 3e7d251244b1f4c757bb68d7d8b451c33236f311 Mon Sep 17 00:00:00 2001 From: JennyNou <167806377+JennyNou@users.noreply.github.com> Date: Mon, 9 Jun 2025 15:23:54 -0400 Subject: [PATCH 14/36] Added new test to cover unverified insurance flow --- playwright-tests/tests/InsuranceUnverified.ts | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 playwright-tests/tests/InsuranceUnverified.ts diff --git a/playwright-tests/tests/InsuranceUnverified.ts b/playwright-tests/tests/InsuranceUnverified.ts new file mode 100644 index 000000000..f0fcf293a --- /dev/null +++ b/playwright-tests/tests/InsuranceUnverified.ts @@ -0,0 +1,86 @@ +//Imports here +import { ITestData } from "@business-logic/types/ITestData" +import { PaymentMethod, AppointmentType, DamageType, PartQuestionType } from "@business-logic/types/Enums"; +import TestCase from "@business-logic/types/TestCase"; +import { VehicleLookupType } from "@business-logic/types/Enums"; +import { getDefaultTestData, setFakerSeedFromTestName } from "@business-logic/constants/DefaultTestData"; + +// Set the seed based on test name for consistent but unique data +setFakerSeedFromTestName("InsuranceUnverified"); + +// Now get the test data with the seeded faker +const insuranceUnverifiedData: Partial = { + ...getDefaultTestData(), // Get default data with current seed + + // Key feature: Insurance flow with GEICO + paymentMethod: PaymentMethod.Insurance, + + // Insurance claim flags + isPolicyFound: false, + isPolicyUnverified: true, + isRecalNotification: true, + + // Override customer details with specific name and California location + customerDetails: { + ...getDefaultTestData().customerDetails!, + firstName: 'Jane', + lastName: 'Unverified', + address: { + ...getDefaultTestData().customerDetails!.address, + city: 'Richmond', + state: 'Virginia', + postalCode: '23219' + } + }, + + + // Insurance claim details + claimDetails: { + client: '21st Century', + policyNumber: 'UnverifiedMock', + policyDeductible: "Unverified", + policyZip: '43123', + damageDate: new Date(new Date().setDate(new Date().getDate() - 1)).toLocaleDateString('en-US', {month: '2-digit', day: '2-digit', year: 'numeric'}), + damageCause: DamageType.Rock + }, + + // Hyundai vehicle details with VIN lookup + vehicleDetails: { + ...getDefaultTestData().vehicleDetails!, + year: '2014', + make: 'Honda', + model: 'Accord', + style: '4 door sedan', + vehicleLookupType: VehicleLookupType.Zip, + }, + + // Part questions related to recalibration + partQuestions: [ + { + partQuestionType: PartQuestionType.GeneralQuestion1, + isOnPage: true, + optionToSelect: 'Yes' + }, + ], + + // Override for in-shop appointment + appointmentDetails: { + serviceLocation: AppointmentType.InShop, + shopAddress: '5719 Brandt Pike, Dayton, OH 45424', + appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate + }, + + // Override payment details (empty because we skip payment method page in insurance flow) + paymentDetails: {} +} + +const insuranceUnverifiedTests: TestCase[] = []; + +const tc = new TestCase({ + name: `InsuranceUnverified`, + tags: ['@E2E','@InsuranceUnverified', '@test_report', '@Insurance'], + testData: insuranceUnverifiedData +}, undefined, 'InsuranceUnverified'); +insuranceUnverifiedTests.push(tc); + +export default insuranceUnverifiedTests; \ No newline at end of file From 896174056046757b03f7243ee6fab97532939745 Mon Sep 17 00:00:00 2001 From: JennyNou <167806377+JennyNou@users.noreply.github.com> Date: Mon, 9 Jun 2025 15:24:58 -0400 Subject: [PATCH 15/36] Changed policy deductible type to cover unverified coverage text --- playwright-tests/business-logic/types/CustomerDetails.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright-tests/business-logic/types/CustomerDetails.ts b/playwright-tests/business-logic/types/CustomerDetails.ts index 3ac2747a0..3c1f9841d 100644 --- a/playwright-tests/business-logic/types/CustomerDetails.ts +++ b/playwright-tests/business-logic/types/CustomerDetails.ts @@ -61,7 +61,7 @@ export interface IPaymentDetails { export interface IClaimDetails { client: string, policyNumber: string, - policyDeductible: number, + policyDeductible: any, policyZip?: string damageDate: string, damageCause: DamageCause From ca41375b3c257d489373c3c85392a17f44f70d68 Mon Sep 17 00:00:00 2001 From: JennyNou <167806377+JennyNou@users.noreply.github.com> Date: Mon, 9 Jun 2025 15:25:23 -0400 Subject: [PATCH 16/36] Added unverified policy flag --- playwright-tests/business-logic/types/ITestData.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/playwright-tests/business-logic/types/ITestData.ts b/playwright-tests/business-logic/types/ITestData.ts index ec616fb83..f9d776224 100644 --- a/playwright-tests/business-logic/types/ITestData.ts +++ b/playwright-tests/business-logic/types/ITestData.ts @@ -34,5 +34,6 @@ export interface ITestData { canNotRecal: boolean, dynamicRecal: boolean, promoCode: string, - policyZip: string + policyZip: string, + isPolicyUnverified: boolean } \ No newline at end of file From 514fdca340116908c8e8e8a7d6b8cadbf7871f1b Mon Sep 17 00:00:00 2001 From: JennyNou <167806377+JennyNou@users.noreply.github.com> Date: Mon, 9 Jun 2025 15:26:20 -0400 Subject: [PATCH 17/36] Updated locator and logic for unverified policy flow --- playwright-tests/pages/CoverageStatementPage.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/playwright-tests/pages/CoverageStatementPage.ts b/playwright-tests/pages/CoverageStatementPage.ts index 7085c6794..b529f21f1 100644 --- a/playwright-tests/pages/CoverageStatementPage.ts +++ b/playwright-tests/pages/CoverageStatementPage.ts @@ -9,7 +9,7 @@ export class CoverageStatementPage extends InsuranceBasePage { readonly scheduleOnlineButton: Locator; readonly cancelMyClaimButton: Locator; readonly deductibleAmount: Locator; - readonly verfiyingCoverageText: Locator; + readonly verifyingCoverageText: Locator; readonly continueButton: Locator; // For ITAC/NoComp url = process.env['BASE_URL']! + '/FixMyGlass/CoverageStatement.aspx'; @@ -19,7 +19,7 @@ export class CoverageStatementPage extends InsuranceBasePage { this.scheduleOnlineButton = this.page.getByText('Continue to schedule online'); this.cancelMyClaimButton = this.page.getByText('Cancel my claim'); this.deductibleAmount = this.page.getByRole('heading', { name: '$' }).locator('span'); - this.verfiyingCoverageText = this.page.getByRole('heading', { name: 'We’re verifying your coverage' }); + this.verifyingCoverageText = this.page.getByRole('heading', { name: 'We\'re verifying your coverage' }); this.continueButton = page.getByRole('button', { name: 'Continue' }); // this.validateURL(this.url); } @@ -46,16 +46,20 @@ export class CoverageStatementPage extends InsuranceBasePage { "span.deductible-text-black[data-bind='text: deductibleFormatted']" ); + const unverifiedDeductibleElement = this.verifyingCoverageText; + // Check if the locator is visible before running the expectation if (await deductibleElement.isVisible()) { // Check if the page contains the properly formatted deductible amount await expect(deductibleElement).toContainText(`$${expectedDeductibleRegex}`); } - } - async validateUnverifiedText(){ - await expect(this.verfiyingCoverageText).toBeEnabled(); + if (await unverifiedDeductibleElement.isVisible()) { + // Click on continue button if unverified header is visible + await this.continueButton.click(); + } } + @step("CoverageStatementPage >> Next page: ") async handleCoverageStatementPage(testData: Partial) { From bc591b07bd9ffaaf263472d415d82c8a15c6da86 Mon Sep 17 00:00:00 2001 From: JennyNou <167806377+JennyNou@users.noreply.github.com> Date: Mon, 9 Jun 2025 15:28:00 -0400 Subject: [PATCH 18/36] Added logic for validating unverified flow --- .../pages/OrderConfirmationPage.ts | 34 +++++-------------- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/playwright-tests/pages/OrderConfirmationPage.ts b/playwright-tests/pages/OrderConfirmationPage.ts index 588ecb196..489ed1678 100644 --- a/playwright-tests/pages/OrderConfirmationPage.ts +++ b/playwright-tests/pages/OrderConfirmationPage.ts @@ -33,7 +33,7 @@ export class OrderConfirmationPage extends BasePage { this.apptDateText = this.page.locator('[class="scheduleText"]'); this.amountDueText = this.page.getByLabel('expand cart'); this.viewCartButton = this.page.locator('#cart-dropdown-head'); - this.deductibleText = this.page.locator('#deductible-value'); + this.deductibleText = this.page.locator('.deductible'); this.subtotalText = this.page.locator('.sub-total'); this.finalAmountDue = this.page.locator('div.amount-due'); this.cartServicePackageText = this.cartServicePackageText = this.page.locator('.cart-panel'); @@ -44,7 +44,7 @@ export class OrderConfirmationPage extends BasePage { async validateOrderConfirmationPage(testData: Partial) { // Destructure data we use const { vehicleDetails, customerDetails, servicePackage, promoCode, - isPolicyFound, claimDetails, paymentDetails, isUseVehicleOnPolicy, paymentMethod } = testData; + isPolicyFound, claimDetails, paymentDetails, isUseVehicleOnPolicy, paymentMethod, isPolicyUnverified } = testData; await this.serviceText.waitFor({ state: "visible" }); expect.soft((await this.getActualAppointmentSummary()).map(item => item.toLowerCase())).toEqual((await this.getExpectedAppointmentSummary(testData)).map(item => item.toLowerCase())); @@ -87,6 +87,7 @@ export class OrderConfirmationPage extends BasePage { const finalAmountDueAmt = Number.parseFloat(finalAmountDueValue!.split('$')[1].replaceAll(',', '')); + expect.soft(subtotalAmt).toBeGreaterThan(0); // expect.soft(deductibleAmt).toEqual(0); @@ -94,36 +95,17 @@ export class OrderConfirmationPage extends BasePage { // Verify amount due > 0 expect.soft(amountDueAmt).toBeGreaterThan(0); expect.soft(finalAmountDueAmt).toBeGreaterThan(0); + + if (isPolicyUnverified && PaymentType.PayWithInsurance){ + expect.soft(finalAmountDueAmt).toContain('Verifying coverage') + } } else { // Verify amount due 0 expect.soft(amountDueAmt).toEqual(0); expect.soft(finalAmountDueAmt).toEqual(0); } - } else { - // Price validations for insurance users - if (servicePackage === ServicePackage.GlassOnly) { - expect.soft(servicePackageAmt).toEqual(claimDetails?.policyDeductible); - } else { - expect.soft(servicePackageAmt).toBeGreaterThan(0); - } - - // Check for either "Verifying coverage" or "0.00" in price fields - expect.soft( - amountDueValue?.includes('Verifying coverage') || - amountDueValue?.includes('0.00') - ).toBeTruthy(); - - expect.soft( - subtotalTextValue?.includes('Verifying coverage') || - subtotalTextValue?.includes('0.00') - ).toBeTruthy(); - - expect.soft( - finalAmountDueValue?.includes('Verifying coverage') || - finalAmountDueValue?.includes('0.00') - ).toBeTruthy(); - } } +} async getFormattedAppointmentDate(appointmentDate: string) { From c95772052acbea0fa4c00c3eee51964848522980 Mon Sep 17 00:00:00 2001 From: JennyNou <167806377+JennyNou@users.noreply.github.com> Date: Mon, 9 Jun 2025 15:29:06 -0400 Subject: [PATCH 19/36] Added unverified insurance test to master file --- playwright-tests/tests/0000__M.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/playwright-tests/tests/0000__M.test.ts b/playwright-tests/tests/0000__M.test.ts index e09acec35..709e288ff 100644 --- a/playwright-tests/tests/0000__M.test.ts +++ b/playwright-tests/tests/0000__M.test.ts @@ -32,6 +32,7 @@ import cashRepairInShopPayPalTests from "./CashRepairInShopPayPal"; import cashReplaceMultiSlidingGlassDropoffTests from "./CashReplaceMultiSlidingGlassDropoff"; import cashReplaceMultiGlassMobileTests from "./CashReplaceMultiGlassMobile"; import insuranceBigTruckVerifiedTests from "./InsuranceBigTruckVerified"; +import insuranceUnverifiedTests from "./InsuranceUnverified"; /** * Master Test Runner @@ -69,6 +70,7 @@ const allStandardTests = [ {name: "InsuranceAcuityPaypal", tests: insuranceAcuityPaypalTests}, {name: "InsuranceITAC21stCentury", tests: insuranceITAC21stCenturyTests}, {name: "InsuranceBigTruckVerified", tests: insuranceBigTruckVerifiedTests}, + {name: "InsuranceUnverified", tests: insuranceUnverifiedTests}, // {name: "InsuranceGeico", tests: insuranceGeicoTests}, // {name: "InsuranceITACOptimizedPriceValidationAllState", tests: insuranceITACOptimizedPriceValidationAllStateTests} From 2da134bbb119e131bca7fc31e2ebe4baaa440d55 Mon Sep 17 00:00:00 2001 From: maguire-arman Date: Tue, 10 Jun 2025 12:48:44 -0400 Subject: [PATCH 20/36] removes recalinfo boolean and uses isRecalVehicle for handling page in ins Updates the `isRecalNotification` flag to `isRecalVehicle` for better clarity and consistency across the codebase. This change ensures that the flag's name accurately reflects its purpose: to indicate whether recalibration information for a vehicle is required. --- playwright-tests/business-logic/types/ITestData.ts | 1 - playwright-tests/tests/0000__M.test.ts | 4 ++-- playwright-tests/tests/InsuranceITAC21stCentury.ts | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/playwright-tests/business-logic/types/ITestData.ts b/playwright-tests/business-logic/types/ITestData.ts index 76d0e4534..7ae8090df 100644 --- a/playwright-tests/business-logic/types/ITestData.ts +++ b/playwright-tests/business-logic/types/ITestData.ts @@ -25,7 +25,6 @@ export interface ITestData { isPolicyFound: boolean, otherVehiclesOnPolicy: IVehicleDetails[], // IF defined, we validate that the vehicles are present. isUseVehicleOnPolicy: boolean, // Should we use the vehicle on the policy? - isRecalNotification: boolean, // Does Recalibration Information page show up? endorsements: IEndorsementDetails[], hasOemEndorsement: boolean, // OEM Endorsement does not appear on endorsements page, so it has a separate flag.s skipEstimatePage: boolean, diff --git a/playwright-tests/tests/0000__M.test.ts b/playwright-tests/tests/0000__M.test.ts index b51c8dd5e..51594cd19 100644 --- a/playwright-tests/tests/0000__M.test.ts +++ b/playwright-tests/tests/0000__M.test.ts @@ -296,7 +296,7 @@ async function runWorkflow(page: Page, testCase: TestCase) { } export async function handleInsuranceFlow(testCase: TestCase) { - const { isPolicyFound, isPolicyDriver, endorsements, isRecalNotification } = testCase.testData; + const { isPolicyFound, isPolicyDriver, endorsements, isRecalVehicle } = testCase.testData; // Check if the insurance policy has endorsements const hasEndorsements = endorsements && endorsements.length > 0; @@ -340,7 +340,7 @@ export async function handleInsuranceFlow(testCase: TestCase) { let policyInfoSubmittedPage = testCase.pages.policyInfoSubmittedPage; await policyInfoSubmittedPage.handlePolicyInfoSubmittedPage(); - if(isRecalNotification) + if(isRecalVehicle) { let recalibrationInfoPage = testCase.pages.recalibrationInfoPage; await recalibrationInfoPage.handleRecalibrationInfoPage(); diff --git a/playwright-tests/tests/InsuranceITAC21stCentury.ts b/playwright-tests/tests/InsuranceITAC21stCentury.ts index 70ce6b528..b97efd31c 100644 --- a/playwright-tests/tests/InsuranceITAC21stCentury.ts +++ b/playwright-tests/tests/InsuranceITAC21stCentury.ts @@ -19,7 +19,7 @@ const insuranceITAC21stCenturyData: Partial = { isDuplicateClaim: true, isPolicyFound: true, isUseVehicleOnPolicy: true, - isRecalNotification: true, // Special flag for recalibration notification + isRecalVehicle: true, // Special flag for recalibration notification // Override customer details for California location customerDetails: { From 31976f132b6a4b6741817f4aaf0b6ee063af982a Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Tue, 10 Jun 2025 13:41:18 -0400 Subject: [PATCH 21/36] CASH-926 move FL donation to other location in cart. --- src/fmg-components/cart/cart.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 2a715bc93..590fd0857 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -117,6 +117,10 @@ {{ amountPaidText }} {{ getLineItemAmount(amountPaid) }} +
+ {{ donationCartItemName }} + {{ getLineItemAmount(donationCartItem.subTotal) }} +
{{ amountDueText }} {{ getLineItemAmount(amountDue, showCoverageAsPending) }} @@ -472,10 +476,6 @@ export default { }); } - if (this.donationCartItem) { - cartItems.push(this.donationCartItem); - } - return cartItems; }, }, From 380994e0766c7f0abf0214dde62e8df9457a5a99 Mon Sep 17 00:00:00 2001 From: maguire-arman Date: Tue, 10 Jun 2025 14:34:00 -0400 Subject: [PATCH 22/36] Removes unused isRecalNotification flag Removes the `isRecalNotification` flag from the default test data, as it's no longer used in the application's logic or tests. This simplifies the test data and avoids potential confusion. --- playwright-tests/business-logic/constants/DefaultTestData.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/playwright-tests/business-logic/constants/DefaultTestData.ts b/playwright-tests/business-logic/constants/DefaultTestData.ts index 197297b4b..a5929ce76 100644 --- a/playwright-tests/business-logic/constants/DefaultTestData.ts +++ b/playwright-tests/business-logic/constants/DefaultTestData.ts @@ -97,7 +97,6 @@ export function getDefaultTestData(): Partial { isPolicyDriver: false, isPolicyFound: false, isUseVehicleOnPolicy: true, - isRecalNotification: false, hasOemEndorsement: false, skipEstimatePage: false, isRecalVehicle: false, From 552119a04b7a8b3e7fa1701354350b4c16956739 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Fri, 13 Jun 2025 10:22:12 -0400 Subject: [PATCH 23/36] CASH-926 update donation cart styles. --- src/fmg-components/cart/cart.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 590fd0857..299941c29 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -1309,12 +1309,14 @@ export default { .sub-total, .sales-tax, .amount-due, - .amount-paid { - font-weight: 500; + .amount-paid, + .donation-amount { + font-family: UrbanistSemibold, AvertaSemibold;//Okay to remove AvertaSemibold after 2025.06.19 release color: $black; } .sub-total { border-top: 1px solid $green; + background-color: $green-100; } .service-type, .deductible { From cad23ad9eb438bf5fc3cf1db7ae84d255bdc7c8a Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Fri, 13 Jun 2025 10:37:35 -0400 Subject: [PATCH 24/36] Formate code. --- src/fmg-components/cart/cart.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 299941c29..dacfb4c34 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -1311,7 +1311,7 @@ export default { .amount-due, .amount-paid, .donation-amount { - font-family: UrbanistSemibold, AvertaSemibold;//Okay to remove AvertaSemibold after 2025.06.19 release + font-family: UrbanistSemibold, AvertaSemibold; //Okay to remove AvertaSemibold after 2025.06.19 release color: $black; } .sub-total { From ca4b3e5cd31fcaf8473474f968424a285c1a29d3 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Fri, 13 Jun 2025 10:54:26 -0400 Subject: [PATCH 25/36] Small change to trigger build. --- src/fmg-components/cart/cart.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index dacfb4c34..643bc7ed4 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -1311,7 +1311,7 @@ export default { .amount-due, .amount-paid, .donation-amount { - font-family: UrbanistSemibold, AvertaSemibold; //Okay to remove AvertaSemibold after 2025.06.19 release + font-family: UrbanistSemibold, AvertaSemibold; //Okay to remove AvertaSemibold after 2025.06.19 merge/release color: $black; } .sub-total { From 58df1d5b75ba605fd2acea0a013d318a67feb4ac Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Fri, 13 Jun 2025 11:04:00 -0400 Subject: [PATCH 26/36] CASH-926 | Prettier fix --- src/fmg-components/cart/cart.vue | 3 ++- src/styles/ux-variables.scss | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 643bc7ed4..ef3e0300c 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -1311,7 +1311,8 @@ export default { .amount-due, .amount-paid, .donation-amount { - font-family: UrbanistSemibold, AvertaSemibold; //Okay to remove AvertaSemibold after 2025.06.19 merge/release + font-family: + UrbanistSemibold, AvertaSemibold; //Okay to remove AvertaSemibold after 2025.06.19 merge/release color: $black; } .sub-total { diff --git a/src/styles/ux-variables.scss b/src/styles/ux-variables.scss index 1f17a6cf1..9acab9499 100644 --- a/src/styles/ux-variables.scss +++ b/src/styles/ux-variables.scss @@ -121,8 +121,8 @@ $body-color: $gray-600; //Fonts $font-family-sans-serif: AvertaRegular, Arial, Helvetica, sans-serif; -$font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", - monospace; +$font-family-monospace: + SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; // stylelint-enable value-keyword-case $font-family-base: $font-family-sans-serif; $font-family-code: $font-family-monospace; @@ -170,8 +170,7 @@ $spacers: ( /* 16px */ 5: $spacer * 1.5, /* 24px */ 6: $spacer * 2, /* 32px */ 7: $spacer * 2.5, - /* 40px */ 8: $spacer * 3, - /* 48px */ + /* 40px */ 8: $spacer * 3 /* 48px */, ); //Enable negative spacing (does NOT work on padding) From cf4b9539ef3e4abb97335e01ee2fe85a2b3b7e1a Mon Sep 17 00:00:00 2001 From: gc-carlin Date: Wed, 18 Jun 2025 13:48:02 -0400 Subject: [PATCH 27/36] adding test to master --- playwright-tests/tests/0000__M.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/playwright-tests/tests/0000__M.test.ts b/playwright-tests/tests/0000__M.test.ts index b51c8dd5e..0076f61bd 100644 --- a/playwright-tests/tests/0000__M.test.ts +++ b/playwright-tests/tests/0000__M.test.ts @@ -31,7 +31,7 @@ import cashRepairInShopAfterPayTests from "./CashRepairInShopAfterPay"; import cashRepairInShopPayPalTests from "./CashRepairInShopPayPal"; import cashReplaceMultiSlidingGlassDropoffTests from "./CashReplaceMultiSlidingGlassDropoff"; import cashReplaceMultiGlassMobileTests from "./CashReplaceMultiGlassMobile"; - +import cashReplaceSwitchToInsuranceProgressiveNoCompTests from "./CashReplaceSwitchToInsuranceProgressiveNoComp" /** * Master Test Runner * @@ -67,6 +67,7 @@ const allStandardTests = [ {name: "CashReplaceWiperPromoInshop", tests: cashReplaceWiperPromoInShopTests}, {name: "InsuranceAcuityPaypal", tests: insuranceAcuityPaypalTests}, {name: "InsuranceITAC21stCentury", tests: insuranceITAC21stCenturyTests}, + {name: "CashReplaceSwitchToInsuranceProgressiveNoComp", tests: cashReplaceSwitchToInsuranceProgressiveNoCompTests}, // {name: "InsuranceGeico", tests: insuranceGeicoTests}, // {name: "InsuranceITACOptimizedPriceValidationAllState", tests: insuranceITACOptimizedPriceValidationAllStateTests} From 26e3f9c61f8ce40c1002a79e4071e2b2758d7b8c Mon Sep 17 00:00:00 2001 From: gc-carlin Date: Wed, 18 Jun 2025 16:05:54 -0400 Subject: [PATCH 28/36] cashToInsurance final logic for after ins flow --- .../business-logic/types/ITestData.ts | 1 + .../pages/OrderConfirmationPage.ts | 12 +++---- playwright-tests/tests/0000__M.test.ts | 18 ++++++++++- ...placeSwitchToInsuranceProgressiveNoComp.ts | 31 +++++++++++++------ 4 files changed, 46 insertions(+), 16 deletions(-) diff --git a/playwright-tests/business-logic/types/ITestData.ts b/playwright-tests/business-logic/types/ITestData.ts index 61ed18128..72c6758fd 100644 --- a/playwright-tests/business-logic/types/ITestData.ts +++ b/playwright-tests/business-logic/types/ITestData.ts @@ -35,4 +35,5 @@ export interface ITestData { promoCode: string, policyZip: string, isPolicyUnverified: boolean + isCashToInsurance: boolean } \ No newline at end of file diff --git a/playwright-tests/pages/OrderConfirmationPage.ts b/playwright-tests/pages/OrderConfirmationPage.ts index 489ed1678..64348fea4 100644 --- a/playwright-tests/pages/OrderConfirmationPage.ts +++ b/playwright-tests/pages/OrderConfirmationPage.ts @@ -43,7 +43,7 @@ export class OrderConfirmationPage extends BasePage { async validateOrderConfirmationPage(testData: Partial) { // Destructure data we use - const { vehicleDetails, customerDetails, servicePackage, promoCode, + const { vehicleDetails, customerDetails, servicePackage, promoCode, isCashToInsurance: isCashInsuranceFlow, isPolicyFound, claimDetails, paymentDetails, isUseVehicleOnPolicy, paymentMethod, isPolicyUnverified } = testData; await this.serviceText.waitFor({ state: "visible" }); @@ -61,7 +61,7 @@ export class OrderConfirmationPage extends BasePage { const servicePackageAmt = Number.parseFloat(servicePackageValue!.split('$')[1].replaceAll(',', '')); // General Validations - expect.soft(emailTextValue).toContain(customerDetails!.email); + expect.soft(emailTextValue?.toLowerCase()).toContain(customerDetails!.email); // Service package validations await expect.soft(this.cartServicePackageText).toContainText(`${servicePackage}`) @@ -91,14 +91,14 @@ export class OrderConfirmationPage extends BasePage { expect.soft(subtotalAmt).toBeGreaterThan(0); // expect.soft(deductibleAmt).toEqual(0); - if (paymentDetails!.paymentType === PaymentType.PayAtService && (servicePackageAmt > 0)) { + if ((paymentDetails!.paymentType === PaymentType.PayAtService || isCashInsuranceFlow) && (servicePackageAmt > 0)) { // Verify amount due > 0 expect.soft(amountDueAmt).toBeGreaterThan(0); expect.soft(finalAmountDueAmt).toBeGreaterThan(0); - if (isPolicyUnverified && PaymentType.PayWithInsurance){ - expect.soft(finalAmountDueAmt).toContain('Verifying coverage') - } + if (isPolicyUnverified && PaymentType.PayWithInsurance){ + expect.soft(finalAmountDueAmt).toContain('Verifying coverage') + } } else { // Verify amount due 0 expect.soft(amountDueAmt).toEqual(0); diff --git a/playwright-tests/tests/0000__M.test.ts b/playwright-tests/tests/0000__M.test.ts index 8deb2535b..e62fdeeb4 100644 --- a/playwright-tests/tests/0000__M.test.ts +++ b/playwright-tests/tests/0000__M.test.ts @@ -302,7 +302,7 @@ async function runWorkflow(page: Page, testCase: TestCase) { } export async function handleInsuranceFlow(testCase: TestCase) { - const { isPolicyFound, isPolicyDriver, endorsements, isRecalVehicle } = testCase.testData; + const { isPolicyFound, isPolicyDriver, endorsements, isRecalVehicle, isCashToInsurance: isCashInsuranceFlow } = testCase.testData; // Check if the insurance policy has endorsements const hasEndorsements = endorsements && endorsements.length > 0; @@ -355,4 +355,20 @@ export async function handleInsuranceFlow(testCase: TestCase) { //handle coveraage statement page let coverageStatementPage = testCase.pages.coverageStatementPage; await coverageStatementPage.handleCoverageStatementPage(testCase.testData); + + if (isCashInsuranceFlow) { + let serviceLocationPage = testCase.pages.serviceLocationPage; + await serviceLocationPage.nextPage(); + + //schedule + let schedulePage = testCase.pages.schedulePage; + await schedulePage.nextPage(); + //customer dertails + let contactDetailsPage = testCase.pages.contactDetailsPage; + await contactDetailsPage.nextPage(); + + //paymentmethods + let paymentMethodPage = testCase.pages.paymentMethodPage; + await paymentMethodPage.nextPage(); + } } \ No newline at end of file diff --git a/playwright-tests/tests/CashReplaceSwitchToInsuranceProgressiveNoComp.ts b/playwright-tests/tests/CashReplaceSwitchToInsuranceProgressiveNoComp.ts index 8b7f2a2e3..542f7e601 100644 --- a/playwright-tests/tests/CashReplaceSwitchToInsuranceProgressiveNoComp.ts +++ b/playwright-tests/tests/CashReplaceSwitchToInsuranceProgressiveNoComp.ts @@ -1,6 +1,6 @@ //Imports here import { ITestData } from "@business-logic/types/ITestData"; -import { PaymentMethod, AppointmentType, DamageType, VehicleLookupType, PaymentType } from "@business-logic/types/Enums"; +import { PaymentMethod, AppointmentType, DamageType, PartQuestionType, PaymentType } from "@business-logic/types/Enums"; import TestCase from "@business-logic/types/TestCase"; import { getDefaultTestData, setFakerSeedFromTestName } from "@business-logic/constants/DefaultTestData"; @@ -11,6 +11,8 @@ setFakerSeedFromTestName("CashReplaceSwitchToInsuranceProgressiveNoComp"); const cashReplaceSwitchToInsuranceProgressiveNoCompData: Partial = { ...getDefaultTestData(), + isCashToInsurance: true, + // Override customer details based on provided ZIP code customerDetails: { ...getDefaultTestData().customerDetails!, @@ -23,13 +25,20 @@ const cashReplaceSwitchToInsuranceProgressiveNoCompData: Partial = { // Vehicle details for a 2012 Chrysler 300 vehicleDetails: { ...getDefaultTestData().vehicleDetails!, - year: "2015", - make: "Acura", - model: "MDX", - style: "4 door utility", - vehicleLookupType: VehicleLookupType.Vin, + year: "2012", + make: "Chrysler", + model: "300", + style: "4 door sedan" }, + partQuestions: [ + { + partQuestionType: PartQuestionType.GeneralQuestion1, + isOnPage: true, + optionToSelect: 'Yes' + }, + ], + // Override payment details paymentDetails: { paymentType: PaymentType.PayWithInsurance, // Ensures insurance payment method is selected @@ -44,13 +53,17 @@ const cashReplaceSwitchToInsuranceProgressiveNoCompData: Partial = { damageCause: DamageType.Rock, }, - // Override appointment details for in-shop service + isPolicyFound: true, + isUseVehicleOnPolicy: true, + isPolicyDriver: true, + + // Appointment details for in-shop service appointmentDetails: { serviceLocation: AppointmentType.InShop, shopAddress: "8985 Yellow Brick Rd, Rosedale, MD 21237", appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate, }, - + }; @@ -59,7 +72,7 @@ const cashReplaceSwitchToInsuranceProgressiveNoCompTests: TestCase[] = []; const tc = new TestCase({ name: `CashReplaceSwitchToInsuranceProgressiveNoComp`, - tags: ["@E2E", "@CashReplaceSwitchToInsuranceProgressiveNoComp", "@test_report", "@Insurance"], + tags: ["@E2E", "@CashReplaceSwitchToInsuranceProgressiveNoComp", "@test_report", "@CASH"], testData: cashReplaceSwitchToInsuranceProgressiveNoCompData, }, undefined, "CashReplaceSwitchToInsuranceProgressiveNoComp"); cashReplaceSwitchToInsuranceProgressiveNoCompTests.push(tc); From d7566e5d60699fdafcb1c52726ad3ba75a6bc479 Mon Sep 17 00:00:00 2001 From: maguire-arman Date: Thu, 19 Jun 2025 09:20:09 -0400 Subject: [PATCH 29/36] Renames `isCashToInsurance` to `isCashInsuranceFlow` Updates the `isCashToInsurance` property to `isCashInsuranceFlow` for improved clarity and consistency in naming conventions. This change affects test data interfaces and related logic to accurately reflect the cash-to-insurance flow. --- playwright-tests/business-logic/types/ITestData.ts | 2 +- playwright-tests/pages/OrderConfirmationPage.ts | 2 +- playwright-tests/tests/0000__M.test.ts | 4 +++- .../tests/CashReplaceSwitchToInsuranceProgressiveNoComp.ts | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/playwright-tests/business-logic/types/ITestData.ts b/playwright-tests/business-logic/types/ITestData.ts index 72c6758fd..945196539 100644 --- a/playwright-tests/business-logic/types/ITestData.ts +++ b/playwright-tests/business-logic/types/ITestData.ts @@ -35,5 +35,5 @@ export interface ITestData { promoCode: string, policyZip: string, isPolicyUnverified: boolean - isCashToInsurance: boolean + isCashInsuranceFlow: boolean } \ No newline at end of file diff --git a/playwright-tests/pages/OrderConfirmationPage.ts b/playwright-tests/pages/OrderConfirmationPage.ts index 64348fea4..ce54d767c 100644 --- a/playwright-tests/pages/OrderConfirmationPage.ts +++ b/playwright-tests/pages/OrderConfirmationPage.ts @@ -43,7 +43,7 @@ export class OrderConfirmationPage extends BasePage { async validateOrderConfirmationPage(testData: Partial) { // Destructure data we use - const { vehicleDetails, customerDetails, servicePackage, promoCode, isCashToInsurance: isCashInsuranceFlow, + const { vehicleDetails, customerDetails, servicePackage, promoCode, isCashInsuranceFlow, isPolicyFound, claimDetails, paymentDetails, isUseVehicleOnPolicy, paymentMethod, isPolicyUnverified } = testData; await this.serviceText.waitFor({ state: "visible" }); diff --git a/playwright-tests/tests/0000__M.test.ts b/playwright-tests/tests/0000__M.test.ts index e62fdeeb4..419bd227a 100644 --- a/playwright-tests/tests/0000__M.test.ts +++ b/playwright-tests/tests/0000__M.test.ts @@ -302,7 +302,7 @@ async function runWorkflow(page: Page, testCase: TestCase) { } export async function handleInsuranceFlow(testCase: TestCase) { - const { isPolicyFound, isPolicyDriver, endorsements, isRecalVehicle, isCashToInsurance: isCashInsuranceFlow } = testCase.testData; + const { isPolicyFound, isPolicyDriver, endorsements, isRecalVehicle, isCashInsuranceFlow } = testCase.testData; // Check if the insurance policy has endorsements const hasEndorsements = endorsements && endorsements.length > 0; @@ -356,6 +356,8 @@ export async function handleInsuranceFlow(testCase: TestCase) { let coverageStatementPage = testCase.pages.coverageStatementPage; await coverageStatementPage.handleCoverageStatementPage(testCase.testData); + // Handle scenario where user selected Cash to Insurance and needs to go back through the flow + // right now we are choosing pay at appointment as payment method for this scenario if (isCashInsuranceFlow) { let serviceLocationPage = testCase.pages.serviceLocationPage; await serviceLocationPage.nextPage(); diff --git a/playwright-tests/tests/CashReplaceSwitchToInsuranceProgressiveNoComp.ts b/playwright-tests/tests/CashReplaceSwitchToInsuranceProgressiveNoComp.ts index 542f7e601..702c09fce 100644 --- a/playwright-tests/tests/CashReplaceSwitchToInsuranceProgressiveNoComp.ts +++ b/playwright-tests/tests/CashReplaceSwitchToInsuranceProgressiveNoComp.ts @@ -11,7 +11,7 @@ setFakerSeedFromTestName("CashReplaceSwitchToInsuranceProgressiveNoComp"); const cashReplaceSwitchToInsuranceProgressiveNoCompData: Partial = { ...getDefaultTestData(), - isCashToInsurance: true, + isCashInsuranceFlow: true, // Override customer details based on provided ZIP code customerDetails: { From c781ccec80f2a7f280ff82ba0b621e729c5b84cf Mon Sep 17 00:00:00 2001 From: maguire-arman Date: Thu, 19 Jun 2025 10:28:28 -0400 Subject: [PATCH 30/36] New Heavy truck zip to keep error --- playwright-tests/tests/InsuranceUnverified.ts | 2 +- .../tests/alert-validation/alert0001_HeavyTruck.ts | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/playwright-tests/tests/InsuranceUnverified.ts b/playwright-tests/tests/InsuranceUnverified.ts index f0fcf293a..3625774f3 100644 --- a/playwright-tests/tests/InsuranceUnverified.ts +++ b/playwright-tests/tests/InsuranceUnverified.ts @@ -18,7 +18,7 @@ const insuranceUnverifiedData: Partial = { // Insurance claim flags isPolicyFound: false, isPolicyUnverified: true, - isRecalNotification: true, + isRecalVehicle: true, // Override customer details with specific name and California location customerDetails: { diff --git a/playwright-tests/tests/alert-validation/alert0001_HeavyTruck.ts b/playwright-tests/tests/alert-validation/alert0001_HeavyTruck.ts index 9a881d4e5..0cc475c57 100644 --- a/playwright-tests/tests/alert-validation/alert0001_HeavyTruck.ts +++ b/playwright-tests/tests/alert-validation/alert0001_HeavyTruck.ts @@ -3,12 +3,23 @@ import { ITestData } from "@business-logic/types/ITestData" import { VehicleDamage, AppointmentType } from "@business-logic/types/Enums"; import TestCase from "@business-logic/types/TestCase"; import { getNextWeekday } from "@impl/utils/DateUtils"; -import { defaultTestData } from "@business-logic/constants/DefaultTestData"; +import { defaultTestData, getDefaultTestData } from "@business-logic/constants/DefaultTestData"; // Heavy Truck (alert) Test Data const heavyTruckData: Partial = { ...defaultTestData, // Start with all defaults + + isHeavyTruck: true, // Flag for heavy truck vehicle + + customerDetails: { + ...getDefaultTestData().customerDetails!, + address: { + ...getDefaultTestData().customerDetails!.address, + postalCode: '21237' + } + }, + // Override specific fields with test-specific data vehicleDetails: { ...defaultTestData.vehicleDetails!, From 037d8ec01f73fb8d96aabed194aaaf4adf7cae88 Mon Sep 17 00:00:00 2001 From: JennyNou <167806377+JennyNou@users.noreply.github.com> Date: Thu, 19 Jun 2025 11:12:39 -0400 Subject: [PATCH 31/36] Add no comp locator to logic --- playwright-tests/pages/CoverageStatementPage.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/playwright-tests/pages/CoverageStatementPage.ts b/playwright-tests/pages/CoverageStatementPage.ts index b529f21f1..66ab7c763 100644 --- a/playwright-tests/pages/CoverageStatementPage.ts +++ b/playwright-tests/pages/CoverageStatementPage.ts @@ -10,6 +10,7 @@ export class CoverageStatementPage extends InsuranceBasePage { readonly cancelMyClaimButton: Locator; readonly deductibleAmount: Locator; readonly verifyingCoverageText: Locator; + readonly noCompText: Locator; readonly continueButton: Locator; // For ITAC/NoComp url = process.env['BASE_URL']! + '/FixMyGlass/CoverageStatement.aspx'; @@ -20,6 +21,7 @@ export class CoverageStatementPage extends InsuranceBasePage { this.cancelMyClaimButton = this.page.getByText('Cancel my claim'); this.deductibleAmount = this.page.getByRole('heading', { name: '$' }).locator('span'); this.verifyingCoverageText = this.page.getByRole('heading', { name: 'We\'re verifying your coverage' }); + this.noCompText = this.page.getByRole('heading', { name: 'Your policy doesn\'t cover this service' }); this.continueButton = page.getByRole('button', { name: 'Continue' }); // this.validateURL(this.url); } @@ -54,7 +56,7 @@ export class CoverageStatementPage extends InsuranceBasePage { await expect(deductibleElement).toContainText(`$${expectedDeductibleRegex}`); } - if (await unverifiedDeductibleElement.isVisible()) { + if (await unverifiedDeductibleElement.isVisible() || await this.noCompText.isVisible()) { // Click on continue button if unverified header is visible await this.continueButton.click(); } From c3c8b48129e14405a85405f4282ab61e9be39dc2 Mon Sep 17 00:00:00 2001 From: JennyNou <167806377+JennyNou@users.noreply.github.com> Date: Thu, 19 Jun 2025 11:12:51 -0400 Subject: [PATCH 32/36] Add no comp test to master test --- playwright-tests/tests/0000__M.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/playwright-tests/tests/0000__M.test.ts b/playwright-tests/tests/0000__M.test.ts index 213835484..9fca25138 100644 --- a/playwright-tests/tests/0000__M.test.ts +++ b/playwright-tests/tests/0000__M.test.ts @@ -27,6 +27,7 @@ import insuranceAcuityPaypalTests from "./InsuranceAcuityPaypal"; import insuranceITAC21stCenturyTests from "./InsuranceITAC21stCentury"; import insuranceGeicoTests from "./InsuranceGeico"; import insuranceITACOptimizedPriceValidationAllStateTests from "./InsuranceITACOptimizedPriceValidationAllState"; +import insuranceNoCompProgressiveTests from "./InsuranceNoCompProgressive"; import cashRepairInShopAfterPayTests from "./CashRepairInShopAfterPay"; import cashRepairInShopPayPalTests from "./CashRepairInShopPayPal"; import cashReplaceMultiSlidingGlassDropoffTests from "./CashReplaceMultiSlidingGlassDropoff"; @@ -69,6 +70,7 @@ const allStandardTests = [ {name: "CashReplaceWiperPromoInshop", tests: cashReplaceWiperPromoInShopTests}, {name: "InsuranceAcuityPaypal", tests: insuranceAcuityPaypalTests}, {name: "InsuranceITAC21stCentury", tests: insuranceITAC21stCenturyTests}, + {name: "InsuranceNoCompProgressive", tests: insuranceNoCompProgressiveTests}, {name: "InsuranceBigTruckVerified", tests: insuranceBigTruckVerifiedTests}, {name: "InsuranceUnverified", tests: insuranceUnverifiedTests}, // {name: "InsuranceGeico", tests: insuranceGeicoTests}, From 92b3e34d4b87c68f4be4f080f8115a0546e9bf6d Mon Sep 17 00:00:00 2001 From: JennyNou <167806377+JennyNou@users.noreply.github.com> Date: Thu, 19 Jun 2025 11:13:39 -0400 Subject: [PATCH 33/36] Add test to cover no comp insurance scenario --- .../tests/InsuranceNoCompProgressive.ts | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 playwright-tests/tests/InsuranceNoCompProgressive.ts diff --git a/playwright-tests/tests/InsuranceNoCompProgressive.ts b/playwright-tests/tests/InsuranceNoCompProgressive.ts new file mode 100644 index 000000000..f1f30fe87 --- /dev/null +++ b/playwright-tests/tests/InsuranceNoCompProgressive.ts @@ -0,0 +1,89 @@ +//Imports here +import { ITestData } from "@business-logic/types/ITestData" +import { PaymentMethod, AppointmentType, DamageType, PaymentType, PartQuestionType} from "@business-logic/types/Enums"; +import TestCase from "@business-logic/types/TestCase"; +import { VehicleLookupType } from "@business-logic/types/Enums"; +import { getDefaultTestData, setFakerSeedFromTestName } from "@business-logic/constants/DefaultTestData"; + +// Set the seed based on test name for consistent but unique data +setFakerSeedFromTestName("InsuranceNoCompProgressive"); + +// Now get the test data with the seeded faker +const insuranceNoCompProgressiveData: Partial = { + ...getDefaultTestData(), // Get default data with current seed + + // Key feature: Insurance flow with GEICO + paymentMethod: PaymentMethod.Insurance, + + // Insurance claim flags + isDuplicateClaim: true, + isPolicyFound: true, + isUseVehicleOnPolicy: true, + isHeavyTruck: false, + isPolicyDriver: true, + isRecalVehicle: true, + + // Override customer details with specific name and California location + customerDetails: { + ...getDefaultTestData().customerDetails!, + firstName: 'SHERI', + lastName: 'SCHATZ', + address: { + ...getDefaultTestData().customerDetails!.address, + city: 'Slidell', + state: 'Louisiana', + postalCode: '70458' + } + }, + + + // Insurance claim details + claimDetails: { + client: 'Progressive', + policyNumber: 'Mock495646B', + policyDeductible: 1722.20, + policyZip: '70458', + damageDate: new Date(new Date().setDate(new Date().getDate() - 1)).toLocaleDateString('en-US', {month: '2-digit', day: '2-digit', year: 'numeric'}), + damageCause: DamageType.Rock + }, + + // Hyundai vehicle details with VIN lookup + vehicleDetails: { + ...getDefaultTestData().vehicleDetails!, + year: '2015', + make: 'Acura', + model: 'MDX', + style: '4 door utility', + vehicleLookupType: VehicleLookupType.Zip, + }, + + // Part questions related to recalibration + partQuestions: [ + { + partQuestionType: PartQuestionType.GeneralQuestion1, + isOnPage: true, + optionToSelect: 'Yes' + }, + ], + + // Override for in-shop appointment + appointmentDetails: { + serviceLocation: AppointmentType.InShop, + shopAddress: '56705 Garrett Road, Slidell, LA 70458', + appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate + }, + + // Override payment details (empty because we skip payment method page in insurance flow) + paymentDetails: {} +} + +const insuranceNoCompProgressiveTests: TestCase[] = []; + +const tc = new TestCase({ + name: `InsuranceNoCompProgressive`, + tags: ['@E2E','@InsuranceNoCompProgressive', '@test_report', '@Insurance'], + testData: insuranceNoCompProgressiveData +}, undefined, 'InsuranceBigTruckVerified'); +insuranceNoCompProgressiveTests.push(tc); + +export default insuranceNoCompProgressiveTests; \ No newline at end of file From 54a8036a0dd310dc7839270dd16403216475283c Mon Sep 17 00:00:00 2001 From: maguire-arman Date: Thu, 19 Jun 2025 13:01:56 -0400 Subject: [PATCH 34/36] Adds split windshield support and alert test Adds support for split windshield damage selection and validation. Introduces new vehicle damage types and corresponding UI elements on the vehicle damage page. Also, adds a new alert message to handle the scenario where both single-piece and split windshield options are selected. The changes enhance the accuracy of vehicle damage assessment. --- .../business-logic/types/Enums.ts | 3 ++ playwright-tests/pages/VehicleDamagePage.ts | 36 ++++++++++++++++++- .../pages/VehicleSelectionPage.ts | 3 +- .../alert0003_SplitWindshield.ts | 33 +++++++++++------ 4 files changed, 62 insertions(+), 13 deletions(-) diff --git a/playwright-tests/business-logic/types/Enums.ts b/playwright-tests/business-logic/types/Enums.ts index a2d633dab..58595528f 100644 --- a/playwright-tests/business-logic/types/Enums.ts +++ b/playwright-tests/business-logic/types/Enums.ts @@ -31,6 +31,9 @@ export enum VehicleDamage { WindshieldTwoChips = "WINDSHIELD TWO CHIPS", WindshieldThreeChips = "WINDSHIELD THREE CHIPS", WindshieldCrack = "WINDSHIELD", + SingleSplitWindshield = "SINGLE WINDSHIELD", + DriverSplitWindshield = "DRIVER SPLIT WINDSHIELD", + PassengerSplitWindshield = "PASSENGER SPLIT WINDSHIELD", RearWindow = "BACK GLASS", RearSliding = "SLIDER", DriverFrontDoor = "DRIVER FRONT DOOR GLASS", diff --git a/playwright-tests/pages/VehicleDamagePage.ts b/playwright-tests/pages/VehicleDamagePage.ts index da83d63fc..bdb8441a6 100644 --- a/playwright-tests/pages/VehicleDamagePage.ts +++ b/playwright-tests/pages/VehicleDamagePage.ts @@ -26,9 +26,13 @@ export class VehicleDamagePage extends BasePage { readonly rearStationaryBttn: Locator; readonly rearSlidingGlassBttn: Locator; readonly editVehicleLink: Locator; + readonly singleSplitWindshieldChkBox: Locator; + readonly driverSplitWindshieldChkBox: Locator; + readonly passengerSplitWindshieldChkBox: Locator; readonly noReplacementAvailableAlert: Locator; readonly bothReplaceRepairAlert: Locator; + readonly splitWindshieldAlert: Locator; url = process.env['BASE_URL']! + '/fmg/?fmgPage=vehicle-damage'; constructor(page: Page) { @@ -50,8 +54,12 @@ export class VehicleDamagePage extends BasePage { this.passengerVentGlassChkBox = this.page.locator('[aria-labelledby="passengerSideOptions"]').locator('[buttonlabel="Vent glass"]'); this.passengerBackDoorChkBox = this.page.locator('[aria-labelledby="passengerSideOptions"]').locator('[buttonlabel="Back door"]'); this.rearWindowChkBox = this.page.locator('[buttonlabel="Rear window"]'); + this.singleSplitWindshieldChkBox = this.page.locator('[aria-labelledby="WindshieldReplaceOptions"]').locator('[buttonlabel="Single windshield"]'); + this.driverSplitWindshieldChkBox = this.page.locator('[aria-labelledby="WindshieldReplaceOptions"]').locator('[buttonlabel="Split windshield, driver side"]'); + this.passengerSplitWindshieldChkBox = this.page.locator('[aria-labelledby="WindshieldReplaceOptions"]').locator('[buttonlabel="Split windshield, passenger side"]'); this.noReplacementAvailableAlert = this.page.locator('.alert-danger.widget-name-NoReplacementAvailableError'); this.bothReplaceRepairAlert = this.page.locator('div.alert-danger.widget-name-HasReplacementConflict'); + this.splitWindshieldAlert = this.page.locator('.alert-danger.widget-name-SplitSingleConflict'); this.rearStationaryBttn = this.page.locator('label').filter({ hasText: 'Stationary' }); this.rearSlidingGlassBttn = this.page.locator('label').filter({ hasText: 'Glass with slider' }); this.editVehicleLink = this.page.getByRole('link', { name: 'Edit vehicle' }); @@ -76,6 +84,21 @@ export class VehicleDamagePage extends BasePage { await this.windshieldChkBox.check(); await this.selectCrack(); break; + case VehicleDamage.SingleSplitWindshield: + await this.windshieldChkBox.check(); + await this.selectCrack(); + await this.singleSplitWindshieldChkBox.check(); + break; + case VehicleDamage.DriverSplitWindshield: + await this.windshieldChkBox.check(); + await this.selectCrack(); + await this.driverSplitWindshieldChkBox.check(); + break; + case VehicleDamage.PassengerSplitWindshield: + await this.windshieldChkBox.check(); + await this.selectCrack(); + await this.passengerSplitWindshieldChkBox.check(); + break; case VehicleDamage.DriverFrontDoor: await this.sideDoorButton.check(); await this.driverSideButton.check(); @@ -164,10 +187,17 @@ export class VehicleDamagePage extends BasePage { expect(alertMessage).toContain("Service not availableWe're sorry, but we currently offer only repair service for your vehicle type. Need help with next steps? Call us at800-394-0288.") } + async checkForSplitWindshieldAlertMessage(): Promise { + await expect(this.splitWindshieldAlert).toBeVisible(); + const alertMessage = await this.splitWindshieldAlert.textContent(); + console.log(`Alert encountered: ${alertMessage}`); + expect(alertMessage).toContain("Single-piece or split?Please select just one windshield option: single-piece or split.") + } + @step('VehicleDamagePage >> Select Damage') async handleVehicleDamagePage(testData: Partial): Promise { const {vehicleDamage} = testData; - const {isRepairReplace, isRepairOnly} = testData.alertFlags || {}; + const {isRepairReplace, isRepairOnly, isSplitWindshield} = testData.alertFlags || {}; await this.validateProgressBar(ProgressBarPercentages.VehicleDamagePage); await this.selectDamage(vehicleDamage!); @@ -180,6 +210,10 @@ export class VehicleDamagePage extends BasePage { await this.checkForRepairOnlyAlertMessage(); throw new TestSuccessAlert('Both assertions are met successfully.'); } + if (isSplitWindshield) { + await this.checkForSplitWindshieldAlertMessage(); + throw new TestSuccessAlert('Both assertions are met successfully.'); + } await this.nextPage(); } } \ No newline at end of file diff --git a/playwright-tests/pages/VehicleSelectionPage.ts b/playwright-tests/pages/VehicleSelectionPage.ts index c2d638d12..8ab577839 100644 --- a/playwright-tests/pages/VehicleSelectionPage.ts +++ b/playwright-tests/pages/VehicleSelectionPage.ts @@ -61,7 +61,8 @@ export class VehicleSelectionPage extends BasePage { } // Handle alert conditions for vehicle selection - if (isHeavyTruckVehicleAlert || isSplitWindshield) { + if (isHeavyTruckVehicleAlert) { + await this.continueButton.click(); await this.checkForAlertMessages(); throw new TestSuccessAlert('Both assertions are met successfully.'); } diff --git a/playwright-tests/tests/alert-validation/alert0003_SplitWindshield.ts b/playwright-tests/tests/alert-validation/alert0003_SplitWindshield.ts index f01151b05..82022284b 100644 --- a/playwright-tests/tests/alert-validation/alert0003_SplitWindshield.ts +++ b/playwright-tests/tests/alert-validation/alert0003_SplitWindshield.ts @@ -2,7 +2,7 @@ import { ITestData } from "@business-logic/types/ITestData"; import TestCase from "@business-logic/types/TestCase"; import { VehicleDamage } from "@business-logic/types/Enums"; -import { defaultTestData } from "@business-logic/constants/DefaultTestData"; +import { defaultTestData, getDefaultTestData } from "@business-logic/constants/DefaultTestData"; // Windshield selected, when vehicle has split windshield (alert) Test Data const splitWindshieldData: Partial = { @@ -10,11 +10,21 @@ const splitWindshieldData: Partial = { // Override specific fields with test-specific data vehicleDamage: [ - VehicleDamage.WindshieldOneChip + VehicleDamage.SingleSplitWindshield, + VehicleDamage.DriverSplitWindshield, + VehicleDamage.PassengerSplitWindshield ], alertFlags: { isSplitWindshield: true - } + }, + customerDetails: { + ...getDefaultTestData().customerDetails!, + address: { + ...getDefaultTestData().customerDetails!.address, + postalCode: '55414' + } + }, + isHeavyTruck: true, // Flag for heavy truck vehicle }; const vehiclesToTest = [ @@ -35,20 +45,21 @@ const vehiclesToTest = [ make: 'Kenworth', model: 'T600', style: 'conventional cab' - } + }, ]; const splitWindshieldTests: TestCase[] = []; // Generate test cases for each vehicle vehiclesToTest.forEach((vehicle, index) => { - const testData = { - ...splitWindshieldData, - vehicleDetails: { - ...defaultTestData.vehicleDetails!, - ...vehicle - } - }; + +    const testData = { +        ...splitWindshieldData, +        vehicleDetails: { +            ...defaultTestData.vehicleDetails!, +            ...vehicle +        }, +    }; const tc = new TestCase({ name: `alert0003_${vehicle.make.toLowerCase()}_${vehicle.model.toLowerCase()} Windshield selected, when vehicle has split windshield - ${vehicle.make} ${vehicle.model} ${vehicle.year}`, From 89274929cb2f455fb4bd521db60830cf977bf52d Mon Sep 17 00:00:00 2001 From: maguire-arman Date: Mon, 23 Jun 2025 09:59:47 -0400 Subject: [PATCH 35/36] Adds test and support for split windshield replacements Adds a new test case for cash replacements of split windshields. Normalizes "SPLIT WINDSHIELD" types to "WINDSHIELD" in the parts array to ensure correct part validation during order processing. Extends the `vehicleDamage` enum to include `DriverSplitWindshield` and `PassengerSplitWindshield`. --- .../business-logic/types/Enums.ts | 2 + playwright-tests/pages/ServicePackagesPage.ts | 14 +++- playwright-tests/tests/0000__M.test.ts | 14 +++- .../tests/CashReplaceSplitWindshield.ts | 74 +++++++++++++++++++ 4 files changed, 98 insertions(+), 6 deletions(-) create mode 100644 playwright-tests/tests/CashReplaceSplitWindshield.ts diff --git a/playwright-tests/business-logic/types/Enums.ts b/playwright-tests/business-logic/types/Enums.ts index 58595528f..d01c7998b 100644 --- a/playwright-tests/business-logic/types/Enums.ts +++ b/playwright-tests/business-logic/types/Enums.ts @@ -101,6 +101,8 @@ export enum PartQuestionType { RearWindowColor = 'Rear-Stationary', RearSlidingWindowColor = 'Rear-Slider', DriverSideColor = 'Driver-SideDoor', + DriverWindshield = 'Windshield-Driver', + PassengerWindshield = 'Windshield-Passenger', // use generalized tag for other part questions GeneralQuestion1 = 'question-0-1', GeneralQuestion2 = 'question-0-2', diff --git a/playwright-tests/pages/ServicePackagesPage.ts b/playwright-tests/pages/ServicePackagesPage.ts index e670ff31b..779d5f6b8 100644 --- a/playwright-tests/pages/ServicePackagesPage.ts +++ b/playwright-tests/pages/ServicePackagesPage.ts @@ -156,10 +156,20 @@ export class ServicePackagesPage extends BasePage { // Validate the presence of specific parts in the glassParts array const glassParts = vuexState.order?.lineItems?.glassParts; - + + const WINDSHIELD_TYPES = [ +   "SINGLE WINDSHIELD", +   "DRIVER SPLIT WINDSHIELD", +   "PASSENGER SPLIT WINDSHIELD" + ]; + if (glassParts?.length > 0) { for (const partType of vehicleDamage) { - const hasPartType = glassParts.some(glassPart => glassPart.partType === partType); + // Normalize part type to "WINDSHIELD" if it matches any of the defined types (Split Windshield types) +   const normalizedPartType = WINDSHIELD_TYPES.includes(partType) ? "WINDSHIELD" : partType; + + const hasPartType = glassParts.some(glassPart => glassPart.partType === normalizedPartType); + await expect(hasPartType, `Expected part type: ${partType}`).toBe(true); } } else { diff --git a/playwright-tests/tests/0000__M.test.ts b/playwright-tests/tests/0000__M.test.ts index 022e23abb..65e7a6986 100644 --- a/playwright-tests/tests/0000__M.test.ts +++ b/playwright-tests/tests/0000__M.test.ts @@ -35,6 +35,7 @@ import cashReplaceMultiGlassMobileTests from "./CashReplaceMultiGlassMobile"; import cashReplaceSwitchToInsuranceProgressiveNoCompTests from "./CashReplaceSwitchToInsuranceProgressiveNoComp"; import insuranceBigTruckVerifiedTests from "./InsuranceBigTruckVerified"; import insuranceUnverifiedTests from "./InsuranceUnverified"; +import CashReplaceSplitWindshieldTests from "./CashReplaceSplitWindshield"; /** * Master Test Runner @@ -69,11 +70,12 @@ const allStandardTests = [ {name: "CashReplaceVinMobile", tests: cashReplaceVinMobileTests}, {name: "CashReplaceWiperDropoff", tests: cashReplaceWiperDropoffTests}, {name: "CashReplaceWiperPromoInshop", tests: cashReplaceWiperPromoInShopTests}, + {name: "CashReplaceSwitchToInsuranceProgressiveNoComp", tests: cashReplaceSwitchToInsuranceProgressiveNoCompTests}, + {name: "CashReplaceSplitWindshield", tests: CashReplaceSplitWindshieldTests}, {name: "InsuranceAcuityPaypal", tests: insuranceAcuityPaypalTests}, {name: "InsuranceITAC21stCentury", tests: insuranceITAC21stCenturyTests}, {name: "InsuranceNoCompProgressive", tests: insuranceNoCompProgressiveTests}, - {name: "CashReplaceSwitchToInsuranceProgressiveNoComp", tests: cashReplaceSwitchToInsuranceProgressiveNoCompTests}, - {name: "InsuranceBigTruckVerified", tests: insuranceBigTruckVerifiedTests}, + // {name: "InsuranceBigTruckVerified", tests: insuranceBigTruckVerifiedTests}, {name: "InsuranceUnverified", tests: insuranceUnverifiedTests}, // {name: "InsuranceGeico", tests: insuranceGeicoTests}, // {name: "InsuranceITACOptimizedPriceValidationAllState", tests: insuranceITACOptimizedPriceValidationAllStateTests} @@ -170,10 +172,13 @@ async function runWorkflow(page: Page, testCase: TestCase) { } = testCase.testData; // Check if the vehicle damage includes a windshield crack - const hasWindshieldCrack = vehicleDamage!.some(damage => - damage === VehicleDamage.WindshieldCrack + const hasWindshieldCrack = vehicleDamage!.some(damage => + damage === VehicleDamage.WindshieldCrack || + damage === VehicleDamage.DriverSplitWindshield || + damage === VehicleDamage.PassengerSplitWindshield ); + //============================= TEST WORKFLOW STEPS ============================= // Use Environment Variable to decide whether or not we want to skip content site aka home page @@ -276,6 +281,7 @@ async function runWorkflow(page: Page, testCase: TestCase) { // Select service location let serviceLocationPage = testCase.pages.serviceLocationPage; await serviceLocationPage.handleServiceLocationPage(testCase.testData); + // Schedule appointment let schedulePage = testCase.pages.schedulePage; diff --git a/playwright-tests/tests/CashReplaceSplitWindshield.ts b/playwright-tests/tests/CashReplaceSplitWindshield.ts new file mode 100644 index 000000000..6736af4dc --- /dev/null +++ b/playwright-tests/tests/CashReplaceSplitWindshield.ts @@ -0,0 +1,74 @@ +//Imports here +import { ITestData } from "@business-logic/types/ITestData" +import { AppointmentType, PartQuestionType, PaymentType, VehicleDamage } from "@business-logic/types/Enums"; +import TestCase from "@business-logic/types/TestCase"; +import { VehicleLookupType } from "@business-logic/types/Enums"; +import { getDefaultTestData, setFakerSeedFromTestName } from "@business-logic/constants/DefaultTestData"; + +// Set the seed before generating any data +setFakerSeedFromTestName("CashReplaceSplitWindshield.ts"); + +// Now get the test data with the seeded faker +const CashReplaceSplitWindshieldData: Partial = { + ...getDefaultTestData(), // Get default data with current seed + + isHeavyTruck: true, // Flag for big truck + + customerDetails: { + ...getDefaultTestData().customerDetails!, + address: { + ...getDefaultTestData().customerDetails!.address, + postalCode: '55414' + } + }, + + // Override vehicle details + vehicleDetails: { + ...getDefaultTestData().vehicleDetails!, + year: '2006', + make: 'Navistar', + model: '5000 I', + style: '2 door conventional cab', + vehicleLookupType: VehicleLookupType.Zip + }, + + vehiclePartQuestions: [ + { + partQuestionType: PartQuestionType.DriverWindshield, + isOnPage: true, + optionToSelect: 'Green Tint', + secondaryQuestionOptionToSelect: 'driver side, encap, asymmetrically strengthen' + }, + { + partQuestionType: PartQuestionType.PassengerWindshield, + isOnPage: true, + optionToSelect: 'Green Tint', + secondaryQuestionOptionToSelect: 'passenger side, encap, asymmetrically strengthen' + }, + ], + + // Override default vehicle damage (Split Windshield) + vehicleDamage: [VehicleDamage.DriverSplitWindshield, VehicleDamage.PassengerSplitWindshield], + + // Override appointment details + appointmentDetails: { + ...getDefaultTestData().appointmentDetails!, + shopAddress: "504 Malcolm Ave Se, Minneapolis, MN 55414" + }, + + // Override payment details + paymentDetails: { + paymentType: PaymentType.PayAtService + } +} + +const CashReplaceSplitWindshieldTests: TestCase[] = []; + +const tc = new TestCase({ + name: `CashReplaceSplitWindshield`, + tags: ['@E2E','@CashReplaceSplitWindshield', '@test_report', '@CASH'], + testData: CashReplaceSplitWindshieldData +}, undefined, 'CashReplaceSplitWindshield'); +CashReplaceSplitWindshieldTests.push(tc); + +export default CashReplaceSplitWindshieldTests; \ No newline at end of file From eb9a5bffe28c2698824fa68098c2f9be1ef6fc06 Mon Sep 17 00:00:00 2001 From: maguire-arman Date: Mon, 23 Jun 2025 10:02:48 -0400 Subject: [PATCH 36/36] Temporarily disables heavy truck tests Disables heavy truck and split windshield tests in both standard and alert test suites. These tests are commented out due to ongoing QA processes and will be re-enabled once ready. --- playwright-tests/tests/0000__M.test.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/playwright-tests/tests/0000__M.test.ts b/playwright-tests/tests/0000__M.test.ts index 65e7a6986..5ccd08ed0 100644 --- a/playwright-tests/tests/0000__M.test.ts +++ b/playwright-tests/tests/0000__M.test.ts @@ -71,7 +71,8 @@ const allStandardTests = [ {name: "CashReplaceWiperDropoff", tests: cashReplaceWiperDropoffTests}, {name: "CashReplaceWiperPromoInshop", tests: cashReplaceWiperPromoInShopTests}, {name: "CashReplaceSwitchToInsuranceProgressiveNoComp", tests: cashReplaceSwitchToInsuranceProgressiveNoCompTests}, - {name: "CashReplaceSplitWindshield", tests: CashReplaceSplitWindshieldTests}, + // TODO: Uncomment when QA is ready to run heavy truck tests + // {name: "CashReplaceSplitWindshield", tests: CashReplaceSplitWindshieldTests}, {name: "InsuranceAcuityPaypal", tests: insuranceAcuityPaypalTests}, {name: "InsuranceITAC21stCentury", tests: insuranceITAC21stCenturyTests}, {name: "InsuranceNoCompProgressive", tests: insuranceNoCompProgressiveTests}, @@ -84,9 +85,10 @@ const allStandardTests = [ // Alert validation scenarios const allAlertTests = [ - { name: "Alert Scenario 1: Heavy Truck", tests: heavyTruckTests }, + //TODO: Uncomment when QA is ready to run heavy truck tests + // { name: "Alert Scenario 1: Heavy Truck", tests: heavyTruckTests }, { name: "Alert Scenario 2: Repair and Replace", tests: repairAndReplaceTests }, - { name: "Alert Scenario 3: Split Windshield", tests: splitWindshieldTests }, + // { name: "Alert Scenario 3: Split Windshield", tests: splitWindshieldTests }, { name: "Alert Scenario 4: Repair Only", tests: repairOnlyTests }, { name: "Alert Scenario 5: Unserviceable Zip", tests: unserviceableZipTests }, { name: "Alert Scenario 6: Invalid Zip", tests: invalidZipTests }, @@ -281,7 +283,7 @@ async function runWorkflow(page: Page, testCase: TestCase) { // Select service location let serviceLocationPage = testCase.pages.serviceLocationPage; await serviceLocationPage.handleServiceLocationPage(testCase.testData); - + // Schedule appointment let schedulePage = testCase.pages.schedulePage;