DigitalConsumer.FixMyGlass/playwright-tests/tests/CashReplaceGlassAddressLookupInshopAfterPay.ts
maguire-arman e3d2373409 Sets payment method to self-pay for cash clients
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.
2025-06-18 10:08:02 -04:00

66 lines
No EOL
2.2 KiB
TypeScript

//Imports here
import { ITestData } from 'framework/TestData'
import { ITestCase } from '../framework/Typedefs'
import { VehicleLookupType } from 'safelite-playwright-core';
import { ClientData } 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("CashReplaceGlassAddressLookupInshopAfterPay");
// Now get the test data with the seeded faker
const cashReplaceGlassAddressLookupInshopAfterPayData: Partial<ITestData> = {
...getDefaultTestData(), // Get default data with current seed
// CASH Client
paymentMethod: PaymentMethod.SelfPay,
// Enable entering funnel with ZIP
isEnterFunnelWithZip: true,
// Override customer details
customerDetails: {
...getDefaultTestData().customerDetails!,
lastName: 'Patel',
address: {
street: '4076 Spectacle Dr',
city: 'Columbus',
state: 'Ohio',
postalCode: '43230',
country: 'United States'
}
},
// Override vehicle details
vehicleDetails: {
...getDefaultTestData().vehicleDetails!,
year: '2013',
make: 'Hyundai',
model: 'Sonata',
style: '4 door sedan',
vehicleLookupType: VehicleLookupType.Address
},
// No need to override vehicleDamage as it already defaults to WindshieldCrack
// Override appointment details
appointmentDetails: {
...getDefaultTestData().appointmentDetails!,
shopAddress: "6826 Sawmill Rd, Columbus, OH 43235"
},
// Override payment details
paymentDetails: ClientData.getDefaultAfterpayDetails()
}
const cashReplaceGlassAddressLookupInshopAfterPayTests: ITestCase[] = [];
const tc = {
name: `CashReplaceGlassAddressLookupInshopAfterPay`,
tags: ['@E2E','@CashReplaceGlassAddressLookupInshopAfterPay', '@test_report', '@CASH'],
testData: cashReplaceGlassAddressLookupInshopAfterPayData
};
cashReplaceGlassAddressLookupInshopAfterPayTests.push(tc);
export default cashReplaceGlassAddressLookupInshopAfterPayTests;