* 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
82 lines
No EOL
3 KiB
TypeScript
82 lines
No EOL
3 KiB
TypeScript
import ClientData from "@business-logic/data/ClientData";
|
|
import TestCase from "@business-logic/types/TestCase";
|
|
import { DamageType, 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";
|
|
|
|
const nextWeekday = getNextWeekday();
|
|
|
|
const essentialPriceServiceErrorBailoutData: Partial<ITestData> = {
|
|
clientTag: 'ALL_ESSENTIAL',
|
|
isDuplicateClaim: false,
|
|
isPolicyFound: false,
|
|
endorsements: [],
|
|
isReplace: false,
|
|
partQuestions: undefined,
|
|
isSafelite: true,
|
|
bailoutFlags: {
|
|
isPriceServiceErrorBailout: 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][0-9][0-9]-[0-9][0-9][0-9][0-9]/),
|
|
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: '2015',
|
|
make: 'Honda',
|
|
model: 'Accord',
|
|
style: '4 door sedan', // TODO: Check correctness of vehicle style
|
|
vehicleLookupType: VehicleLookupType.Vin,
|
|
vin: '1HGCR2E30FA099831'
|
|
},
|
|
vehicleDamage: [
|
|
// VehicleDamage.WindshieldThreeChips,
|
|
VehicleDamage.WindshieldCrack,
|
|
// VehicleDamage.DriverFrontDoor,
|
|
// VehicleDamage.DriverQuarterPanel,
|
|
// VehicleDamage.DriverRearDoor,
|
|
// VehicleDamage.PassengerFrontDoor,
|
|
// VehicleDamage.PassengerQuarterPanel,
|
|
// VehicleDamage.PassengerRearDoor,
|
|
// VehicleDamage.RearWindow
|
|
],
|
|
appointmentDetails: {
|
|
serviceLocation: ServiceLocation.InShop,
|
|
appointmentDate: nextWeekday
|
|
}
|
|
|
|
}
|
|
|
|
const essentialClients = ClientData.getEssentialClients();
|
|
const essentialPriceServiceErrorBailoutTests: TestCase[] = [];
|
|
for (const client of essentialClients) {
|
|
const data = {...essentialPriceServiceErrorBailoutData};
|
|
data.clientTag = client.clientTag;
|
|
data.isAuthenticationRequired = client.clientFlags.isAuthenticationEnabled ?? false
|
|
const tc = new TestCase({
|
|
name: `0021 Essential Price Service Error Bailout Client: "${client.accountName}"`,
|
|
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@Bailout', '@PriceService', '@Essentials'],
|
|
testData: data
|
|
}, undefined, '0021');
|
|
essentialPriceServiceErrorBailoutTests.push(tc);
|
|
}
|
|
|
|
export default essentialPriceServiceErrorBailoutTests; |