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

61 lines
No EOL
2 KiB
TypeScript

//Imports here
import { ITestData } from 'framework/TestData'
import { ServicePackage, ServiceLocation, 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 based on test name for consistent but unique data
setFakerSeedFromTestName("CashReplaceWiperPromoInShop");
// Now get the test data with the seeded faker
const cashReplaceWiperPromoInShopData: Partial<ITestData> = {
...getDefaultTestData(), // Get default data with current seed
// CASH Client
paymentMethod: PaymentMethod.SelfPay,
// Key feature: Standard package with wipers
servicePackage: ServicePackage.Standard,
// Override customer postal code
customerDetails: {
...getDefaultTestData().customerDetails!,
address: {
...getDefaultTestData().customerDetails!.address,
postalCode: '43085'
}
},
// Override vehicle details - Truck with VIN lookup
vehicleDetails: {
...getDefaultTestData().vehicleDetails!,
year: '2015',
make: 'Ford',
model: 'F Series F150',
style: '2 door standard cab',
vin: '1FTMF1C87FKD85044',
vehicleLookupType: VehicleLookupType.Vin
},
// No need to override vehicleDamage as it already defaults to WindshieldCrack
// Payment at service
paymentDetails: {
paymentType: PaymentType.PayAtService,
// Specific wiper promo code
promoCode: '1WIPER0',
}
}
const cashReplaceWiperPromoInShopTests: ITestCase[] = [];
const tc = {
name: `CashReplaceWiperPromoInShop`,
tags: ['@E2E','@CashReplaceWiperPromoInShop', '@test_report', '@CASH'],
testData: cashReplaceWiperPromoInShopData
};
cashReplaceWiperPromoInShopTests.push(tc);
export default cashReplaceWiperPromoInShopTests;