DigitalConsumer.ISS/playwright-tests/tests/advanced/0014a_NoCompAdas.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

90 lines
No EOL
3 KiB
TypeScript

import ClientData from "@business-logic/data/ClientData";
import TestCase from "@business-logic/types/TestCase";
import { DamageType, EndorsementType, 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: 'East York',
state: 'PA',
postalCode: '17402',
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 = `~AutomatedScenario0014a${faker.string.uuid().substring(0,6)}`;
const policySoap = MockPolicyData.getPolicySoapByScenario('0014a', customerDetails, policyNumber);
const advancedScenario0014Data: Partial<ITestData> = {
clientTag: '',
isDuplicateClaim: false,
isPolicyFound: true,
isNoComp: true,
isRecalWarning: true,
hasStateLawPopup: false,
endorsements: [
{
endorsementType: EndorsementType.Educator,
isOnPolicy: true,
isClickYes: true
}
],
partQuestions: undefined,
isSafelite: true,
servicePackage: faker.helpers.enumValue(ServicePackage),
customerDetails: customerDetails,
claimDetails: {
policyNumber: policyNumber,
policyDeductible: 9999,
damageDate: '2023-01-01',
damageCause: faker.helpers.enumValue(DamageType)
},
policySoap: policySoap,
vehicleDetails: {
year: '2019',
make: 'Toyota',
model: 'C-HR',
style: ''
},
vehicleDamage: [
VehicleDamage.WindshieldCrack
],
appointmentDetails: {
serviceLocation: ServiceLocation.InShop,
shopAddress: undefined,
alternateServiceZip: '43016',
appointmentDate: nextWeekday
},
paymentDetails: ClientData.getDefaultAfterpayDetails()
}
// TODO: Add validation for deductible/covered amount
const advancedClients = ClientData.getAdvancedClients();
const advancedScenario0014TestCases: TestCase[] = [];
for (const client of advancedClients) {
const data = {...advancedScenario0014Data};
data.clientTag = client.clientTag;
const tc = new TestCase({
name: `0014a Advanced Replace NoComp Adas Client: "${client.accountName}"`,
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@Advanced'],
testData: data
}, undefined, '0014a');
advancedScenario0014TestCases.push(tc);
}
export default advancedScenario0014TestCases;