Configures test data to explicitly set the payment method to "SelfPay" for test cases involving cash clients. This change ensures that the payment process is correctly initiated and handled when customers choose to pay directly.
58 lines
No EOL
1.9 KiB
TypeScript
58 lines
No EOL
1.9 KiB
TypeScript
//Imports here
|
|
import { ITestData } from 'framework/TestData'
|
|
import { 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 before generating any data
|
|
setFakerSeedFromTestName("CashReplaceGlassPromoInshop");
|
|
|
|
// Now get the test data with the seeded faker
|
|
const cashReplaceGlassPromoInshopData: Partial<ITestData> = {
|
|
...getDefaultTestData(), // Get default data with current seed
|
|
|
|
// CASH Client
|
|
paymentMethod: PaymentMethod.SelfPay,
|
|
|
|
// Flag for recalibration vehicle
|
|
isRecalVehicle: true,
|
|
|
|
// Override vehicle details with VIN lookup
|
|
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
|
|
|
|
// Override appointment details for in-shop service
|
|
appointmentDetails: {
|
|
...getDefaultTestData().appointmentDetails!,
|
|
shopAddress: "6826 Sawmill Rd, Columbus, OH 43235"
|
|
},
|
|
|
|
// Override payment details
|
|
paymentDetails: {
|
|
paymentType: PaymentType.PayAtService,
|
|
// Add promo code - key feature of this test
|
|
promoCode: '20CALL',
|
|
}
|
|
}
|
|
|
|
const cashReplaceGlassPromoInshopTests: ITestCase[] = [];
|
|
|
|
const tc = {
|
|
name: `CashReplaceGlassPromoInshop`,
|
|
tags: ['@E2E','@CashReplaceGlassPromoInshop', '@test_report', '@CASH'],
|
|
testData: cashReplaceGlassPromoInshopData
|
|
};
|
|
cashReplaceGlassPromoInshopTests.push(tc);
|
|
|
|
export default cashReplaceGlassPromoInshopTests; |