DigitalConsumer.ISS/playwright-tests/tests/0023_EssentialNonServiceableBigTruck.ts
Rob Donahey d539df9550
Feature/insr 7038: Playwright tests for big truck scenarios (#963)
List of commits in this pr:

* Begin essential Playwright test cases for big truck

* Implement non serviceable big truck vin lookup and fix test case tags

* Rename non serviceable vin cases

* Common sense .env.dev example

* Move extraneous stuff to .env.example

* Add playwright environment file to gitignore

* Stop tracking .env.dev

* Specify file ignore

* Ignore .env

* Implement advanced tests for big truck

* Remove duplicate smoke test

* Implement PR feedback

* Add  comments to type definitions for clarity for any future uses

* More descriptive env comment
2025-10-16 16:07:01 -04:00

71 lines
2.5 KiB
TypeScript

import ClientData from "@business-logic/data/ClientData";
import TestCase from "@business-logic/types/TestCase";
import { DamageType, 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";
const nextWeekday = getNextWeekday();
const essentialNonServiceableBigTruckData: Partial<ITestData> = {
clientTag: 'ALL_ESSENTIAL',
isDuplicateClaim: false,
isPolicyFound: false,
endorsements: [],
isReplace: true,
partQuestions: undefined,
isSafelite: true,
servicePackage: faker.helpers.enumValue(ServicePackage),
customerDetails: {
firstName: faker.person.firstName(),
lastName: faker.person.lastName(),
email: "itqatest@safelite.com",
phoneNumber: faker.helpers.fromRegExp(/[2-9][0-9][0-9]-[0-9]{3}-[0-9]{4}/),
notes: 'Automated Test',
address: {
street: faker.location.streetAddress(),
city: 'Dublin',
state: 'Ohio',
postalCode: '43016',
country: 'United States'
}
},
claimDetails: {
policyNumber: faker.string.alphanumeric(5),
policyDeductible: -1, // Not advanced, so we don't care about deductible.
damageDate: '2024-10-10',
damageCause: DamageType.Other
},
vehicleDetails: {
year: '2016',
make: 'Isuzu',
model: 'Reach',
style: 'step van',
},
vehicleDamage: [
VehicleDamage.WindshieldCrack,
],
appointmentDetails: {
serviceLocation: ServiceLocation.InShop,
shopAddress: '6826 Sawmill Rd, Columbus, OH 43235',
appointmentDate: nextWeekday
},
isNonServiceable: true,
}
const essentialClients = ClientData.getEssentialClients();
const essentialNonServiceableBigTruckTestCases: TestCase[] = [];
for (const client of essentialClients) {
const data = {...essentialNonServiceableBigTruckData};
data.clientTag = client.clientTag;
data.isAuthenticationRequired = client.clientFlags.isAuthenticationEnabled ?? false
const tc = new TestCase({
name: `0023 Essential Non-Serviceable Big Truck Client: "${client.accountName}"`,
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@BigTruck', '@Essentials'],
testData: data
}, undefined, '0023');
essentialNonServiceableBigTruckTestCases.push(tc);
}
export default essentialNonServiceableBigTruckTestCases;