DigitalConsumer.FixMyGlass/playwright-tests/tests/CashReplaceSafeliteCanNotRecalMobile.ts

81 lines
No EOL
2.7 KiB
TypeScript

//Imports here
import { ITestData } from "@business-logic/types/ITestData"
import { AppointmentType, 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("CashReplaceSafeliteCanNotRecalMobile");
// Now get the test data with the seeded faker
const cashReplaceSafeliteCanNotRecalMobileData: Partial<ITestData> = {
...getDefaultTestData(), // Get default data with current seed
// Special flag to skip estimate page
skipEstimatePage: true,
// Special flag to verify safelite can not recalibrate in the backend
canNotRecal: true,
// Override customer postal code
customerDetails: {
...getDefaultTestData().customerDetails!,
address: {
...getDefaultTestData().customerDetails!.address,
postalCode: '21237'
}
},
// Override vehicle details - vehicle with recalibration that Safelite cannot perform
vehicleDetails: {
...getDefaultTestData().vehicleDetails!,
year: '2009',
make: 'Volkswagen',
model: 'Passat CC',
style: '4 door sedan',
vin: 'VWML73C79E552439',
vehicleLookupType: VehicleLookupType.Zip
},
// No need to override vehicleDamage as it already defaults to WindshieldCrack
// Override for mobile service
appointmentDetails: {
serviceLocation: AppointmentType.Mobile,
appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate,
serviceAddress: {
// Use street address from current faker seed
street: "5050 Silver Oak Dr",
city: 'Rosedale',
state: 'MD',
postalCode: '21237',
country: 'United States'
},
},
// Payment at service
paymentDetails: {
paymentType: PaymentType.PayAtService
},
// Part questions related to recalibration
partQuestions: [
{
partQuestionType: PartQuestionType.GeneralQuestion1,
isOnPage: true,
optionToSelect: 'Yes'
},
]
}
const cashReplaceSafeliteCanNotRecalMobileTests: TestCase[] = [];
const tc = new TestCase({
name: `CashReplaceSafeliteCanNotRecalMobile`,
tags: ['@E2E','@CashReplaceSafeliteCanNotRecalMobile', '@test_report', '@CASH'],
testData: cashReplaceSafeliteCanNotRecalMobileData
}, undefined, 'CashReplaceSafeliteCanNotRecalMobile');
cashReplaceSafeliteCanNotRecalMobileTests.push(tc);
export default cashReplaceSafeliteCanNotRecalMobileTests;