DigitalConsumer.FixMyGlass/playwright-tests/tests/alert-validation/alert0003_SplitWindshield.ts
maguire-arman 8da9b21539 Updates with 631 changes
Improves the handling of cash to insurance flows, including adding new test cases and adjusting logic for policy verification and payment methods.
Also, updates UI elements to ensure correct display of deductible information and handles split windshield scenarios.
The `safelite-playwright-core` dependency is updated to version 1.0.22.
2025-06-23 14:17:34 -04:00

74 lines
No EOL
2.2 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Imports here
import { ITestData } from 'framework/TestData';
import { ITestCase, TestCase } from '../../framework/Typedefs'
import { VehicleDamage } from 'safelite-playwright-core';
import { defaultTestData } from 'safelite-playwright-core';
import { getDefaultTestData, setFakerSeedFromTestName } from 'safelite-playwright-core';
// Windshield selected, when vehicle has split windshield (alert) Test Data
const splitWindshieldData: Partial<ITestData> = {
...defaultTestData, // Start with all defaults
// Override specific fields with test-specific data
vehicleDamage: [
VehicleDamage.SingleSplitWindshield,
VehicleDamage.DriverSplitWindshield,
VehicleDamage.PassengerSplitWindshield
],
alertFlags: {
isSplitWindshield: true
},
customerDetails: {
...getDefaultTestData().customerDetails!,
address: {
...getDefaultTestData().customerDetails!.address,
postalCode: '55414'
}
},
isHeavyTruck: true, // Flag for heavy truck vehicle
};
const vehiclesToTest = [
{
year: '2000',
make: 'Kenworth',
model: 'T450',
style: 'conventional cab'
},
{
year: '2006',
make: 'Navistar',
model: '5000 I',
style: '2 door conventional cab'
},
{
year: '1990',
make: 'Kenworth',
model: 'T600',
style: 'conventional cab'
},
];
const splitWindshieldTests: ITestCase[] = [];
// Generate test cases for each vehicle
vehiclesToTest.forEach((vehicle, index) => {
    const testData = {
        ...splitWindshieldData,
        vehicleDetails: {
            ...defaultTestData.vehicleDetails!,
            ...vehicle
        },
    }
const tc = {
name: `alert0003_${vehicle.make.toLowerCase()}_${vehicle.model.toLowerCase()} Windshield selected, when vehicle has split windshield - ${vehicle.make} ${vehicle.model} ${vehicle.year}`,
tags: ['@Alert', '@SplitWindshield', '@test_report', `@${vehicle.make.toLowerCase()}`],
testData: testData
};
splitWindshieldTests.push(tc);
});
export default splitWindshieldTests;