DigitalConsumer.FixMyGlass/playwright-tests/tests/InsuranceGeico.ts
maguire-arman a2ca9134d1 Initializes Playwright test framework
Sets up the core infrastructure for Playwright-based automated testing, including:
- Docker support for consistent environments
- Azure Pipelines configuration for CI/CD
- Page Object Model structure for maintainable tests
- Test data, validation, and rule engine implementation
- Test configuration for alerts and other scenarios
2025-05-08 15:45:05 -04:00

78 lines
No EOL
2.7 KiB
TypeScript

//Imports here
import { ITestData } from "@business-logic/types/ITestData"
import { PaymentMethod, AppointmentType, DamageType, PaymentType } 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("InsuranceGeico");
// Now get the test data with the seeded faker
const insuranceGeicoData: 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,
// Override customer details with specific name and California location
customerDetails: {
...getDefaultTestData().customerDetails!,
firstName: 'Albina',
lastName: 'Klint',
address: {
...getDefaultTestData().customerDetails!.address,
city: 'Ontario',
state: 'California',
postalCode: '91761'
}
},
// Insurance claim details
claimDetails: {
client: 'GEICO',
policyNumber: 'Mock250034C',
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.Hail
},
// Hyundai vehicle details with VIN lookup
vehicleDetails: {
...getDefaultTestData().vehicleDetails!,
year: '2018',
make: 'Hyundai',
model: 'Elantra',
style: '4 door sedan',
vin: '5NPD84LFXJH285828',
vehicleLookupType: VehicleLookupType.Vin,
},
// No need to override vehicleDamage as it already defaults to WindshieldCrack
// Override for in-shop appointment
appointmentDetails: {
serviceLocation: AppointmentType.InShop,
shopAddress: '8985 Yellow Brick Rd, Rosedale, MD 21237',
appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate
},
// Override payment details (empty because we skip payment method page in insurance flow)
paymentDetails: {}
}
const insuranceGeicoTests: TestCase[] = [];
const tc = new TestCase({
name: `InsuranceGeico`,
tags: ['@E2E','@InsuranceGeico', '@test_report', '@Insurance'],
testData: insuranceGeicoData
}, undefined, 'InsuranceGeico');
insuranceGeicoTests.push(tc);
export default insuranceGeicoTests;