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
62 lines
No EOL
1.8 KiB
TypeScript
62 lines
No EOL
1.8 KiB
TypeScript
// Imports here
|
|
import { ITestData } from "@business-logic/types/ITestData";
|
|
import TestCase from "@business-logic/types/TestCase";
|
|
import { VehicleDamage } from "@business-logic/types/Enums";
|
|
import { defaultTestData } from "@business-logic/constants/DefaultTestData";
|
|
|
|
// 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.WindshieldOneChip
|
|
],
|
|
alertFlags: {
|
|
isSplitWindshield: true
|
|
}
|
|
};
|
|
|
|
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: TestCase[] = [];
|
|
|
|
// Generate test cases for each vehicle
|
|
vehiclesToTest.forEach((vehicle, index) => {
|
|
const testData = {
|
|
...splitWindshieldData,
|
|
vehicleDetails: {
|
|
...defaultTestData.vehicleDetails!,
|
|
...vehicle
|
|
}
|
|
};
|
|
|
|
const tc = new TestCase({
|
|
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
|
|
}, undefined, `SpliWindshield${index + 1}`);
|
|
|
|
splitWindshieldTests.push(tc);
|
|
});
|
|
|
|
export default splitWindshieldTests; |