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.
61 lines
No EOL
2 KiB
TypeScript
61 lines
No EOL
2 KiB
TypeScript
//Imports here
|
|
import { ITestData } from "@business-logic/types/ITestData"
|
|
import { ServicePackage, 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("CashReplaceRainDefensePromoInshop");
|
|
|
|
// Now get the test data with the seeded faker
|
|
const cashReplaceRainDefensePromoInshopData: Partial<ITestData> = {
|
|
...getDefaultTestData(), // Get default data with current seed
|
|
|
|
// Key feature: Premium package with Rain Defense
|
|
servicePackage: ServicePackage.Premium,
|
|
|
|
// Rain Defense promo code
|
|
promoCode: 'rd50',
|
|
|
|
// Flag for recalibration vehicle
|
|
isRecalVehicle: true,
|
|
|
|
// Override customer details
|
|
customerDetails: {
|
|
...getDefaultTestData().customerDetails!,
|
|
address: {
|
|
...getDefaultTestData().customerDetails!.address,
|
|
postalCode: '43085'
|
|
}
|
|
},
|
|
|
|
// Override vehicle details
|
|
vehicleDetails: {
|
|
...getDefaultTestData().vehicleDetails!,
|
|
year: '2020',
|
|
make: 'Ford',
|
|
model: 'Fusion',
|
|
style: '4 door sedan',
|
|
vin: '3FA6P0HD8LR234510',
|
|
vehicleLookupType: VehicleLookupType.Vin
|
|
},
|
|
|
|
// No need to override vehicleDamage as it already defaults to WindshieldCrack
|
|
|
|
// Payment at service
|
|
paymentDetails: {
|
|
paymentType: PaymentType.PayAtService
|
|
},
|
|
}
|
|
|
|
const cashReplaceRainDefensePromoInshopTests: TestCase[] = [];
|
|
|
|
const tc = new TestCase({
|
|
name: `CashReplaceRainDefensePromoInshop`,
|
|
tags: ['@E2E','@CashReplaceRainDefensePromoInshop', '@test_report', '@CASH'],
|
|
testData: cashReplaceRainDefensePromoInshopData
|
|
}, undefined, 'CashReplaceRainDefensePromoInshop');
|
|
cashReplaceRainDefensePromoInshopTests.push(tc);
|
|
|
|
export default cashReplaceRainDefensePromoInshopTests; |