DigitalConsumer.ISS/playwright-tests/tests/advanced/0020a_NoCompChangeLoc.ts
Siraj Shaik 6d5a0524e3 latest updates from QA repo
21 and 22 scenarios were added
Mock responses refactored.
2025-02-18 14:41:05 -05:00

92 lines
No EOL
3.1 KiB
TypeScript

import ClientData from "@business-logic/data/ClientData";
import TestCase from "@business-logic/types/TestCase";
import { DamageType, PartQuestionType, PaymentType, ServiceLocation, ServicePackage, VehicleDamage } from "@business-logic/types/Enums";
import { ITestData } from "@business-logic/types/ITestData"
import { faker } from "@faker-js/faker";
import { getNextWeekday } from "@impl/utils/DateUtils";
import MockPolicyData from "@business-logic/data/MockPolicyData";
import { ICustomerDetails } from "@business-logic/types/CustomerDetails";
import { IAddress } from "@business-logic/types/IAddress";
const nextWeekday = getNextWeekday();
const customerAddress: IAddress = {
street: faker.location.streetAddress(),
city: 'Frankfort',
state: 'KY',
postalCode: '40601',
country: 'United States'
}
const customerDetails: ICustomerDetails = {
firstName: faker.person.firstName(),
lastName: faker.person.lastName(),
email: 'itqatest@safelite.com',
phoneNumber: '614-531-0031',
notes: 'Automated Test',
address: customerAddress
}
const policyNumber = `~AutomatedScenario0020a${faker.string.uuid().substring(0,6)}`;
const policySoap = MockPolicyData.getPolicySoapByScenario('0020a', customerDetails, policyNumber);
const advancedScenario0020Data: Partial<ITestData> = {
clientTag: '',
isDuplicateClaim: false,
isPolicyFound: true,
isNoComp: true,
hasStateLawPopup: false,
hasMilitaryWarning: true,
endorsements: undefined,
vehiclePartQuestions: undefined,
isSafelite: true,
servicePackage: faker.helpers.enumValue(ServicePackage),
customerDetails: customerDetails,
claimDetails: {
policyNumber: policyNumber,
policyDeductible: 9999,
damageDate: '2023-08-01',
damageCause: faker.helpers.enumValue(DamageType)
},
policySoap: policySoap,
vehicleDetails: {
year: '2021',
make: 'Subaru',
model: 'WRX',
style: ''
},
vehicleDamage: [
VehicleDamage.WindshieldOneChip
],
appointmentDetails: {
serviceLocation: ServiceLocation.Mobile,
serviceAddress: {
street: faker.location.streetAddress(),
city: 'Goose Creek',
state: 'SC',
postalCode: '29445',
country: 'US'
},
alternateServiceZip: '29445',
appointmentDate: nextWeekday
},
paymentDetails: {
paymentType: PaymentType.PayAtService
}
}
// TODO: Add validation for deductible/covered amount
const advancedClients = ClientData.getAdvancedClients();
const advancedScenario0020TestCases: TestCase[] = [];
for (const client of advancedClients) {
const data = {...advancedScenario0020Data};
data.clientTag = client.clientTag;
const tc = new TestCase({
name: `0020a Advanced Repair Change Location Client: "${client.accountName}"`,
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@Advanced','@Defect-INSR-2149'],
testData: data
}, undefined, '0020a');
advancedScenario0020TestCases.push(tc);
}
export default advancedScenario0020TestCases;