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
79 lines
No EOL
2.5 KiB
TypeScript
79 lines
No EOL
2.5 KiB
TypeScript
//Imports here
|
|
import { ITestData } from "@business-logic/types/ITestData"
|
|
import { ServicePackage, AppointmentType, PartQuestionType, 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("CashReplaceWiperDropoff");
|
|
|
|
// Now get the test data with the seeded faker
|
|
const cashReplaceWiperDropoffData: Partial<ITestData> = {
|
|
...getDefaultTestData(), // Get default data with current seed
|
|
|
|
// Key feature: Standard package which includes wipers
|
|
servicePackage: ServicePackage.Standard,
|
|
|
|
// Special flags
|
|
skipEstimatePage: true,
|
|
isRecalVehicle: true,
|
|
|
|
// Override customer postal code
|
|
customerDetails: {
|
|
...getDefaultTestData().customerDetails!,
|
|
address: {
|
|
...getDefaultTestData().customerDetails!.address,
|
|
postalCode: '43085'
|
|
}
|
|
},
|
|
|
|
// Override vehicle details - 2023 Audi A8
|
|
vehicleDetails: {
|
|
...getDefaultTestData().vehicleDetails!,
|
|
year: '2023',
|
|
make: 'Audi',
|
|
model: 'A8',
|
|
style: '4 door sedan',
|
|
vin: 'WAULDAF81PN003021',
|
|
vehicleLookupType: VehicleLookupType.Zip
|
|
},
|
|
|
|
// No need to override vehicleDamage as it already defaults to WindshieldCrack
|
|
|
|
// Override for drop-off service
|
|
appointmentDetails: {
|
|
serviceLocation: AppointmentType.DropOff,
|
|
appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate
|
|
},
|
|
|
|
// Payment at service
|
|
paymentDetails: {
|
|
paymentType: PaymentType.PayAtService
|
|
},
|
|
|
|
// Part questions related to recalibration
|
|
partQuestions: [
|
|
{
|
|
partQuestionType: PartQuestionType.GeneralQuestion1,
|
|
isOnPage: true,
|
|
optionToSelect: 'Yes'
|
|
},
|
|
{
|
|
partQuestionType: PartQuestionType.GeneralQuestion2,
|
|
isOnPage: false,
|
|
optionToSelect: 'Yes'
|
|
},
|
|
]
|
|
}
|
|
|
|
const cashReplaceWiperDropoffTests: TestCase[] = [];
|
|
|
|
const tc = new TestCase({
|
|
name: `CashReplaceWiperDropoff`,
|
|
tags: ['@E2E','@CashReplaceWiperDropoff', '@test_report', '@CASH'],
|
|
testData: cashReplaceWiperDropoffData
|
|
}, undefined, 'CashReplaceWiperDropoff');
|
|
cashReplaceWiperDropoffTests.push(tc);
|
|
|
|
export default cashReplaceWiperDropoffTests; |