DigitalConsumer.FixMyGlass/playwright-tests/tests/InsuranceITAC21stCentury.ts
maguire-arman 8da9b21539 Updates with 631 changes
Improves the handling of cash to insurance flows, including adding new test cases and adjusting logic for policy verification and payment methods.
Also, updates UI elements to ensure correct display of deductible information and handles split windshield scenarios.
The `safelite-playwright-core` dependency is updated to version 1.0.22.
2025-06-23 14:17:34 -04:00

83 lines
No EOL
2.9 KiB
TypeScript

//Imports here
import { ITestData } from 'framework/TestData'
import { ServiceLocation, DamageType, PartQuestionType, Flow } from 'safelite-playwright-core';
import { PaymentMethod } from "framework/localTypes/Enums";
import { ITestCase } from '../framework/Typedefs'
import { VehicleLookupType } from 'safelite-playwright-core';
import { getDefaultTestData, setFakerSeedFromTestName } from 'safelite-playwright-core';
// Set the seed based on test name for consistent but unique data
setFakerSeedFromTestName("InsuranceITAC21stCentury");
// Now get the test data with the seeded faker
const insuranceITAC21stCenturyData: Partial<ITestData> = {
...getDefaultTestData(), // Get default data with current seed
// Key feature: Insurance flow with 21st Century - ITAC (Insurance Total Assumption of Coverage)
paymentMethod: PaymentMethod.Insurance,
// Insurance claim flags
isDuplicateClaim: true,
flow: Flow.Managed,
isUseVehicleOnPolicy: true,
isRecalVehicle: true, // Special flag for recalibration notification
// Override customer details for California location
customerDetails: {
...getDefaultTestData().customerDetails!,
address: {
...getDefaultTestData().customerDetails!.address,
city: 'Ontario',
state: 'California',
postalCode: '91761'
}
},
// Insurance claim details with high deductible
claimDetails: {
client: '21st Century',
policyNumber: 'Mock200122P',
policyDeductible: 3500, // High deductible test case
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 using ZIP lookup
vehicleDetails: {
...getDefaultTestData().vehicleDetails!,
year: '2018',
make: 'Honda',
model: 'Accord',
style: '4 door sedan',
vehicleLookupType: VehicleLookupType.Zip,
},
// No need to override vehicleDamage as it already defaults to WindshieldCrack
// Override for in-shop appointment with specific shop
appointmentDetails: {
serviceLocation: ServiceLocation.InShop,
appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate,
shopAddress: "8160 Masi Dr, Rancho Cucamonga, CA 91730"
},
// Part questions related to recalibration
partQuestions: [
{
partQuestionType: PartQuestionType.GeneralQuestion1,
isOnPage: true,
optionToSelect: 'Yes'
},
]
}
const insuranceITAC21stCenturyTests: ITestCase[] = [];
const tc = {
name: `InsuranceITAC21stCentury`,
tags: ['@E2E','@InsuranceITAC21stCentury', '@test_report', '@Insurance'],
testData: insuranceITAC21stCenturyData
};
insuranceITAC21stCenturyTests.push(tc);
export default insuranceITAC21stCenturyTests;