DigitalConsumer.FixMyGlass/playwright-tests/tests/CashRepairMobileCreditCard.ts
maguire-arman 404dda6556 Adds Playwright test framework for FMG
Initial commit of the Playwright test framework, including:
- Configuration files for Playwright, Docker, and Sauce Labs
- Test case structure and page object models
- CI/CD pipeline configuration
- Utilities and business logic implementations

This framework will be used for end-to-end testing of the FMG application.
2025-04-07 15:40:31 -04:00

50 lines
No EOL
1.8 KiB
TypeScript

//Imports here
import { ITestData } from "@business-logic/types/ITestData"
import { VehicleDamage, AppointmentType } from "@business-logic/types/Enums";
import TestCase from "@business-logic/types/TestCase";
import PaymentData from "@business-logic/Data/PaymentData";
import { getDefaultTestData, setFakerSeedFromTestName } from "@business-logic/constants/DefaultTestData";
// Set the seed before generating any data
setFakerSeedFromTestName("CashRepairMobileCreditCard");
// Now get the test data with the seeded faker
const cashRepairMobileCCData : Partial<ITestData> = {
...getDefaultTestData(), // Get default data with current seed
//Override default vehicle damage (Windshield Crack)
vehicleDamage: [VehicleDamage.WindshieldOneChip],
// Override specific fields with test-specific data
vehicleDetails: {
...getDefaultTestData().vehicleDetails!,
vin: '1HGCV2E35LA005448'
},
// Override appointment details
appointmentDetails: {
serviceLocation: AppointmentType.Mobile,
appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate,
serviceAddress: {
street: '13735 San Antonio Ave',
city: 'Chino',
state: 'California',
postalCode: '91710',
country: 'United States'
}
},
// Use predefined payment data
paymentDetails: PaymentData.getDefaultCreditCardDetails()
}
const cashRepairMobileCCTests: TestCase[] = [];
const tc = new TestCase({
name: `CashRepairMobileCreditCard`,
tags: ['@E2E','@CashRepairMobileCreditCard', '@test_report', '@CASH'],
testData: cashRepairMobileCCData
}, undefined, 'CashRepairMobileCreditCard');
cashRepairMobileCCTests.push(tc);
export default cashRepairMobileCCTests;