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

69 lines
No EOL
2.3 KiB
TypeScript

//Imports here
import { ITestData } from "@business-logic/types/ITestData"
import { AppointmentType, 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("CashReplaceVinMobile");
// Now get the test data with the seeded faker
const cashReplaceVinMobileData: Partial<ITestData> = {
...getDefaultTestData(), // Get default data with current seed
// Flag for recalibration vehicle
isRecalVehicle: true,
// Override customer postal code
customerDetails: {
...getDefaultTestData().customerDetails!,
address: {
...getDefaultTestData().customerDetails!.address,
postalCode: '43085'
}
},
// Override vehicle details - using VIN lookup
vehicleDetails: {
...getDefaultTestData().vehicleDetails!,
year: '2012',
make: 'Honda',
model: 'Accord',
style: '4 door sedan',
vin: '1HGCP3F83CA040466',
vehicleLookupType: VehicleLookupType.Vin
},
// No need to override vehicleDamage as it already defaults to WindshieldCrack
// Override for mobile service
appointmentDetails: {
serviceLocation: AppointmentType.Mobile,
appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate,
serviceAddress: {
// Use street address from current faker seed
street: getDefaultTestData().customerDetails!.address.street,
city: 'Rosedale',
state: 'MD',
postalCode: '21237',
country: 'United States'
}
},
// Payment at service
paymentDetails: {
paymentType: PaymentType.PayAtService
},
}
const cashReplaceVinMobileTests: TestCase[] = [];
const tc = new TestCase({
name: `CashReplaceVinMobile`,
tags: ['@E2E','@CashReplaceVinMobile', '@test_report', '@CASH'],
testData: cashReplaceVinMobileData
}, undefined, 'CashReplaceVinMobile');
cashReplaceVinMobileTests.push(tc);
export default cashReplaceVinMobileTests;