Scnario-30a is added.

This commit is contained in:
Siraj Shaik 2025-03-17 11:04:00 -04:00
parent 4a9c3f9cab
commit 5f515a39ec
3 changed files with 97 additions and 0 deletions

File diff suppressed because one or more lines are too long

View file

@ -56,6 +56,7 @@ import advancedScenario0025TestCases from "./advanced/0025a_VehicleByVINUnverifi
import advancedScenario0026aTestCases from "./advanced/0026a_NoDeductibleAdasBailout5";
import advancedScenario0028aTestCases from "./advanced/0028a_ItacCancelMyClaim";
import advancedScenario0029aTestCases from "./advanced/0029a_HeavyVehicleBailout";
import advancedScenario0030aTestCases from "./advanced/0030a_PartsServiceBailout";
@ -307,6 +308,11 @@ test.describe.parallel('ISS QA Automation Regression', () => {
for (const testCase of advancedScenario0029aTestCases) {
test(...prepareTest(testCase, run, options, ruleEngine));
}
// Scenario 0030a
for (const testCase of advancedScenario0030aTestCases) {
test(...prepareTest(testCase, run, options, ruleEngine));
}
});

View file

@ -0,0 +1,89 @@
import ClientData from "@business-logic/data/ClientData";
import TestCase from "@business-logic/types/TestCase";
import { DamageType, EndorsementType, ServiceLocation, ServicePackage, VehicleDamage, VehicleLookupType } 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: 'Birmingham',
state: 'AL',
postalCode: '35118',
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 = `~AutomatedScenario0030a${faker.string.uuid().substring(0, 6)}`;
const policySoap = MockPolicyData.getPolicySoapByScenario('0030a', customerDetails, policyNumber);
const advancedScenario0030aData: Partial<ITestData> = {
clientTag: '',
isDuplicateClaim: false,
isPolicyFound: false,
isNoComp: true,
isItac: false,
hasStateLawPopup: false,
bailoutFlags: {
isPartsServiceErrorBailout: true,
},
vehiclePartQuestions: [
],
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: '2012',
make: 'Dodge',
model: 'Charger',
style: '',
vin: '2C3CDXBG6CH260654',
vehicleLookupType: VehicleLookupType.Vin
},
vehicleDamage: [
VehicleDamage.WindshieldCrack
],
appointmentDetails: {
serviceLocation: ServiceLocation.Mobile,
serviceAddress: customerAddress,
appointmentDate: nextWeekday
},
paymentDetails: ClientData.getDefaultCreditCardDetails()
}
// TODO: Add validation for deductible/covered amount
const advancedClients = ClientData.getAdvancedClients();
const advancedScenario0030aTestCases: TestCase[] = [];
for (const client of advancedClients) {
const data = { ...advancedScenario0030aData };
data.clientTag = client.clientTag;
const tc = new TestCase({
name: `0030a Advanced ITAC Cancel My Claim: "${client.accountName}"`,
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@Advanced', '@INSR-2057'],
testData: data
}, undefined, '0030a');
advancedScenario0030aTestCases.push(tc);
}
export default advancedScenario0030aTestCases;