Adds the `Managed` flow type to the insurance test data. Specifies an empty payment details object for the insurance flow to skip the payment method page.
77 lines
No EOL
2.5 KiB
TypeScript
77 lines
No EOL
2.5 KiB
TypeScript
//Imports here
|
|
import { ITestData } from 'framework/TestData'
|
|
import { ServiceLocation, DamageType, Flow, PartQuestionType, LossLocation } 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';
|
|
|
|
// Seed for consistent test data generation
|
|
setFakerSeedFromTestName("InsuranceMeemicNearSchoolVerified");
|
|
|
|
// Now get the test data with the seeded faker
|
|
const insuranceMeemicNearSchoolVerifiedData: Partial<ITestData> = {
|
|
...getDefaultTestData(),
|
|
|
|
paymentMethod: PaymentMethod.Insurance,
|
|
|
|
isDuplicateClaim: false,
|
|
flow: Flow.Managed,
|
|
isPolicyFound: true,
|
|
isUseVehicleOnPolicy: true,
|
|
isRecalVehicle: false,
|
|
|
|
customerDetails: {
|
|
...getDefaultTestData().customerDetails!,
|
|
address: {
|
|
...getDefaultTestData().customerDetails!.address,
|
|
postalCode: '48382'
|
|
}
|
|
},
|
|
|
|
claimDetails: {
|
|
client: 'Meemic',
|
|
policyNumber: 'Mock427352LD',
|
|
policyDeductible: 0,
|
|
damageDate: new Date().toLocaleDateString('en-US', {month: '2-digit', day: '2-digit', year: 'numeric'}),
|
|
damageCause: DamageType.Rock,
|
|
lossLocation: LossLocation.School
|
|
},
|
|
|
|
vehicleDetails: {
|
|
...getDefaultTestData().vehicleDetails!,
|
|
year: '2015',
|
|
make: 'Jeep',
|
|
model: 'Wrangler',
|
|
style: '4 door utility',
|
|
vehicleLookupType: VehicleLookupType.Zip,
|
|
},
|
|
|
|
appointmentDetails: {
|
|
serviceLocation: ServiceLocation.InShop,
|
|
appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate,
|
|
shopAddress: "3451 Washtenaw Ave, Ann Arbor, MI 48104"
|
|
},
|
|
|
|
partQuestions: [
|
|
{
|
|
partQuestionType: PartQuestionType.GeneralQuestion1,
|
|
isOnPage: true,
|
|
optionToSelect: 'No'
|
|
},
|
|
],
|
|
|
|
// Override payment details (empty because we skip payment method page in insurance flow)
|
|
paymentDetails: {}
|
|
};
|
|
|
|
const insuranceMeemicNearSchoolVerifiedTests: ITestCase[] = [];
|
|
|
|
const tc = {
|
|
name: `InsuranceMeemicNearSchoolVerified`,
|
|
tags: ['@E2E', '@InsuranceMeemicNearSchool', '@test_report', '@Insurance'],
|
|
testData: insuranceMeemicNearSchoolVerifiedData
|
|
};
|
|
insuranceMeemicNearSchoolVerifiedTests.push(tc);
|
|
|
|
export default insuranceMeemicNearSchoolVerifiedTests; |