84 lines
No EOL
2.6 KiB
TypeScript
84 lines
No EOL
2.6 KiB
TypeScript
//Imports here
|
|
import { ITestData } from 'framework/TestData'
|
|
import { ServicePackage, ServiceLocation, PartQuestionType, PaymentType } 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 based on test name for consistent but unique data
|
|
setFakerSeedFromTestName("CashReplaceWiperDropoff");
|
|
|
|
// Now get the test data with the seeded faker
|
|
const cashReplaceWiperDropoffData: Partial<ITestData> = {
|
|
...getDefaultTestData(), // Get default data with current seed
|
|
|
|
// CASH Client
|
|
paymentMethod: PaymentMethod.SelfPay,
|
|
|
|
// Key feature: Standard package which includes wipers
|
|
servicePackage: ServicePackage.Standard,
|
|
|
|
// Special flags
|
|
isSkipEstimatePage: true,
|
|
isRecalVehicle: true,
|
|
|
|
// Override customer postal code
|
|
customerDetails: {
|
|
...getDefaultTestData().customerDetails!,
|
|
address: {
|
|
...getDefaultTestData().customerDetails!.address,
|
|
postalCode: '43085'
|
|
}
|
|
},
|
|
|
|
// Override vehicle details - 2023 Audi A8
|
|
vehicleDetails: {
|
|
...getDefaultTestData().vehicleDetails!,
|
|
year: '2023',
|
|
make: 'Audi',
|
|
model: 'A8',
|
|
style: '4 door sedan',
|
|
vin: 'WAULDAF81PN003021',
|
|
vehicleLookupType: VehicleLookupType.Zip
|
|
},
|
|
|
|
// No need to override vehicleDamage as it already defaults to WindshieldCrack
|
|
|
|
// Override for drop-off service
|
|
appointmentDetails: {
|
|
serviceLocation: ServiceLocation.DropOff,
|
|
appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate,
|
|
shopAddress: "6826 Sawmill Rd, Columbus, OH 43235"
|
|
},
|
|
|
|
// Payment at service
|
|
paymentDetails: {
|
|
paymentType: PaymentType.PayAtService
|
|
},
|
|
|
|
// Part questions related to recalibration
|
|
partQuestions: [
|
|
{
|
|
partQuestionType: PartQuestionType.GeneralQuestion1,
|
|
isOnPage: true,
|
|
optionToSelect: 'Yes'
|
|
},
|
|
{
|
|
partQuestionType: PartQuestionType.GeneralQuestion2,
|
|
isOnPage: false,
|
|
optionToSelect: 'Yes'
|
|
},
|
|
]
|
|
}
|
|
|
|
const cashReplaceWiperDropoffTests: ITestCase[] = [];
|
|
|
|
const tc = {
|
|
name: `CashReplaceWiperDropoff`,
|
|
tags: ['@E2E','@CashReplaceWiperDropoff', '@test_report', '@CASH'],
|
|
testData: cashReplaceWiperDropoffData
|
|
};
|
|
cashReplaceWiperDropoffTests.push(tc);
|
|
|
|
export default cashReplaceWiperDropoffTests; |