88 lines
No EOL
2.9 KiB
TypeScript
88 lines
No EOL
2.9 KiB
TypeScript
//Imports here
|
|
import { ITestData } from 'framework/TestData'
|
|
import { ServiceLocation, DamageType, PaymentType, PartQuestionType } 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';
|
|
|
|
// Set the seed based on test name for consistent but unique data
|
|
setFakerSeedFromTestName("InsuranceOEMAllstate");
|
|
|
|
// Now get the test data with the seeded faker
|
|
const insuranceOEMAllstateData: Partial<ITestData> = {
|
|
...getDefaultTestData(), // Get default data with current seed
|
|
|
|
// Key feature: Insurance flow with GEICO
|
|
paymentMethod: PaymentMethod.Insurance,
|
|
|
|
// Insurance claim flags
|
|
isPolicyFound: false,
|
|
isPolicyUnverified: true,
|
|
isRecalVehicle: true,
|
|
isOEM: true,
|
|
|
|
// Override customer details with specific name and California location
|
|
customerDetails: {
|
|
...getDefaultTestData().customerDetails!,
|
|
firstName: 'Jane',
|
|
lastName: 'OEMTest',
|
|
address: {
|
|
...getDefaultTestData().customerDetails!.address,
|
|
city: 'Richmond',
|
|
state: 'Virginia',
|
|
postalCode: '23219'
|
|
}
|
|
},
|
|
|
|
|
|
// Insurance claim details
|
|
claimDetails: {
|
|
client: 'Allstate',
|
|
policyNumber: 'MockOEMTest',
|
|
policyDeductible: "Unverified",
|
|
policyZip: '43085',
|
|
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: '2024',
|
|
make: 'Jeep',
|
|
model: 'Wrangler',
|
|
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: ServiceLocation.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 insuranceOEMAllstateTests: ITestCase[] = [];
|
|
|
|
const tc = {
|
|
name: `InsuranceOEMAllstate`,
|
|
tags: ['@E2E','@InsuranceOEMAllstate', '@test_report', '@Insurance'],
|
|
testData: insuranceOEMAllstateData
|
|
};
|
|
insuranceOEMAllstateTests.push(tc);
|
|
|
|
export default insuranceOEMAllstateTests; |