DigitalConsumer.FixMyGlass/playwright-tests/tests/CashReplaceMultiSlidingGlassDropoff.ts
2026-05-03 12:24:21 -04:00

125 lines
No EOL
4.1 KiB
TypeScript

//Imports here
import { ITestData, getDefaultExperimentsData } from 'framework/TestData'
import { VehicleDamage, PartQuestionType, PaymentType, ServicePackage, ServiceLocation } 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("CashReplaceMultiSlidingGlassDropoff");
// Now get the test data with the seeded faker
const cashReplaceMultiSlidingGlassDropoffData: Partial<ITestData> = {
...getDefaultTestData(), // Get default data with current seed
// CASH Client
paymentMethod: PaymentMethod.SelfPay,
// Override customer postal code
customerDetails: {
...getDefaultTestData().customerDetails!,
address: {
...getDefaultTestData().customerDetails!.address,
postalCode: '43085'
}
},
// Flag for recalibration vehicle
isRecalVehicle: true,
// Key feature: Standard Package
servicePackage: ServicePackage.Standard,
// Override for drop-off service
appointmentDetails: {
serviceLocation: ServiceLocation.DropOff,
appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate,
shopAddress: "1343 cameron ave, lewis center, oh 43035"
},
// Override vehicle details
vehicleDetails: {
...getDefaultTestData().vehicleDetails!,
year: '2018',
make: 'Ford',
model: 'F Series F150',
style: '4 door crew cab',
vehicleLookupType: VehicleLookupType.Zip
},
// Key feature: multiple damaged glasses
vehicleDamage: [
VehicleDamage.WindshieldCrack,
VehicleDamage.PassengerFrontDoor,
VehicleDamage.PassengerRearDoor,
VehicleDamage.RearSliding
],
// Override payment details
paymentDetails: {
paymentType: PaymentType.PayAtService
},
// Part questions related to rain sensing
partQuestions: [
{
partQuestionType: PartQuestionType.GeneralQuestion1,
isOnPage: true,
optionToSelect: 'Yes'
},
],
// Capability Questions
capabilityQuestions: [
{
partQuestionType: PartQuestionType.GeneralQuestion1,
isOnPage: true,
optionToSelect: 'Yes'
},
],
// Vehicle part questions for multiple glass parts
vehiclePartQuestions: [
{
partQuestionType: PartQuestionType.WindshieldColor,
isOnPage: true,
optionToSelect: 'Green Tint',
secondaryQuestionOptionToSelect: 'rain sensor, solar, soundproofing, third visor frit, lane departure warning system, hwp, w/combination bracket'
},
{
partQuestionType: PartQuestionType.PassengerFrontColor,
isOnPage: true,
optionToSelect: 'Green Tint',
secondaryQuestionOptionToSelect: 'solar, passenger side, front, laminated, soundproofing'
},
{
partQuestionType: PartQuestionType.PassengerRearColor,
isOnPage: true,
optionToSelect: 'Gray Tint Privacy',
secondaryQuestionOptionToSelect: 'solar, passenger side, rear, platinum edition, 2 hole'
},
{
partQuestionType: PartQuestionType.RearSlidingWindowColor,
isOnPage: true,
optionToSelect: 'Gray Tint Privacy',
secondaryQuestionOptionToSelect: 'heated glass, solar, slider, power, kit'
}
],
// Experiments
experiments: {
...getDefaultExperimentsData()
}
}
const cashReplaceMultiSlidingGlassDropoffTests: ITestCase[] = [];
const tc = {
name: `CashReplaceMultiSlidingGlassDropoff`,
tags: ['@E2E','@CashReplaceMultiSlidingGlassDropoff', '@test_report', '@CASH'],
testData: cashReplaceMultiSlidingGlassDropoffData
};
cashReplaceMultiSlidingGlassDropoffTests.push(tc);
export default cashReplaceMultiSlidingGlassDropoffTests;