Add test to cover no comp insurance scenario
This commit is contained in:
parent
c3c8b48129
commit
92b3e34d4b
1 changed files with 89 additions and 0 deletions
89
playwright-tests/tests/InsuranceNoCompProgressive.ts
Normal file
89
playwright-tests/tests/InsuranceNoCompProgressive.ts
Normal file
|
|
@ -0,0 +1,89 @@
|
||||||
|
//Imports here
|
||||||
|
import { ITestData } from "@business-logic/types/ITestData"
|
||||||
|
import { PaymentMethod, AppointmentType, DamageType, PaymentType, PartQuestionType} from "@business-logic/types/Enums";
|
||||||
|
import TestCase from "@business-logic/types/TestCase";
|
||||||
|
import { VehicleLookupType } from "@business-logic/types/Enums";
|
||||||
|
import { getDefaultTestData, setFakerSeedFromTestName } from "@business-logic/constants/DefaultTestData";
|
||||||
|
|
||||||
|
// Set the seed based on test name for consistent but unique data
|
||||||
|
setFakerSeedFromTestName("InsuranceNoCompProgressive");
|
||||||
|
|
||||||
|
// Now get the test data with the seeded faker
|
||||||
|
const insuranceNoCompProgressiveData: Partial<ITestData> = {
|
||||||
|
...getDefaultTestData(), // Get default data with current seed
|
||||||
|
|
||||||
|
// Key feature: Insurance flow with GEICO
|
||||||
|
paymentMethod: PaymentMethod.Insurance,
|
||||||
|
|
||||||
|
// Insurance claim flags
|
||||||
|
isDuplicateClaim: true,
|
||||||
|
isPolicyFound: true,
|
||||||
|
isUseVehicleOnPolicy: true,
|
||||||
|
isHeavyTruck: false,
|
||||||
|
isPolicyDriver: true,
|
||||||
|
isRecalVehicle: true,
|
||||||
|
|
||||||
|
// Override customer details with specific name and California location
|
||||||
|
customerDetails: {
|
||||||
|
...getDefaultTestData().customerDetails!,
|
||||||
|
firstName: 'SHERI',
|
||||||
|
lastName: 'SCHATZ',
|
||||||
|
address: {
|
||||||
|
...getDefaultTestData().customerDetails!.address,
|
||||||
|
city: 'Slidell',
|
||||||
|
state: 'Louisiana',
|
||||||
|
postalCode: '70458'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// Insurance claim details
|
||||||
|
claimDetails: {
|
||||||
|
client: 'Progressive',
|
||||||
|
policyNumber: 'Mock495646B',
|
||||||
|
policyDeductible: 1722.20,
|
||||||
|
policyZip: '70458',
|
||||||
|
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: '2015',
|
||||||
|
make: 'Acura',
|
||||||
|
model: 'MDX',
|
||||||
|
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: AppointmentType.InShop,
|
||||||
|
shopAddress: '56705 Garrett Road, Slidell, LA 70458',
|
||||||
|
appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate
|
||||||
|
},
|
||||||
|
|
||||||
|
// Override payment details (empty because we skip payment method page in insurance flow)
|
||||||
|
paymentDetails: {}
|
||||||
|
}
|
||||||
|
|
||||||
|
const insuranceNoCompProgressiveTests: TestCase[] = [];
|
||||||
|
|
||||||
|
const tc = new TestCase({
|
||||||
|
name: `InsuranceNoCompProgressive`,
|
||||||
|
tags: ['@E2E','@InsuranceNoCompProgressive', '@test_report', '@Insurance'],
|
||||||
|
testData: insuranceNoCompProgressiveData
|
||||||
|
}, undefined, 'InsuranceBigTruckVerified');
|
||||||
|
insuranceNoCompProgressiveTests.push(tc);
|
||||||
|
|
||||||
|
export default insuranceNoCompProgressiveTests;
|
||||||
Loading…
Reference in a new issue