DigitalConsumer.ISS/playwright-tests/tests/0015_EssentialReplacePartsQuestionsDropoff.ts
chase-safelite 5d3ab0ef59
Added playwright tests into repo (#923)
* Initial import of playwright tests

* Pipeline changes for automated tests

* Modified pipeline for testing

* Attempt #2

* Attempt #3

* Added missing paren

* Removed debug stuff from pipeline

* Changes from playwright repo

* Changed pipeline for debugging

* Fix for ServiceLocationPage playwright locators

* Change pipeline to run with TEST APIs

* Moved more of Siraj's changes to this repo

* Changed where updating env occurs

* Changed location of env update again

* Escaped double quotes

* Added visible report in Azure

* Moved changes into main pipeline

* Made it so dotenv only runs config in local
2025-02-14 09:54:11 -05:00

85 lines
No EOL
3 KiB
TypeScript

import ClientData from "@business-logic/data/ClientData";
import { DamageType, PartQuestionType, ServiceLocation, ServicePackage, VehicleDamage, VehicleLookupType } from "@business-logic/types/Enums";
import { ITestData } from "@business-logic/types/ITestData"
import TestCase from "@business-logic/types/TestCase";
import { faker } from "@faker-js/faker";
import { getNextWeekday } from "@impl/utils/DateUtils";
const nextWeekday = getNextWeekday();
const essentialReplaceData: Partial<ITestData> = {
clientTag: 'ALL_ESSENTIAL',
isDuplicateClaim: false,
isPolicyFound: false,
endorsements: [],
isReplace: false,
vehiclePartQuestions: [
{
partQuestionType: PartQuestionType.WindshieldColor,
isOnPage: true,
optionToSelect: 'Green Tint, Blue Shade'
},
// {
// partQuestionType: PartQuestionType.DriverFrontColor,
// isOnPage: true,
// optionToSelect: 'Green Tint'
// },
],
isSafelite: true,
servicePackage: faker.helpers.enumValue(ServicePackage),
customerDetails: {
firstName: faker.person.firstName(),
lastName: faker.person.lastName(),
email: faker.internet.email(),
phoneNumber: faker.helpers.fromRegExp(/[2-9][0-9][0-9]-[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]/),
notes: 'Automated Test',
address: {
// street: faker.location.streetAddress(),
street: '456 Columbus Pike',
city: 'Dublin',
state: 'Ohio',
postalCode: '43223',
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: '2011',
make: 'Nissan',
model: 'XTerra',
style: '4 door utility',
vin: '5N1AN0NW9BC524974',
vehicleLookupType: VehicleLookupType.Vin,
},
vehicleDamage: [
VehicleDamage.WindshieldCrack,
// VehicleDamage.DriverFrontDoor,
],
appointmentDetails: {
serviceLocation: ServiceLocation.DropOff,
shopAddress: undefined,
appointmentDate: nextWeekday
}
}
const essentialClients = ClientData.getEssentialClients();
const essentialReplacePartsQuestionsDropoff_0015: TestCase[] = [];
for (const client of essentialClients) {
const data = { ...essentialReplaceData };
data.clientTag = client.clientTag;
data.isAuthenticationRequired = client.clientFlags.isAuthenticationEnabled ?? false
const tc = new TestCase({
name: `0015 Essential Replace Client: "${client.accountName}"`,
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@Essentials','@0015'],
testData: data
}, undefined, '0015');
essentialReplacePartsQuestionsDropoff_0015.push(tc);
}
export default essentialReplacePartsQuestionsDropoff_0015;