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

106 lines
No EOL
3.8 KiB
TypeScript

//Imports here
import { ITestData } from "@business-logic/types/ITestData"
import { VehicleDamage, 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 before generating any data
setFakerSeedFromTestName("CashReplaceMultiGlassPromoInshop");
// Now get the test data with the seeded faker
const cashReplaceMultiGlassPromoInshopData: Partial<ITestData> = {
...getDefaultTestData(), // Get default data with current seed
// Add promo code
promoCode: '20CALL',
// Flag for recalibration vehicle
isRecalVehicle: true,
// Override customer details - different postal code
customerDetails: {
...getDefaultTestData().customerDetails!,
address: {
...getDefaultTestData().customerDetails!.address,
postalCode: '43085'
}
},
// Override vehicle details with VIN lookup
vehicleDetails: {
...getDefaultTestData().vehicleDetails!,
year: '2019',
make: 'Subaru',
model: 'Outback',
style: '4 door station wagon',
vin: '4S4BSENC4K3221004',
vehicleLookupType: VehicleLookupType.Vin
},
// Key feature: multiple damaged glasses
vehicleDamage: [
VehicleDamage.WindshieldCrack,
VehicleDamage.DriverFrontDoor,
VehicleDamage.DriverRearDoor,
VehicleDamage.DriverVentGlass,
VehicleDamage.PassengerVentGlass,
VehicleDamage.RearWindow
],
// Override payment details
paymentDetails: {
paymentType: PaymentType.PayAtService
},
// Vehicle part questions for multiple glass parts
vehiclePartQuestions: [
{
partQuestionType: PartQuestionType.WindshieldColor,
isOnPage: true,
optionToSelect: 'Green Tint, Blue Shade',
secondaryQuestionOptionToSelect: 'solar, lane departure warning system, heated glass wiper park, high beam assist, soundproofing'
},
{
partQuestionType: PartQuestionType.DriverFrontColor,
isOnPage: true,
optionToSelect: 'Green Tint',
secondaryQuestionOptionToSelect: 'solar, driver side, front, soundproofing, laminated'
},
{
partQuestionType: PartQuestionType.DriverRearColor,
isOnPage: true,
optionToSelect: 'Gray Tint Privacy',
secondaryQuestionOptionToSelect: 'solar, driver side, rear'
},
{
partQuestionType: PartQuestionType.DriverVentColor,
isOnPage: true,
optionToSelect: 'Gray Tint Privacy',
secondaryQuestionOptionToSelect: 'solar, driver side, rear'
},
{
partQuestionType: PartQuestionType.PassengerVentColor,
isOnPage: true,
optionToSelect: 'Gray Tint Privacy',
secondaryQuestionOptionToSelect: 'solar, passenger side, rear'
},
{
partQuestionType: PartQuestionType.RearWindowColor,
isOnPage: true,
optionToSelect: 'Green Tint',
secondaryQuestionOptionToSelect: 'heated glass, solar, antenna, manual liftgate, 1 hole'
}
]
}
const cashReplaceMultiGlassPromoInshopTests: TestCase[] = [];
const tc = new TestCase({
name: `CashReplaceMultiGlassPromoInshop`,
tags: ['@E2E','@CashReplaceMultiGlassPromoInshop', '@test_report', '@CASH'],
testData: cashReplaceMultiGlassPromoInshopData
}, undefined, 'CashReplaceMultiGlassPromoInshop');
cashReplaceMultiGlassPromoInshopTests.push(tc);
export default cashReplaceMultiGlassPromoInshopTests;