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.
50 lines
No EOL
1.7 KiB
TypeScript
50 lines
No EOL
1.7 KiB
TypeScript
//Imports here
|
|
import { ITestData } from 'framework/TestData'
|
|
import { VehicleDamage, ServiceLocation, ServicePackage } from 'safelite-playwright-core';
|
|
import { ITestCase } from '../framework/Typedefs'
|
|
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("CashRepairInShopAfterPay");
|
|
|
|
// Now get the test data with the seeded faker
|
|
const cashRepairInShopAfterPayData : Partial<ITestData> = {
|
|
...getDefaultTestData(), // Get default data with current seed
|
|
|
|
// CASH Client
|
|
paymentMethod: PaymentMethod.SelfPay,
|
|
|
|
//Override default vehicle damage (Windshield Crack)
|
|
vehicleDamage: [VehicleDamage.WindshieldTwoChips],
|
|
|
|
// Key feature: Standard Package
|
|
servicePackage: ServicePackage.Standard,
|
|
|
|
// Override specific fields with test-specific data
|
|
vehicleDetails: {
|
|
...getDefaultTestData().vehicleDetails!,
|
|
vin: '1HGCV2E35LA005448'
|
|
},
|
|
|
|
// Override appointment details
|
|
appointmentDetails: {
|
|
...getDefaultTestData().appointmentDetails!,
|
|
shopAddress: "6826 Sawmill Rd, Columbus, OH 43235"
|
|
},
|
|
|
|
// Use predefined payment data
|
|
paymentDetails: ClientData.getDefaultAfterpayDetails()
|
|
}
|
|
|
|
const cashRepairInShopAfterPayTests: ITestCase[] = [];
|
|
|
|
const tc = {
|
|
name: `CashRepairInShopAfterPay`,
|
|
tags: ['@E2E','@CashRepairInShopAfterPay', '@test_report', '@CASH'],
|
|
testData: cashRepairInShopAfterPayData
|
|
};
|
|
cashRepairInShopAfterPayTests.push(tc);
|
|
|
|
export default cashRepairInShopAfterPayTests; |