From ef1efe0fe0a5fd783c508f36e1192613f575206c Mon Sep 17 00:00:00 2001 From: gc-carlin Date: Thu, 29 May 2025 16:59:17 -0400 Subject: [PATCH] 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;