DigitalConsumer.FixMyGlass/playwright-tests/tests/CashReplaceGlassLicensePlateLookupInshopPaypal.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

57 lines
No EOL
2.1 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("CashReplaceGlassLicensePlateLookupInshopPaypal");
// Now get the test data with the seeded faker
const cashReplaceGlassLicensePlateLookupInshopPaypalData: Partial<ITestData> = {
...getDefaultTestData(), // Get default data with current seed
// CASH Client
paymentMethod: PaymentMethod.SelfPay,
// Override customer details - using a different ZIP
customerDetails: {
...getDefaultTestData().customerDetails!,
address: {
street: '4076 Spectacle Dr',
city: 'Columbus',
state: 'Ohio',
postalCode: '44125',
country: 'United States'
}
},
// Override vehicle details with license plate lookup
vehicleDetails: {
...getDefaultTestData().vehicleDetails!,
year: '2013',
make: 'Hyundai',
model: 'Sonata',
style: '4 door sedan',
licensePlate: { licensePlateNumber: 'FTY 7776', licensePlateState: '' },
vehicleLookupType: VehicleLookupType.LicensePlateNumber
},
// No need to override vehicleDamage as it already defaults to WindshieldCrack
// Override payment details to use PayPal
paymentDetails: ClientData.getDefaultPaypalDetails()
}
const cashReplaceGlassLicensePlateLookupInshopPaypalTests: ITestCase[] = [];
const tc = {
name: `CashReplaceGlassLicensePlateLookupInshopPaypal`,
tags: ['@E2E','@CashReplaceGlassLicensePlateLookupInshopPaypal', '@test_report', '@CASH'],
testData: cashReplaceGlassLicensePlateLookupInshopPaypalData
};
cashReplaceGlassLicensePlateLookupInshopPaypalTests.push(tc);
export default cashReplaceGlassLicensePlateLookupInshopPaypalTests;