DigitalConsumer.FixMyGlass/playwright-tests/tests/CashReplaceStaticInshop.ts
2026-02-17 00:09:55 -05:00

78 lines
No EOL
2.3 KiB
TypeScript

//Imports here
import { ITestData } from 'framework/TestData'
import { ServicePackage, PaymentType, PartQuestionType } from 'safelite-playwright-core';
import { ITestCase } from '../framework/Typedefs'
import { VehicleLookupType } from 'safelite-playwright-core';
import { getDefaultTestData, setFakerSeedFromTestName } from 'safelite-playwright-core';
import { PaymentMethod } from 'framework/localTypes/Enums';
// Set the seed before generating any data
setFakerSeedFromTestName("CashReplaceStaticInshop");
// Now get the test data with the seeded faker
const CashReplaceStaticInshopData: Partial<ITestData> = {
...getDefaultTestData(), // Get default data with current seed
// CASH Client
paymentMethod: PaymentMethod.SelfPay,
// Key feature: Premium package with Rain Defense
servicePackage: ServicePackage.Standard,
// Flag for recalibration vehicle
isRecalVehicle: true,
// Override customer details
customerDetails: {
...getDefaultTestData().customerDetails!,
address: {
...getDefaultTestData().customerDetails!.address,
postalCode: '43085'
}
},
// override part questions
partQuestions: [
{
partQuestionType: PartQuestionType.GeneralQuestion1,
isOnPage: true,
optionToSelect: 'Yes'
},
{
partQuestionType: PartQuestionType.GeneralQuestion2,
isOnPage: true,
optionToSelect: 'Yes'
}
],
// Override vehicle details
vehicleDetails: {
...getDefaultTestData().vehicleDetails!,
year: '2022',
make: 'Mazda',
model: 'CX-9',
style: '4 door utility',
vin: '3FA6P0HD8LR234510',
vehicleLookupType: VehicleLookupType.Zip
},
mockFirstInshopCallNoSchedule: true,
// No need to override vehicleDamage as it already defaults to WindshieldCrack
// Payment at service
paymentDetails: {
paymentType: PaymentType.PayAtService
},
}
const cashReplaceStaticInshopTests: ITestCase[] = [];
const tc = {
name: `CashReplaceStaticInshop`,
tags: ['@E2E','@CashReplaceStaticInshop', '@test_report', '@CASH'],
testData: CashReplaceStaticInshopData
};
cashReplaceStaticInshopTests.push(tc);
export default cashReplaceStaticInshopTests;