DigitalConsumer.FixMyGlass/playwright-tests/tests/InsuranceITACOptimizedPriceValidationAllState.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

79 lines
No EOL
3 KiB
TypeScript

//Imports here
import { ITestData } from "@business-logic/types/ITestData"
import { VehicleDamage, 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("InsuranceITACOptimizedPriceValidationAllState");
// Now get the test data with the seeded faker
const insuranceITACOptimizedPriceValidationAllStateData: Partial<ITestData> = {
...getDefaultTestData(), // Get default data with current seed
// Key feature: Insurance flow with Allstate - ITAC with Optimized Price Validation
paymentMethod: PaymentMethod.Insurance,
// Insurance claim flags
isDuplicateClaim: true,
isPolicyFound: true,
isUseVehicleOnPolicy: true,
// Override customer details with specific name and location
customerDetails: {
...getDefaultTestData().customerDetails!,
firstName: 'Deborah L',
lastName: 'Grist',
address: {
...getDefaultTestData().customerDetails!.address,
city: 'Franklin County',
state: 'Ohio',
postalCode: '43235'
}
},
// Insurance claim details
claimDetails: {
client: 'Allstate Insurance',
policyNumber: 'Mock294523C',
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.Rock
},
// Vehicle details for truck with ZIP lookup
vehicleDetails: {
...getDefaultTestData().vehicleDetails!,
year: '2015',
make: 'Toyota',
model: 'Tacoma Pickup',
style: '4 door crew cab',
vehicleLookupType: VehicleLookupType.Zip,
},
// Driver door damage instead of windshield
vehicleDamage: [
VehicleDamage.DriverFrontDoor,
],
// Override for in-shop appointment with specific shop
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 insuranceITACOptimizedPriceValidationAllStateTests: TestCase[] = [];
const tc = new TestCase({
name: `InsuranceITACOptimizedPriceValidationAllState`,
tags: ['@E2E','@InsuranceITACOptimizedPriceValidationAllState', '@test_report', '@Insurance'],
testData: insuranceITACOptimizedPriceValidationAllStateData
}, undefined, 'InsuranceITACOptimizedPriceValidationAllState');
insuranceITACOptimizedPriceValidationAllStateTests.push(tc);
export default insuranceITACOptimizedPriceValidationAllStateTests;