From 368267d123c928cb6314eb0cb97699181b4a3f7f Mon Sep 17 00:00:00 2001 From: JennyNou Date: Mon, 11 May 2026 15:29:52 -0400 Subject: [PATCH 1/8] Add 2.0 policy info page --- playwright-tests/framework/TestPages.ts | 3 +++ playwright-tests/pages/PolicyInfoPage.ts | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 playwright-tests/pages/PolicyInfoPage.ts diff --git a/playwright-tests/framework/TestPages.ts b/playwright-tests/framework/TestPages.ts index bc98e44b5..54078e266 100644 --- a/playwright-tests/framework/TestPages.ts +++ b/playwright-tests/framework/TestPages.ts @@ -33,6 +33,7 @@ import { EndorsementsPage } from "../pages/EndorsementsPage" import { PolicyDriverPage } from "../pages/PolicyDriverPage" import { ServiceZipPage } from "../pages/ServiceZipPage" import { MobileDetailsPage } from "pages/MobileDetailsPage"; +import { PolicyInfoPage } from "../pages/PolicyInfoPage"; export interface ITestPages { capabilityQuestionsPage: CapabilityQuestionsPage, @@ -49,6 +50,7 @@ export interface ITestPages { orderConfirmationPage: OrderConfirmationPage, partQuestionsPage: PartQuestionsPage, paymentMethodPage: PaymentMethodPage, + policyInfoPage: PolicyInfoPage, policyInfoSubmittedPage: PolicyInfoSubmittedPage, policyVehiclesPage: PolicyVehiclesPage, heritageProblemGlassQuestionsPage: HeritageProblemGlassQuestionsPage, @@ -86,6 +88,7 @@ export const createTestPages: TestPagesFactory = (page: Page) => { orderConfirmationPage: new OrderConfirmationPage(page), partQuestionsPage: new PartQuestionsPage(page), paymentMethodPage: new PaymentMethodPage(page), + policyInfoPage: new PolicyInfoPage(page), policyInfoSubmittedPage: new PolicyInfoSubmittedPage(page), policyVehiclesPage: new PolicyVehiclesPage(page), heritageProblemGlassQuestionsPage: new HeritageProblemGlassQuestionsPage(page), diff --git a/playwright-tests/pages/PolicyInfoPage.ts b/playwright-tests/pages/PolicyInfoPage.ts new file mode 100644 index 000000000..22b6c07e7 --- /dev/null +++ b/playwright-tests/pages/PolicyInfoPage.ts @@ -0,0 +1,17 @@ +import { type Page } from '@playwright/test'; +import { BasePage } from './BasePage'; +import { step } from 'framework/localTypes/Step'; +import { ITestData } from 'framework/TestData'; + +export class PolicyInfoPage extends BasePage { + constructor(page: Page) { + super(page); + + // TODO: Add locators for the page once the card is in test (CASH-2468) + } + + @step("PolicyInfoPage >> Continue") + async handlePolicyInfoPage(testData: Partial): Promise { + await this.nextPage(); + } +} From 0e32aa0f11cf165d78ac50db753b48185a57a1ca Mon Sep 17 00:00:00 2001 From: JennyNou Date: Mon, 11 May 2026 17:12:58 -0400 Subject: [PATCH 2/8] Add Liberty Mutual test --- playwright-tests/framework/TestData.ts | 1 + playwright-tests/pages/PolicyInfoPage.ts | 5 +- playwright-tests/tests/0000__M.test.ts | 10 ++++ .../tests/InsuranceLibertyMutual.ts | 54 +++++++++++++++++++ 4 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 playwright-tests/tests/InsuranceLibertyMutual.ts diff --git a/playwright-tests/framework/TestData.ts b/playwright-tests/framework/TestData.ts index 332e3dc26..0fe04a1f9 100644 --- a/playwright-tests/framework/TestData.ts +++ b/playwright-tests/framework/TestData.ts @@ -15,6 +15,7 @@ export interface ITestData extends base { isMSRZip?: boolean, isPIAEnabled?: boolean, isDualRecal?: boolean, + isPolicyInfoPage?: boolean, } diff --git a/playwright-tests/pages/PolicyInfoPage.ts b/playwright-tests/pages/PolicyInfoPage.ts index 22b6c07e7..7974e3099 100644 --- a/playwright-tests/pages/PolicyInfoPage.ts +++ b/playwright-tests/pages/PolicyInfoPage.ts @@ -1,4 +1,4 @@ -import { type Page } from '@playwright/test'; +import { expect, type Page } from '@playwright/test'; import { BasePage } from './BasePage'; import { step } from 'framework/localTypes/Step'; import { ITestData } from 'framework/TestData'; @@ -12,6 +12,7 @@ export class PolicyInfoPage extends BasePage { @step("PolicyInfoPage >> Continue") async handlePolicyInfoPage(testData: Partial): Promise { - await this.nextPage(); + + await expect(this.page).toHaveURL(/\/fmg\/policy-info/); } } diff --git a/playwright-tests/tests/0000__M.test.ts b/playwright-tests/tests/0000__M.test.ts index 79cfc89f8..9eed669b4 100644 --- a/playwright-tests/tests/0000__M.test.ts +++ b/playwright-tests/tests/0000__M.test.ts @@ -44,6 +44,7 @@ import insuranceBigTruckVerifiedTests from "./InsuranceBigTruckVerified"; import insuranceUnverifiedTests from "./InsuranceUnverified"; import CashReplaceSplitWindshieldTests from "./CashReplaceSplitWindshield"; import insuranceMeemicNearSchoolVerifiedTests from "./InsuranceMeemicNearSchoolVerified"; +import insuranceLibertyMutualTests from "./InsuranceLibertyMutual"; import cashReplaceDualMobileMSRTests from "./CashReplaceDualMobileMSR"; import cashReplaceDualNonMSRInshopTests from "./CashReplaceDualNonMSRInshop"; @@ -101,6 +102,7 @@ const allStandardTests = [ // {name: "InsuranceGeico", tests: insuranceGeicoTests}, // {name: "InsuranceITACOptimizedPriceValidationAllState", tests: insuranceITACOptimizedPriceValidationAllStateTests} { name: "InsuranceMeemicNearSchoolVerified", tests: insuranceMeemicNearSchoolVerifiedTests }, + { name: "InsuranceLibertyMutual", tests: insuranceLibertyMutualTests }, ]; @@ -308,6 +310,7 @@ async function runWorkflow(page: Page, testCase: TestCase) { // Insurance flow - if user selected Insurance as Payment Method if (paymentMethod == PaymentMethod.Insurance) { await handleInsuranceFlow(testCase); + if (testCase.testData.isPolicyInfoPage) return; // If Liberty Mutual and on PolicyInfoPage, skip the rest of the flow until the page is built out } //============================= SERVICE SCHEDULING ============================= @@ -364,6 +367,13 @@ async function handleInsuranceFlow(testCase: TestCase) { await HeritageProblemGlassQuestionsPage.handleHeritageProblemGlassQuestionsPage(testCase.testData); } + // Liberty Mutual route directly to PolicyInfoPage instead of CCPolicyInfoPage + if (testCase.testData.isPolicyInfoPage) { + let policyInfoPage = testCase.pages.policyInfoPage; + await policyInfoPage.handlePolicyInfoPage(testCase.testData); + return; + } + // Handle ccPolicyInfoPage let ccPolicyInfoPage = testCase.pages.ccPolicyInfoPage; await ccPolicyInfoPage.handleCCPolicyInfoPage(testCase.testData); diff --git a/playwright-tests/tests/InsuranceLibertyMutual.ts b/playwright-tests/tests/InsuranceLibertyMutual.ts new file mode 100644 index 000000000..0c89d6084 --- /dev/null +++ b/playwright-tests/tests/InsuranceLibertyMutual.ts @@ -0,0 +1,54 @@ +import { ITestData, getDefaultExperimentsData } from 'framework/TestData' +import { DamageType, VehicleLookupType, VehicleDamage } from 'safelite-playwright-core'; +import { PaymentMethod } from "framework/localTypes/Enums"; +import { ITestCase } from '../framework/Typedefs' +import { getDefaultTestData, setFakerSeedFromTestName } from 'safelite-playwright-core'; + +setFakerSeedFromTestName("InsuranceLibertyMutual"); + +const insuranceLibertyMutualData: Partial = { + ...getDefaultTestData(), + + paymentMethod: PaymentMethod.Insurance, + isPolicyInfoPage: true, + + claimDetails: { + client: 'Liberty Mutual Insurance', + policyNumber: 'Mock123456LM', + 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.Hail + }, + + // Vehicle details for truck with ZIP lookup + vehicleDetails: { + ...getDefaultTestData().vehicleDetails!, + year: '2015', + make: 'Toyota', + model: 'Tacoma Pickup', + style: '4 door crew cab', + vehicleLookupType: VehicleLookupType.Zip, + }, + + // Driver door damage instead of windshield + vehicleDamage: [ + VehicleDamage.DriverFrontDoor, + ], + + paymentDetails: {}, + + experiments: { + ...getDefaultExperimentsData() + } +}; + +const insuranceLibertyMutualTests: ITestCase[] = []; + +const tc = { + name: `InsuranceLibertyMutual`, + tags: ['@E2E', '@InsuranceLibertyMutual', '@test_report', '@Insurance'], + testData: insuranceLibertyMutualData +}; +insuranceLibertyMutualTests.push(tc); + +export default insuranceLibertyMutualTests; From 73dd248f0c1e05cd7641bd60afc9bc087d1e37c8 Mon Sep 17 00:00:00 2001 From: JennyNou Date: Thu, 14 May 2026 17:21:13 -0400 Subject: [PATCH 3/8] Add unverified big truck with labor2 fee test --- playwright-tests/pages/SchedulePage.ts | 8 +- .../InsuranceAllstateBigTruckUnverified.ts | 74 +++++++++++++++++++ 2 files changed, 78 insertions(+), 4 deletions(-) create mode 100644 playwright-tests/tests/InsuranceAllstateBigTruckUnverified.ts diff --git a/playwright-tests/pages/SchedulePage.ts b/playwright-tests/pages/SchedulePage.ts index 8d863e94f..03106fa00 100644 --- a/playwright-tests/pages/SchedulePage.ts +++ b/playwright-tests/pages/SchedulePage.ts @@ -261,11 +261,11 @@ export class SchedulePage extends BasePage { await this.waitForPageOrComponentload(); await this.validateProgressBar(ProgressBarPercentages.SchedulePage); - //Looks like an issue with the insurance flow - remove comments once fixed - /*if (testData.isHeavyTruck) { + //Labor2 fee will show for cash orders and some insurance orders but USAA will not show it + if (testData.isHeavyTruck && testData.claimDetails?.client !== 'USAA') { const vuexState = JSON.parse(await this.page.evaluate('localStorage.getItem(\'vuex\')')); - expect(vuexState.order.lineItems.supportingItems.find((item: any) => item && item.partNumber == "labor2")).toBeTruthy(); - }*/ + expect(vuexState.order.lineItems.supportingItems[0].partNumber).toBe("LABOR2"); + } if (handleMobileFirstModal) { return await this.handleMobileFirstPopUp(testData); diff --git a/playwright-tests/tests/InsuranceAllstateBigTruckUnverified.ts b/playwright-tests/tests/InsuranceAllstateBigTruckUnverified.ts new file mode 100644 index 000000000..ef374411d --- /dev/null +++ b/playwright-tests/tests/InsuranceAllstateBigTruckUnverified.ts @@ -0,0 +1,74 @@ +import { ITestData, getDefaultExperimentsData } from 'framework/TestData' +import { ServiceLocation, DamageType } from 'safelite-playwright-core'; +import { ITestCase } from '../framework/Typedefs' +import { PaymentMethod } from "framework/localTypes/Enums"; +import { VehicleLookupType } from 'safelite-playwright-core'; +import { getDefaultTestData, setFakerSeedFromTestName } from 'safelite-playwright-core'; + +setFakerSeedFromTestName("InsuranceAllstateBigTruckUnverified"); + +const insuranceAllstateBigTruckUnverifiedData: Partial = { + ...getDefaultTestData(), + + paymentMethod: PaymentMethod.Insurance, + + isPolicyFound: false, + isPolicyUnverified: true, + isHeavyTruck: true, + isCanNotRecal: true, + + customerDetails: { + ...getDefaultTestData().customerDetails!, + firstName: 'Big', + lastName: 'Truck', + address: { + ...getDefaultTestData().customerDetails!.address, + city: 'Dayton', + state: 'Ohio', + postalCode: '45424' + } + }, + + claimDetails: { + client: 'Allstate', + policyNumber: 'MockUnverifiedBigTruck', + policyDeductible: "Unverified", + policyZip: '45424', + damageDate: new Date(new Date().setDate(new Date().getDate() - 1)) + .toLocaleDateString('en-US', { month: '2-digit', day: '2-digit', year: 'numeric' }), + damageCause: DamageType.Rock + }, + + vehicleDetails: { + ...getDefaultTestData().vehicleDetails!, + year: '2025', + make: 'Peterbilt', + model: '579', + style: 'conventional cab', + vin: '1XPBDP9X6SD693446', + vehicleLookupType: VehicleLookupType.Zip, + }, + + appointmentDetails: { + serviceLocation: ServiceLocation.InShop, + shopAddress: '5719 Brandt Pike, Dayton, OH 45424', + appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate + }, + + paymentDetails: {}, + + experiments: { + ...getDefaultExperimentsData() + } +} + +const insuranceAllstateBigTruckUnverifiedTests: ITestCase[] = []; + +const tc = { + name: `InsuranceAllstateBigTruckUnverified`, + tags: ['@E2E', '@InsuranceAllstateBigTruckUnverified', '@test_report', '@Insurance'], + testData: insuranceAllstateBigTruckUnverifiedData +}; +insuranceAllstateBigTruckUnverifiedTests.push(tc); + +export default insuranceAllstateBigTruckUnverifiedTests; From 27aaf2f186b29d07ecfeea9ea0892aa128aca2fc Mon Sep 17 00:00:00 2001 From: JennyNou Date: Thu, 14 May 2026 17:23:14 -0400 Subject: [PATCH 4/8] Enable unverified big truck and parts bailout tests --- playwright-tests/tests/0000__M.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/playwright-tests/tests/0000__M.test.ts b/playwright-tests/tests/0000__M.test.ts index 6ef799455..eef0709fe 100644 --- a/playwright-tests/tests/0000__M.test.ts +++ b/playwright-tests/tests/0000__M.test.ts @@ -41,6 +41,7 @@ import { getTestObject, TestCase, prepareTest, RuleEngine, TestInfo } from 'fram import { createTestPages } from "framework/TestPages"; import cashReplaceSwitchToInsuranceProgressiveNoCompTests from "./CashReplaceSwitchToInsuranceProgressiveNoComp"; import insuranceUSAABigTruckVerifiedTests from "./InsuranceUSAABigTruckVerified"; +import insuranceAllstateBigTruckUnverifiedTests from "./InsuranceAllstateBigTruckUnverified"; import partsNotFoundBailoutTests from "./PartsNotFoundBailout"; import insuranceUnverifiedTests from "./InsuranceUnverified"; import CashReplaceSplitWindshieldTests from "./CashReplaceSplitWindshield"; @@ -98,14 +99,15 @@ const allStandardTests = [ { name: "InsuranceITAC21stCentury", tests: insuranceITAC21stCenturyTests }, { name: "InsuranceNoCompProgressive", tests: insuranceNoCompProgressiveTests }, {name: "InsuranceUSAABigTruckVerified", tests: insuranceUSAABigTruckVerifiedTests}, + { name: "InsuranceAllstateBigTruckUnverified", tests: insuranceAllstateBigTruckUnverifiedTests }, { name: "InsuranceOEMAllstate", tests: insuranceOEMAllstateTests }, { name: "InsuranceUnverified", tests: insuranceUnverifiedTests }, // {name: "InsuranceGeico", tests: insuranceGeicoTests}, // {name: "InsuranceITACOptimizedPriceValidationAllState", tests: insuranceITACOptimizedPriceValidationAllStateTests} { name: "InsuranceMeemicNearSchoolVerified", tests: insuranceMeemicNearSchoolVerifiedTests }, - { name: "InsuranceLibertyMutual", tests: insuranceLibertyMutualTests }, + //{ name: "InsuranceLibertyMutual", tests: insuranceLibertyMutualTests }, // uncomment when new C&C pages are built out for this entire flow - // { name: "PartsNotFoundBailout", tests: partsNotFoundBailoutTests }, // code is not available in QA + { name: "PartsNotFoundBailout", tests: partsNotFoundBailoutTests } ]; // Alert validation scenarios From de4554c31a948f4623d64555e1ca6e31eccd7318 Mon Sep 17 00:00:00 2001 From: JennyNou Date: Thu, 14 May 2026 18:05:19 -0400 Subject: [PATCH 5/8] Add big truck test for cash scenario --- playwright-tests/pages/SchedulePage.ts | 4 +- playwright-tests/tests/0000__M.test.ts | 2 + playwright-tests/tests/CashBigTruck.ts | 64 ++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 playwright-tests/tests/CashBigTruck.ts diff --git a/playwright-tests/pages/SchedulePage.ts b/playwright-tests/pages/SchedulePage.ts index 03106fa00..9ba237a8e 100644 --- a/playwright-tests/pages/SchedulePage.ts +++ b/playwright-tests/pages/SchedulePage.ts @@ -3,7 +3,7 @@ import { BasePage } from './BasePage'; import { IAppointmentDetails, ServiceLocation } from 'safelite-playwright-core'; import { formatDate, formatTime } from 'safelite-playwright-core'; import { AppointmentTimeslot } from 'safelite-playwright-core'; -import { ProgressBarPercentages } from 'framework/localTypes/Enums'; +import { ProgressBarPercentages, PaymentMethod } from 'framework/localTypes/Enums'; import { time } from 'console'; import { step } from 'framework/localTypes/Step'; import { ITestData } from 'framework/TestData'; @@ -262,7 +262,7 @@ export class SchedulePage extends BasePage { await this.validateProgressBar(ProgressBarPercentages.SchedulePage); //Labor2 fee will show for cash orders and some insurance orders but USAA will not show it - if (testData.isHeavyTruck && testData.claimDetails?.client !== 'USAA') { + if (testData.isHeavyTruck && (testData.paymentMethod !== PaymentMethod.Insurance || testData.claimDetails?.client !== 'USAA')) { const vuexState = JSON.parse(await this.page.evaluate('localStorage.getItem(\'vuex\')')); expect(vuexState.order.lineItems.supportingItems[0].partNumber).toBe("LABOR2"); } diff --git a/playwright-tests/tests/0000__M.test.ts b/playwright-tests/tests/0000__M.test.ts index eef0709fe..58d5cc675 100644 --- a/playwright-tests/tests/0000__M.test.ts +++ b/playwright-tests/tests/0000__M.test.ts @@ -49,6 +49,7 @@ import insuranceMeemicNearSchoolVerifiedTests from "./InsuranceMeemicNearSchoolV import insuranceLibertyMutualTests from "./InsuranceLibertyMutual"; import cashReplaceDualMobileMSRTests from "./CashReplaceDualMobileMSR"; import cashReplaceDualNonMSRInshopTests from "./CashReplaceDualNonMSRInshop"; +import cashBigTruckTests from "./CashBigTruck"; const test = getTestObject(); @@ -86,6 +87,7 @@ const allStandardTests = [ { name: "CashReplaceVinMobile", tests: cashReplaceVinMobileTests }, { name: "CashReplaceWiperDropoff", tests: cashReplaceWiperDropoffTests }, { name: "CashReplaceStaticInshop", tests: cashReplaceStaticInshopTests }, + { name: "CashBigTruck", tests: cashBigTruckTests }, { name: "CashReplaceDualMobileMSR", tests: cashReplaceDualMobileMSRTests }, { name: "CashReplaceDualNonMSRInshop", tests: cashReplaceDualNonMSRInshopTests }, { name: "CashReplaceStaticMobileMSR", tests: cashReplaceStaticMobileMSRTests }, diff --git a/playwright-tests/tests/CashBigTruck.ts b/playwright-tests/tests/CashBigTruck.ts new file mode 100644 index 000000000..47daffe86 --- /dev/null +++ b/playwright-tests/tests/CashBigTruck.ts @@ -0,0 +1,64 @@ +import { ITestData, getDefaultExperimentsData } from 'framework/TestData' +import { ServiceLocation, PaymentType } from 'safelite-playwright-core'; +import { ITestCase } from '../framework/Typedefs' +import { PaymentMethod } from "framework/localTypes/Enums"; +import { VehicleLookupType } from 'safelite-playwright-core'; +import { getDefaultTestData, setFakerSeedFromTestName } from 'safelite-playwright-core'; + +setFakerSeedFromTestName("CashBigTruckInshop"); + +const cashBigTruckData: Partial = { + ...getDefaultTestData(), + + paymentMethod: PaymentMethod.SelfPay, + + isHeavyTruck: true, + isCanNotRecal: true, + + customerDetails: { + ...getDefaultTestData().customerDetails!, + firstName: 'Big', + lastName: 'Truck', + address: { + ...getDefaultTestData().customerDetails!.address, + city: 'Urbancrest', + state: 'Ohio', + postalCode: '43123' + } + }, + + vehicleDetails: { + ...getDefaultTestData().vehicleDetails!, + year: '2025', + make: 'Peterbilt', + model: '579', + style: 'conventional cab', + vin: '1XPBDP9X6SD693446', + vehicleLookupType: VehicleLookupType.Vin, + }, + + appointmentDetails: { + serviceLocation: ServiceLocation.InShop, + shopAddress: '3455 Centerpoint Dr, Urbancrest, OH 43123', + appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate + }, + + paymentDetails: { + paymentType: PaymentType.PayAtService + }, + + experiments: { + ...getDefaultExperimentsData() + } +} + +const cashBigTruckTests: ITestCase[] = []; + +const tc = { + name: `CashBigTruck`, + tags: ['@E2E', '@CashBigTruck', '@test_report', '@CASH'], + testData: cashBigTruckData +}; +cashBigTruckTests.push(tc); + +export default cashBigTruckTests; From b0b96787b525807737b64aa4037bb1182bb47a28 Mon Sep 17 00:00:00 2001 From: JennyNou Date: Thu, 21 May 2026 14:21:49 -0400 Subject: [PATCH 6/8] Fix naming and test for new policy info page --- playwright-tests/framework/TestData.ts | 2 +- playwright-tests/pages/PolicyInfoPage.ts | 2 ++ playwright-tests/tests/0000__M.test.ts | 5 ++--- playwright-tests/tests/InsuranceLibertyMutual.ts | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/playwright-tests/framework/TestData.ts b/playwright-tests/framework/TestData.ts index 0fe04a1f9..8100fdf09 100644 --- a/playwright-tests/framework/TestData.ts +++ b/playwright-tests/framework/TestData.ts @@ -15,7 +15,7 @@ export interface ITestData extends base { isMSRZip?: boolean, isPIAEnabled?: boolean, isDualRecal?: boolean, - isPolicyInfoPage?: boolean, + isNewInsuranceFlow?: boolean, } diff --git a/playwright-tests/pages/PolicyInfoPage.ts b/playwright-tests/pages/PolicyInfoPage.ts index 7974e3099..04f35c346 100644 --- a/playwright-tests/pages/PolicyInfoPage.ts +++ b/playwright-tests/pages/PolicyInfoPage.ts @@ -1,6 +1,7 @@ import { expect, type Page } from '@playwright/test'; import { BasePage } from './BasePage'; import { step } from 'framework/localTypes/Step'; +import { TestSuccessAlert } from 'safelite-playwright-core'; import { ITestData } from 'framework/TestData'; export class PolicyInfoPage extends BasePage { @@ -14,5 +15,6 @@ export class PolicyInfoPage extends BasePage { async handlePolicyInfoPage(testData: Partial): Promise { await expect(this.page).toHaveURL(/\/fmg\/policy-info/); + throw new TestSuccessAlert('Policy info page validated successfully.'); } } diff --git a/playwright-tests/tests/0000__M.test.ts b/playwright-tests/tests/0000__M.test.ts index 58d5cc675..88e4101f5 100644 --- a/playwright-tests/tests/0000__M.test.ts +++ b/playwright-tests/tests/0000__M.test.ts @@ -324,7 +324,6 @@ async function runWorkflow(page: Page, testCase: TestCase) { // Insurance flow - if user selected Insurance as Payment Method if (paymentMethod == PaymentMethod.Insurance) { await handleInsuranceFlow(testCase); - if (testCase.testData.isPolicyInfoPage) return; // If Liberty Mutual and on PolicyInfoPage, skip the rest of the flow until the page is built out } //============================= SERVICE SCHEDULING ============================= @@ -365,7 +364,7 @@ async function runWorkflow(page: Page, testCase: TestCase) { } async function handleInsuranceFlow(testCase: TestCase) { - const { isPolicyFound, isPolicyDriver, endorsements, isRecalVehicle, isCashInsuranceFlow, isForcedOEM, flow } = testCase.testData; + const { isPolicyFound, isPolicyDriver, endorsements, isRecalVehicle, isCashInsuranceFlow, isForcedOEM, flow, isNewInsuranceFlow } = testCase.testData; // Check if the insurance policy has endorsements const hasEndorsements = endorsements && endorsements.length > 0; @@ -382,7 +381,7 @@ async function handleInsuranceFlow(testCase: TestCase) { } // Liberty Mutual route directly to PolicyInfoPage instead of CCPolicyInfoPage - if (testCase.testData.isPolicyInfoPage) { + if (isNewInsuranceFlow) { let policyInfoPage = testCase.pages.policyInfoPage; await policyInfoPage.handlePolicyInfoPage(testCase.testData); return; diff --git a/playwright-tests/tests/InsuranceLibertyMutual.ts b/playwright-tests/tests/InsuranceLibertyMutual.ts index 0c89d6084..9edff185f 100644 --- a/playwright-tests/tests/InsuranceLibertyMutual.ts +++ b/playwright-tests/tests/InsuranceLibertyMutual.ts @@ -10,7 +10,7 @@ const insuranceLibertyMutualData: Partial = { ...getDefaultTestData(), paymentMethod: PaymentMethod.Insurance, - isPolicyInfoPage: true, + isNewInsuranceFlow: true, claimDetails: { client: 'Liberty Mutual Insurance', From 465e6b5968ffd334fee17f62f3e6a2c273f75e45 Mon Sep 17 00:00:00 2001 From: credelinghuys Date: Mon, 6 Jul 2026 12:57:41 -0400 Subject: [PATCH 7/8] CASH-2861: Pre select single damage option --- .../damage-location-question.spec.js | 49 ++++++++++++++++++- .../damage-location-question.vue | 6 +++ 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/src/layouts/vehicle-damage/damage-location-question/damage-location-question.spec.js b/src/layouts/vehicle-damage/damage-location-question/damage-location-question.spec.js index fe0827be8..689231780 100644 --- a/src/layouts/vehicle-damage/damage-location-question/damage-location-question.spec.js +++ b/src/layouts/vehicle-damage/damage-location-question/damage-location-question.spec.js @@ -24,6 +24,31 @@ describe("damage-location-question.vue", () => { expect(wrapper.emitted()["update:modelValue"][0]).toEqual([{ modelValue: ["Backseat"] }]); }); + test("when only one damage location is available, auto-selects it", async () => { + const { wrapper, damageOptions } = setupMocks({ + modelValueProp: [], + dataFromStoreApi: { + driverSideOptions: { + availableReplacementOptions: [], + }, + passengerSideOptions: { + availableReplacementOptions: [], + }, + windshieldOptions: { + availableReplacementOptions: ["Single"], + }, + backGlassOptions: { + availableReplacementOptions: [], + }, + }, + }); + + damageLocationQuestion.methods.initializeComponent.call(wrapper.vm, damageOptions); + await wrapper.vm.$nextTick(); + + expect(wrapper.emitted("update:modelValue")[0][0]).toEqual(["Windshield"]); + }); + test("Answers to display filtered by data from api.", async () => { //Arrange const { wrapper, cmsContent, damageOptions } = setupMocks({ @@ -31,6 +56,9 @@ describe("damage-location-question.vue", () => { driverSideOptions: { availableReplacementOptions: ["Quarter", "Front"], }, + passengerSideOptions: { + availableReplacementOptions: [], + }, windshieldOptions: { availableReplacementOptions: ["Single"], }, @@ -51,6 +79,7 @@ describe("damage-location-question.vue", () => { expect(wrapper.vm.damageOptions).toStrictEqual({ backGlassOptions: { availableReplacementOptions: [] }, driverSideOptions: { availableReplacementOptions: ["Quarter", "Front"] }, + passengerSideOptions: { availableReplacementOptions: [] }, windshieldOptions: { availableReplacementOptions: ["Single"] }, }); }); @@ -79,7 +108,15 @@ function setupMocks({ //Mock props const mockMixin = { methods: { - getCmsContent: jest.fn(), + getCmsContent: jest.fn((widget, key) => { + if (key === "Answers") { + return cmsAnswers; + } + if (key === "QuestionText") { + return cmsQuestionText; + } + return ""; + }), }, }; mountOptions.propsData = { @@ -87,6 +124,16 @@ function setupMocks({ isMultiSelect: isMultiSelect, }; mountOptions.mixins = [mockMixin]; + mountOptions.data = function () { + return { + damageOptions: { + driverSideOptions: { availableReplacementOptions: [] }, + passengerSideOptions: { availableReplacementOptions: [] }, + windshieldOptions: { availableReplacementOptions: [] }, + backGlassOptions: { availableReplacementOptions: [] }, + }, + }; + }; const wrapper = shallowMount(damageLocationQuestion, mountOptions); diff --git a/src/layouts/vehicle-damage/damage-location-question/damage-location-question.vue b/src/layouts/vehicle-damage/damage-location-question/damage-location-question.vue index 1f20a8006..6fedf581b 100644 --- a/src/layouts/vehicle-damage/damage-location-question/damage-location-question.vue +++ b/src/layouts/vehicle-damage/damage-location-question/damage-location-question.vue @@ -37,6 +37,12 @@ export default { methods: { initializeComponent(damageOptions) { this.damageOptions = damageOptions; + this.autoSelectSingleAnswer(); + }, + autoSelectSingleAnswer() { + if (this.answersToDisplay.length === 1) { + this.selectedValues = [this.answersToDisplay[0].Name]; + } }, }, computed: { From 06880203e8701f9ba63c8657577ee5f0b35a1fc7 Mon Sep 17 00:00:00 2001 From: Carl Nation Date: Thu, 9 Jul 2026 14:56:31 -0400 Subject: [PATCH 8/8] CASH-3022 save/load phone extension for C&C CASH-3022 save/load phone extension for C&C --- src/layouts/policy-info/policy-info.vue | 10 +++++----- src/store/index.js | 13 +++++++------ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/layouts/policy-info/policy-info.vue b/src/layouts/policy-info/policy-info.vue index 57b9b4e5e..d35292bb1 100644 --- a/src/layouts/policy-info/policy-info.vue +++ b/src/layouts/policy-info/policy-info.vue @@ -511,13 +511,13 @@ export default { return store.getters.order.policy.policyNumber; }, getPolicyZipFromStore() { - return store.getters.order.policy.zipCode; + return store.getters.order.customer.address.zipCode; }, getPhoneNumberFromStore() { - return store.getters.order.policy.phoneNumber; + return store.getters.order.customer.phoneNumber; }, getPhoneExtensionFromStore() { - return store.getters.order.policy.phoneExtension; + return store.getters.order.customer.phoneExtension; }, getDateOfLossFromStore() { return store.getters.order.damage.dateOfLoss; @@ -539,10 +539,10 @@ export default { return match ?? value; }, getPolicyStateFromStore() { - return store.getters.order.policy.state; + return store.getters.order.customer.address.state; }, getCityFromStore() { - return store.getters.order.policy.city; + return store.getters.order.customer.address.city; }, getDateOfBirthFromStore() { return store.getters.order.policy.dateOfBirth; diff --git a/src/store/index.js b/src/store/index.js index 2fff59ee3..acf7b8346 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -112,6 +112,7 @@ const getDefaultState = () => { lastName: null, emailAddress: null, phoneNumber: null, + phoneExtension: null, isSmsOptIn: null, waitListRequested: null, address: { @@ -184,8 +185,6 @@ const getDefaultState = () => { additionalAuthFlag: null, isNoComp: false, insuranceCompanyName: null, - phoneNumber: null, - phoneExtension: null, dateOfBirth: null, lossTime: null, lossLocation: null, @@ -358,10 +357,10 @@ export const mutations = { state.order.policy.insuranceCompanyName = accountName; }, updatePhoneNumber(state, phoneNumber) { - state.order.policy.phoneNumber = phoneNumber; + state.order.customer.phoneNumber = phoneNumber; }, updatePhoneExtension(state, phoneExtension) { - state.order.policy.phoneExtension = phoneExtension; + state.order.customer.phoneExtension = phoneExtension; }, updateStreetAddress(state, streetAddress) { state.order.customer.address.streetAddress = streetAddress; @@ -580,9 +579,9 @@ export const mutations = { state.order.customer.address.city = insuranceDetails.city; state.order.customer.address.state = insuranceDetails.state; state.order.customer.address.zipCode = insuranceDetails.zipCode; + state.order.customer.phoneNumber = insuranceDetails.phoneNumber; + state.order.customer.phoneExtension = insuranceDetails.phoneExtension; state.order.payment.insuranceCoverage.claimNumber = insuranceDetails.claimNumber; - state.order.policy.phoneNumber = insuranceDetails.phoneNumber; - state.order.policy.phoneExtension = insuranceDetails.phoneExtension; state.order.policy.morePolicyQuestions = insuranceDetails.morePolicyQuestions; state.order.policy.dateOfBirth = insuranceDetails.dateOfBirth; state.order.policy.lossTime = insuranceDetails.lossTime; @@ -965,6 +964,7 @@ export const mutations = { state.order.customer.firstName = sessionInformation.order.customer.firstName; state.order.customer.lastName = sessionInformation.order.customer.lastName; state.order.customer.phoneNumber = sessionInformation.order.customer.homePhone; + state.order.customer.phoneExtension = sessionInformation.order.customer.phoneExt; state.order.customer.isSmsOptIn = sessionInformation.order.customer.isSmsOptIn; if (sessionInformation.order.customer.address) { @@ -2822,6 +2822,7 @@ export const actions = { lastName: order.customer.lastName, isSmsOptIn: order.customer.isSmsOptIn, phoneNumber: order.customer.phoneNumber, + phoneExt: order.customer.phoneExtension, address: { streetAddress: order.customer.address.streetAddress, streetAddress2: order.customer.address.streetAddress2,