Merge pull request #932 from Safelite/sshaik/INSR-2057
Sshaik/insr 2057
This commit is contained in:
commit
7df39ead64
21 changed files with 635 additions and 36 deletions
File diff suppressed because one or more lines are too long
|
|
@ -30,9 +30,10 @@ export interface IVehicleDetails {
|
|||
make: string,
|
||||
model: string,
|
||||
style?: string,
|
||||
vin?: string|string[],
|
||||
licensePlateNumber?: string|string[],
|
||||
licensePlateState?: string|string[],
|
||||
vin?: string | string[],
|
||||
address?: string | IAddress[],
|
||||
licensePlateNumber?: string | string[],
|
||||
licensePlateState?: string | string[],
|
||||
vehicleLookupType?: VehicleLookupType,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,5 +3,6 @@ export interface IAddress {
|
|||
city: string,
|
||||
state: string,
|
||||
postalCode: string,
|
||||
country: string
|
||||
country?: string,
|
||||
lastName?: string
|
||||
}
|
||||
|
|
@ -10,6 +10,7 @@ export interface ITestData {
|
|||
isPolicyFound: boolean, // Effective difference between advanced and essential
|
||||
isUseVehicleOnPolicy: boolean, // Should we use the vehicle on the policy?
|
||||
isVehicleLookupValidations: boolean, // Should we validate vehicle lookup?
|
||||
isAddressLookupValidations: boolean, // Should we validate address lookup errors?
|
||||
isVehicleSelectBailout: boolean, // Should we bailout on vehicle lookup?
|
||||
isNoComp: boolean, // Is this a NoComp policy?
|
||||
isItac: boolean, // Is this an ITAC scenario?
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { AddressLookupPage } from "../../pages/AddressLookupPage";
|
||||
import { BailoutPage } from "../../pages/BailoutPage";
|
||||
import CapabilityQuestionsPage from "../../pages/CapabilityQuestionsPage";
|
||||
import { ContactConfirmationPage } from "../../pages/ContactConfirmationPage";
|
||||
|
|
@ -59,5 +60,6 @@ export default interface ITestPages {
|
|||
vehicleLookupAddressPage: VehicleLookupAddressPage,
|
||||
vehicleLookupLicensePage: VehicleLookupLicensePage,
|
||||
welcomePage: WelcomePage,
|
||||
moldingQuestionsPage: MoldingQuestionsPage
|
||||
moldingQuestionsPage: MoldingQuestionsPage,
|
||||
addressLookupPage: AddressLookupPage,
|
||||
}
|
||||
|
|
@ -44,6 +44,7 @@ import MockPolicyData from "@business-logic/data/MockPolicyData";
|
|||
import VehiclePartQuestionsPage from "../../pages/VehiclePartsPage";
|
||||
import CapabilityQuestionsPage from "../../pages/CapabilityQuestionsPage";
|
||||
import { MoldingQuestionsPage } from "../../pages/MoldingQuestionsPage";
|
||||
import { AddressLookupPage } from "../../pages/AddressLookupPage";
|
||||
|
||||
export default class TestCase extends DisposableBase implements ITestCase {
|
||||
public static FrameworkConfig: FrameworkConfig = {
|
||||
|
|
@ -205,7 +206,8 @@ export default class TestCase extends DisposableBase implements ITestCase {
|
|||
vehicleLookupAddressPage: new VehicleLookupAddressPage(page),
|
||||
vehicleLookupLicensePage: new VehicleLookupLicensePage(page),
|
||||
welcomePage: new WelcomePage(page),
|
||||
moldingQuestionsPage: new MoldingQuestionsPage(page)
|
||||
moldingQuestionsPage: new MoldingQuestionsPage(page),
|
||||
addressLookupPage: new AddressLookupPage(page)
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
59
playwright-tests/pages/AddressLookupPage.ts
Normal file
59
playwright-tests/pages/AddressLookupPage.ts
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
import { expect, type Locator, type Page } from '@playwright/test';
|
||||
import { BasePage } from './BasePage';
|
||||
import { AddressForm } from './forms/AddressForm';
|
||||
import { IAddress } from '@business-logic/types/IAddress';
|
||||
import { ICustomerDetails } from '@business-logic/types/CustomerDetails';
|
||||
|
||||
export class AddressLookupPage extends BasePage {
|
||||
readonly page: Page;
|
||||
readonly addressForm: AddressForm;
|
||||
readonly addressNoMatchTextBox: Locator;
|
||||
readonly stateRestrictionsTextBox: Locator;
|
||||
issPageValue = 'address-lookup';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page);
|
||||
this.page = page;
|
||||
this.addressForm = new AddressForm(page);
|
||||
this.addressNoMatchTextBox = page.getByText('Your address didn’t return a VIN matchPlease re-enter the information below or');
|
||||
this.stateRestrictionsTextBox = page.getByText('State restrictionsLooks like');
|
||||
}
|
||||
|
||||
async forceAddressFormToAppear() {
|
||||
await expect(async () => {
|
||||
await this.addressForm.streetAddressTextBox.click();
|
||||
await this.addressForm.streetAddressTextBox.pressSequentially('7400 Safelite Way');
|
||||
await this.addressForm.streetAddressTextBox.press('Tab');
|
||||
await expect(this.addressForm.zipCodeTextBox).toBeVisible({ timeout: 100 });
|
||||
}).toPass();
|
||||
}
|
||||
|
||||
async populateAddress(fullAddress: IAddress) {
|
||||
if (fullAddress.street) {
|
||||
// Transform IAddress to CustomerDetails address format
|
||||
const customerAddress: Partial<ICustomerDetails> = {
|
||||
address: {
|
||||
street: fullAddress.street,
|
||||
city: fullAddress.city,
|
||||
state: fullAddress.state,
|
||||
postalCode: fullAddress.postalCode
|
||||
},
|
||||
lastName: fullAddress.lastName || '',
|
||||
};
|
||||
// Fill address using AddressForm methods
|
||||
await this.addressForm.populateAddress(customerAddress);
|
||||
}
|
||||
}
|
||||
|
||||
async validateAddressLookupAlerts(addressSet: IAddress[]) {
|
||||
await this.populateAddress(addressSet[0]);
|
||||
await this.continueButton.click();
|
||||
await expect(this.addressNoMatchTextBox).toBeVisible();
|
||||
|
||||
await this.populateAddress(addressSet[1]);
|
||||
await this.continueButton.click();
|
||||
await expect(this.stateRestrictionsTextBox).toBeVisible();
|
||||
|
||||
await this.populateAddress(addressSet[2]);
|
||||
}
|
||||
}
|
||||
|
|
@ -5,6 +5,7 @@ export class CoverageStatementPage extends BasePage {
|
|||
readonly page: Page;
|
||||
readonly scheduleOnlineButton: Locator;
|
||||
readonly cancelMyClaimButton: Locator;
|
||||
readonly cancelMyClaimConfirm: Locator;
|
||||
readonly deductibleAmount: Locator;
|
||||
readonly verfiyingCoverageText: Locator;
|
||||
readonly continueToScheduleButton: Locator; // For ITAC/NoComp
|
||||
|
|
@ -15,10 +16,11 @@ export class CoverageStatementPage extends BasePage {
|
|||
this.page = page;
|
||||
this.scheduleOnlineButton = this.page.getByText('Continue to schedule online');
|
||||
this.cancelMyClaimButton = this.page.getByText('Cancel my claim');
|
||||
this.cancelMyClaimConfirm = this.page.getByText('No, I want to cancel');
|
||||
|
||||
this.deductibleAmount = this.page.getByText('$');
|
||||
this.verfiyingCoverageText = this.page.getByRole('heading', { name: 'We’re verifying your coverage' });
|
||||
this.continueToScheduleButton = page.locator('div[class*="button-content"]', {hasText:'Continue to schedule online'});
|
||||
// this.validateURL(this.url);
|
||||
}
|
||||
|
||||
async scheduleOnline(){
|
||||
|
|
@ -27,6 +29,7 @@ export class CoverageStatementPage extends BasePage {
|
|||
|
||||
async cancelMyClaim(){
|
||||
await this.cancelMyClaimButton.click();
|
||||
await this.cancelMyClaimConfirm.click();
|
||||
}
|
||||
|
||||
async validateDeductibleAmount(customer){
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ export class OrderConfirmationPage extends BasePage {
|
|||
this.subtotalText = this.page.locator("#subtotal-value");
|
||||
this.finalAmountDue = this.page.locator('#bottom-amount-due-value');
|
||||
this.cartServicePackageText = this.page.locator('#cart-service-package');
|
||||
// this.validateURL(this.url);
|
||||
}
|
||||
|
||||
async validateOrderConfirmationPage(testData: Partial<ITestData>) {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ export class WelcomePage extends BasePage {
|
|||
this.city = page.getByRole('textbox', { name: 'In which city did the damage' });
|
||||
this.state = page.locator('select[name="\\38 fdf9dc2e13e430eb57529499dceb3eb"]');
|
||||
this.cookieCloseButton = page.getByRole('button', { name: 'Close' });
|
||||
|
||||
}
|
||||
|
||||
async goto(clientTag: string) {
|
||||
|
|
|
|||
|
|
@ -52,6 +52,11 @@ import advancedScenario0022TestCases from "./advanced/0022a_VehicleByVIN";
|
|||
import advancedScenario0023TestCases from "./advanced/0023a_VehicleByVINPartsQns";
|
||||
import { createAccessibilityHtmlReport } from "@impl/utils/ReportUtils";
|
||||
import advancedScenario0024TestCases from "./advanced/0024a_VehicleByVINUnverifiedBailout";
|
||||
import advancedScenario0025TestCases from "./advanced/0025a_VehicleByVINUnverifiedBailout";
|
||||
import advancedScenario0026aTestCases from "./advanced/0026a_NoDeductibleAdasBailout5";
|
||||
import advancedScenario0028aTestCases from "./advanced/0028a_ItacCancelMyClaim";
|
||||
import advancedScenario0029aTestCases from "./advanced/0029a_HeavyVehicleBailout";
|
||||
import advancedScenario0030aTestCases from "./advanced/0030a_PartsServiceBailout";
|
||||
|
||||
|
||||
|
||||
|
|
@ -283,6 +288,31 @@ test.describe.parallel('ISS QA Automation Regression', () => {
|
|||
for (const testCase of advancedScenario0024TestCases) {
|
||||
test(...prepareTest(testCase, run, options, ruleEngine));
|
||||
}
|
||||
|
||||
// Scenario 0025a
|
||||
for (const testCase of advancedScenario0025TestCases) {
|
||||
test(...prepareTest(testCase, run, options, ruleEngine));
|
||||
}
|
||||
|
||||
// Scenario 0026a
|
||||
for (const testCase of advancedScenario0026aTestCases) {
|
||||
test(...prepareTest(testCase, run, options, ruleEngine));
|
||||
}
|
||||
|
||||
// Scenario 0028a
|
||||
for (const testCase of advancedScenario0028aTestCases) {
|
||||
test(...prepareTest(testCase, run, options, ruleEngine));
|
||||
}
|
||||
|
||||
// Scenario 0029a
|
||||
for (const testCase of advancedScenario0029aTestCases) {
|
||||
test(...prepareTest(testCase, run, options, ruleEngine));
|
||||
}
|
||||
|
||||
// Scenario 0030a
|
||||
for (const testCase of advancedScenario0030aTestCases) {
|
||||
test(...prepareTest(testCase, run, options, ruleEngine));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
|
@ -327,7 +357,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
appointmentDetails, isSafelite, endorsements,
|
||||
partQuestions, paymentDetails, isNoComp, isItac, isRecalNotification,
|
||||
isRecalWarning, servicePackage, hasStateLawPopup, otherVehiclesOnPolicy,
|
||||
isSeparateApptsWarning, vehiclePartQuestions, editVehicleDetails,
|
||||
isSeparateApptsWarning, vehiclePartQuestions, editVehicleDetails, isAddressLookupValidations,
|
||||
hasMilitaryWarning, capabilityQuestions, isUseVehicleOnPolicy, isVehicleLookupValidations, isMoldingQuestion } = testCase.testData;
|
||||
|
||||
let { isPolicyFound } = testCase.testData; // Allow isPolicyFound to be re-assigned
|
||||
|
|
@ -340,12 +370,12 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
endorsementsPage, vehicleLookupPage, partQuestionsPage, paymentMethodPage,
|
||||
vehicleLookupAddressPage, vehicleLookupLicensePage, vinLookupPage,
|
||||
bailoutPage, tpaSearchPage, tpaSubmitPage, tpaConfirmationPage,
|
||||
vehiclePartQuestionsPage, capabilityQuestionsPage, moldingQuestionsPage } = testCase.pages;
|
||||
vehiclePartQuestionsPage, capabilityQuestionsPage, moldingQuestionsPage, addressLookupPage } = testCase.pages;
|
||||
|
||||
// Destructure bailout flags
|
||||
const { isVehicleSelectBailout, isDoNotSeeMyShopBailout, isTpaNotEnabledBailout,
|
||||
isHeavyTruckVehicleBailout, isPartsServiceErrorBailout,
|
||||
isVehicleLookupBailout, isPriceServiceErrorBailout } = testCase.testData.bailoutFlags || {};
|
||||
isVehicleLookupBailout, isPriceServiceErrorBailout, isRequestCallbackBailout } = testCase.testData.bailoutFlags || {};
|
||||
|
||||
const repairTypes: VehicleDamage[] = [
|
||||
VehicleDamage.WindshieldOneChip,
|
||||
|
|
@ -522,11 +552,21 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
}
|
||||
switch (vehicleDetails!.vehicleLookupType!) {
|
||||
case VehicleLookupType.Address:
|
||||
await test.step('VehicleLookupAddressPage >> Lookup by address: ' + customerDetails!.address.street, async () => {
|
||||
await vehicleLookupAddressPage.validateURL(vehicleLookupAddressPage.issPageValue);
|
||||
await vehicleLookupAddressPage.lookupVehicleByAddress(customerDetails!, vehicleDetails!);
|
||||
await vehicleLookupAddressPage.nextPage();
|
||||
});
|
||||
if (isAddressLookupValidations) {
|
||||
await test.step('Address Lookup validations >> Vehicle Lookup by address: ' + customerDetails!.address.street, async () => {
|
||||
if (Array.isArray(vehicleDetails?.address)) {
|
||||
await addressLookupPage.validateURL(addressLookupPage.issPageValue);
|
||||
await addressLookupPage.validateAddressLookupAlerts(vehicleDetails?.address);
|
||||
await addressLookupPage.nextPage();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
await test.step('VehicleLookupAddressPage >> Lookup by address: ' + customerDetails!.address.street, async () => {
|
||||
await vehicleLookupAddressPage.validateURL(vehicleLookupAddressPage.issPageValue);
|
||||
await vehicleLookupAddressPage.lookupVehicleByAddress(customerDetails!, vehicleDetails!);
|
||||
await vehicleLookupAddressPage.nextPage();
|
||||
});
|
||||
}
|
||||
break;
|
||||
case VehicleLookupType.LicensePlateNumber:
|
||||
await vehicleLookupLicensePage.validateURL(vehicleLookupLicensePage.issPageValue);
|
||||
|
|
@ -582,7 +622,18 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
await vehiclePartQuestionsPage.selectPartQuestionResponses(vehiclePartQuestions);
|
||||
await vehiclePartQuestionsPage.nextPage();
|
||||
}
|
||||
if (isRequestCallbackBailout) {
|
||||
await test.step('CoverageStatementPage >> Cancel My claim', async () => {
|
||||
await coverageStatementPage.validateURL(coverageStatementPage.issPageValue);
|
||||
await coverageStatementPage.cancelMyClaim();
|
||||
});
|
||||
|
||||
await test.step('BailoutPage >> Request Callback Bailout', async () => {
|
||||
await bailoutPage.validateURL(bailoutPage.issPageValue);
|
||||
await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.RequestCallback);
|
||||
});
|
||||
return;
|
||||
}
|
||||
await test.step('CoverageStatementPage >> Next page', async () => {
|
||||
await coverageStatementPage.validateURL(coverageStatementPage.issPageValue);
|
||||
// Confirm no coverage
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ for (const client of advancedClients) {
|
|||
data.clientTag = client.clientTag;
|
||||
const tc = new TestCase({
|
||||
name: `0021a Advanced client Vehicle By License Plate: "${client.accountName}"`,
|
||||
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@Advanced'],
|
||||
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@Advanced', '@INSR-2057'],
|
||||
testData: data
|
||||
}, undefined, '0021a');
|
||||
advancedScenario0021TestCases.push(tc);
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ for (const client of advancedClients) {
|
|||
data.clientTag = client.clientTag;
|
||||
const tc = new TestCase({
|
||||
name: `0022a Advanced Client Vehicle By Vin: "${client.accountName}"`,
|
||||
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@Advanced'],
|
||||
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@Advanced', '@INSR-2057'],
|
||||
testData: data
|
||||
}, undefined, '0022a');
|
||||
advancedScenario0022TestCases.push(tc);
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ for (const client of advancedClients) {
|
|||
data.clientTag = client.clientTag;
|
||||
const tc = new TestCase({
|
||||
name: `0023a Advanced client Unlisted Vehicle: "${client.accountName}"`,
|
||||
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@Advanced'],
|
||||
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@Advanced', '@INSR-2057'],
|
||||
testData: data
|
||||
}, undefined, '0023a');
|
||||
advancedScenario0023TestCases.push(tc);
|
||||
|
|
|
|||
|
|
@ -35,8 +35,9 @@ const advancedScenario0024Data: Partial<ITestData> = {
|
|||
endorsements: undefined,
|
||||
isUseVehicleOnPolicy: false,
|
||||
isVehicleLookupValidations: false,
|
||||
isVehicleSelectBailout: true,
|
||||
isMoldingQuestion: true,
|
||||
isVehicleSelectBailout: false,
|
||||
isAddressLookupValidations: true,
|
||||
isMoldingQuestion: false,
|
||||
isSafelite: true,
|
||||
servicePackage: faker.helpers.enumValue(ServicePackage),
|
||||
customerDetails: customerDetails,
|
||||
|
|
@ -49,11 +50,15 @@ const advancedScenario0024Data: Partial<ITestData> = {
|
|||
policySoap: policySoap,
|
||||
vehicleDetails: {
|
||||
year: '2015',
|
||||
make: 'Honda',
|
||||
model: 'Accord',
|
||||
style: '4 door sedan',
|
||||
vehicleLookupType: VehicleLookupType.Vin,
|
||||
vin: '0HGCR2E30FA099831',
|
||||
make: 'Ford',
|
||||
model: 'F Series F150',
|
||||
style: '2 door super cab',
|
||||
vehicleLookupType: VehicleLookupType.Address,
|
||||
address: [
|
||||
{ street: '9 Test Street', city: 'Columbus', state: 'OH', postalCode: '43220', lastName: 'Test' },
|
||||
{ street: '8621 GREENLEAF AVE', city: 'Whittier', state: 'California', postalCode: '90602', lastName: 'Johnson' },
|
||||
{ street: '10212 JEWEL CT', city: 'Conroe', state: 'Texas', postalCode: '77385', lastName: 'Reed' }
|
||||
],
|
||||
},
|
||||
vehicleDamage: [
|
||||
VehicleDamage.WindshieldCrack,
|
||||
|
|
@ -74,7 +79,7 @@ for (const client of advancedClients) {
|
|||
data.clientTag = client.clientTag;
|
||||
const tc = new TestCase({
|
||||
name: `0024a Advanced client Unlisted Vehicle Bailout: "${client.accountName}"`,
|
||||
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@Advanced'],
|
||||
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@Advanced', '@INSR-2057'],
|
||||
testData: data
|
||||
}, undefined, '0024a');
|
||||
advancedScenario0024TestCases.push(tc);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,85 @@
|
|||
import ClientData from "@business-logic/data/ClientData";
|
||||
import TestCase from "@business-logic/types/TestCase";
|
||||
import { DamageType, PartQuestionType, PaymentType, 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";
|
||||
|
||||
const nextWeekday = getNextWeekday();
|
||||
const customerDetails: ICustomerDetails = {
|
||||
firstName: faker.person.firstName(),
|
||||
lastName: faker.person.lastName(),
|
||||
email: 'itqatest@safelite.com',
|
||||
phoneNumber: '614-531-0031',
|
||||
notes: 'Automated Test',
|
||||
address: {
|
||||
street: faker.location.streetAddress(),
|
||||
city: 'Columbus',
|
||||
state: 'OH',
|
||||
postalCode: '43220',
|
||||
country: 'United States'
|
||||
}
|
||||
}
|
||||
|
||||
const policyNumber = `~AutomatedScenario0025a${faker.string.uuid().substring(0, 6)}`;
|
||||
const policySoap = MockPolicyData.getPolicySoapByScenario('0025a', customerDetails, policyNumber);
|
||||
|
||||
const advancedScenario0025Data: Partial<ITestData> = {
|
||||
clientTag: '',
|
||||
isDuplicateClaim: false,
|
||||
isPolicyFound: false,
|
||||
isNoComp: false,
|
||||
hasStateLawPopup: false,
|
||||
endorsements: undefined,
|
||||
isUseVehicleOnPolicy: false,
|
||||
isVehicleLookupValidations: false,
|
||||
bailoutFlags: {
|
||||
isVehicleSelectBailout: true,
|
||||
},
|
||||
isMoldingQuestion: true,
|
||||
isSafelite: true,
|
||||
servicePackage: faker.helpers.enumValue(ServicePackage),
|
||||
customerDetails: customerDetails,
|
||||
claimDetails: {
|
||||
policyNumber: policyNumber,
|
||||
policyDeductible: 0.00,
|
||||
damageDate: '2017-06-02',
|
||||
damageCause: DamageType.Vandalism
|
||||
},
|
||||
policySoap: policySoap,
|
||||
vehicleDetails: {
|
||||
year: '2015',
|
||||
make: 'Honda',
|
||||
model: 'Accord',
|
||||
style: '4 door sedan',
|
||||
vehicleLookupType: VehicleLookupType.Vin,
|
||||
vin: '0HGCR2E30FA099831',
|
||||
},
|
||||
vehicleDamage: [
|
||||
VehicleDamage.WindshieldCrack,
|
||||
],
|
||||
appointmentDetails: {
|
||||
serviceLocation: ServiceLocation.InShop,
|
||||
shopAddress: undefined,
|
||||
appointmentDate: nextWeekday
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
// TODO: Add validation for deductible/covered amount
|
||||
const advancedClients = ClientData.getAdvancedClients();
|
||||
const advancedScenario0025TestCases: TestCase[] = [];
|
||||
for (const client of advancedClients) {
|
||||
const data = { ...advancedScenario0025Data };
|
||||
data.clientTag = client.clientTag;
|
||||
const tc = new TestCase({
|
||||
name: `0025a Advanced client Unlisted Vehicle Bailout: "${client.accountName}"`,
|
||||
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@Advanced', '@INSR-2057'],
|
||||
testData: data
|
||||
}, undefined, '00255a');
|
||||
advancedScenario0025TestCases.push(tc);
|
||||
}
|
||||
|
||||
export default advancedScenario0025TestCases;
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
import ClientData from "@business-logic/data/ClientData";
|
||||
import TestCase from "@business-logic/types/TestCase";
|
||||
import { DamageType, 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";
|
||||
|
||||
const nextWeekday = getNextWeekday();
|
||||
const customerDetails: ICustomerDetails = {
|
||||
firstName: faker.person.firstName(),
|
||||
lastName: faker.person.lastName(),
|
||||
email: 'itqatest@safelite.com',
|
||||
phoneNumber: '614-531-0031',
|
||||
notes: 'Automated Test',
|
||||
address: {
|
||||
street: faker.location.streetAddress(),
|
||||
city: 'PALM COAST',
|
||||
state: 'FL',
|
||||
postalCode: '32137-8523',
|
||||
country: 'United States'
|
||||
}
|
||||
}
|
||||
|
||||
const policyNumber = `~AutomatedScenario0026a${faker.string.uuid().substring(0, 6)}`;
|
||||
const policySoap = MockPolicyData.getPolicySoapByScenario('0026a', customerDetails, policyNumber);
|
||||
|
||||
const advancedScenario0026aData: Partial<ITestData> = {
|
||||
clientTag: '',
|
||||
isDuplicateClaim: false,
|
||||
isPolicyFound: true,
|
||||
isNoComp: false,
|
||||
hasStateLawPopup: false,
|
||||
isRecalNotification: true,
|
||||
endorsements: undefined,
|
||||
bailoutFlags: {
|
||||
isDoNotSeeMyShopBailout: true
|
||||
},
|
||||
vehiclePartQuestions: [
|
||||
],
|
||||
isSafelite: false,
|
||||
servicePackage: faker.helpers.enumValue(ServicePackage),
|
||||
customerDetails: customerDetails,
|
||||
claimDetails: {
|
||||
policyNumber: policyNumber,
|
||||
policyDeductible: 0,
|
||||
damageDate: '2022-07-26',
|
||||
damageCause: faker.helpers.enumValue(DamageType),
|
||||
},
|
||||
policySoap: policySoap,
|
||||
vehicleDetails: {
|
||||
year: '2021',
|
||||
make: 'Subaru',
|
||||
model: 'Outback',
|
||||
style: ''
|
||||
},
|
||||
vehicleDamage: [
|
||||
VehicleDamage.WindshieldCrack,
|
||||
],
|
||||
appointmentDetails: {
|
||||
serviceLocation: ServiceLocation.InShop,
|
||||
shopAddress: undefined,
|
||||
appointmentDate: nextWeekday
|
||||
},
|
||||
paymentDetails: {
|
||||
paymentType: PaymentType.PayAtService
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// TODO: Add validation for deductible/covered amount
|
||||
|
||||
const advancedClients = ClientData.getAdvancedClients();
|
||||
const advancedScenario0026aTestCases: TestCase[] = [];
|
||||
for (const client of advancedClients) {
|
||||
const data = { ...advancedScenario0026aData };
|
||||
data.clientTag = client.clientTag;
|
||||
const tc = new TestCase({
|
||||
name: `0026a Advanced Replace Deductible Client: "${client.accountName}"`,
|
||||
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@Advanced', '@INSR-2057'],
|
||||
testData: data
|
||||
}, undefined, '0026a');
|
||||
advancedScenario0026aTestCases.push(tc);
|
||||
}
|
||||
|
||||
export default advancedScenario0026aTestCases;
|
||||
94
playwright-tests/tests/advanced/0028a_ItacCancelMyClaim.ts
Normal file
94
playwright-tests/tests/advanced/0028a_ItacCancelMyClaim.ts
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
import ClientData from "@business-logic/data/ClientData";
|
||||
import TestCase from "@business-logic/types/TestCase";
|
||||
import { DamageType, EndorsementType, 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: '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 = `~AutomatedScenario0028a${faker.string.uuid().substring(0, 6)}`;
|
||||
const policySoap = MockPolicyData.getPolicySoapByScenario('0028a', customerDetails, policyNumber);
|
||||
|
||||
const advancedScenario0028aData: Partial<ITestData> = {
|
||||
clientTag: '',
|
||||
isDuplicateClaim: false,
|
||||
isPolicyFound: true,
|
||||
isNoComp: false,
|
||||
isItac: true,
|
||||
hasStateLawPopup: false,
|
||||
bailoutFlags: {
|
||||
isRequestCallbackBailout: true,
|
||||
},
|
||||
isVehicleSelectBailout: false,
|
||||
endorsements: [
|
||||
{
|
||||
endorsementType: EndorsementType.Educator,
|
||||
isOnPolicy: true,
|
||||
isClickYes: false
|
||||
}
|
||||
],
|
||||
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: '2013',
|
||||
make: 'Ford',
|
||||
model: 'Econoline',
|
||||
style: ''
|
||||
},
|
||||
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 advancedScenario0028aTestCases: TestCase[] = [];
|
||||
for (const client of advancedClients) {
|
||||
const data = { ...advancedScenario0028aData };
|
||||
data.clientTag = client.clientTag;
|
||||
const tc = new TestCase({
|
||||
name: `0028a Advanced ITAC Cancel My Claim: "${client.accountName}"`,
|
||||
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@Advanced', '@INSR-2057'],
|
||||
testData: data
|
||||
}, undefined, '0028a');
|
||||
advancedScenario0028aTestCases.push(tc);
|
||||
}
|
||||
|
||||
export default advancedScenario0028aTestCases;
|
||||
82
playwright-tests/tests/advanced/0029a_HeavyVehicleBailout.ts
Normal file
82
playwright-tests/tests/advanced/0029a_HeavyVehicleBailout.ts
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
import ClientData from "@business-logic/data/ClientData";
|
||||
import TestCase from "@business-logic/types/TestCase";
|
||||
import { DamageType, PartQuestionType, PaymentType, 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";
|
||||
|
||||
const nextWeekday = getNextWeekday();
|
||||
const customerDetails: ICustomerDetails = {
|
||||
firstName: faker.person.firstName(),
|
||||
lastName: faker.person.lastName(),
|
||||
email: 'itqatest@safelite.com',
|
||||
phoneNumber: '614-531-0031',
|
||||
notes: 'Automated Test',
|
||||
address: {
|
||||
street: faker.location.streetAddress(),
|
||||
city: 'San Jose',
|
||||
state: 'CA',
|
||||
postalCode: '97230-6373',
|
||||
country: 'United States'
|
||||
}
|
||||
}
|
||||
|
||||
const policyNumber = `~AutomatedScenario0029a${faker.string.uuid().substring(0, 6)}`;
|
||||
const policySoap = MockPolicyData.getPolicySoapByScenario('0029a', customerDetails, policyNumber);
|
||||
|
||||
const advancedScenario0029Data: Partial<ITestData> = {
|
||||
clientTag: '',
|
||||
isDuplicateClaim: false,
|
||||
isPolicyFound: true,
|
||||
isNoComp: false,
|
||||
endorsements: undefined,
|
||||
isUseVehicleOnPolicy: false,
|
||||
servicePackage: faker.helpers.enumValue(ServicePackage),
|
||||
customerDetails: customerDetails,
|
||||
bailoutFlags: {
|
||||
isHeavyTruckVehicleBailout: true,
|
||||
},
|
||||
claimDetails: {
|
||||
policyNumber: policyNumber,
|
||||
policyDeductible: 500,
|
||||
damageDate: '2017-06-02',
|
||||
damageCause: DamageType.Vandalism
|
||||
},
|
||||
policySoap: policySoap,
|
||||
vehicleDetails: {
|
||||
year: '2017',
|
||||
make: 'Freightliner',
|
||||
model: '114sd',
|
||||
vehicleLookupType: VehicleLookupType.Vin,
|
||||
vin: '1FUJG3DV5HHJH2985',
|
||||
},
|
||||
vehicleDamage: [
|
||||
VehicleDamage.WindshieldCrack,
|
||||
],
|
||||
appointmentDetails: {
|
||||
serviceLocation: ServiceLocation.InShop,
|
||||
shopAddress: undefined,
|
||||
appointmentDate: nextWeekday
|
||||
},
|
||||
paymentDetails: {
|
||||
paymentType: PaymentType.PayAtService
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Add validation for deductible/covered amount
|
||||
const advancedClients = ClientData.getAdvancedClients();
|
||||
const advancedScenario0029TestCases: TestCase[] = [];
|
||||
for (const client of advancedClients) {
|
||||
const data = { ...advancedScenario0029Data };
|
||||
data.clientTag = client.clientTag;
|
||||
const tc = new TestCase({
|
||||
name: `0029a Advanced client Unlisted Vehicle: "${client.accountName}"`,
|
||||
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@Advanced', '@INSR-2057'],
|
||||
testData: data
|
||||
}, undefined, '0029a');
|
||||
advancedScenario0029TestCases.push(tc);
|
||||
}
|
||||
|
||||
export default advancedScenario0029TestCases;
|
||||
89
playwright-tests/tests/advanced/0030a_PartsServiceBailout.ts
Normal file
89
playwright-tests/tests/advanced/0030a_PartsServiceBailout.ts
Normal 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;
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
"estimatedServiceMinutesMaximum": 120,
|
||||
"days": [
|
||||
{
|
||||
"date": "2025-02-22",
|
||||
"date": "2025-03-01",
|
||||
"timeSlots": [
|
||||
{
|
||||
"id": "01813-01813-S-B*20873*ALL DAY DROP OFF",
|
||||
|
|
@ -14,7 +14,40 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"date": "2025-02-24",
|
||||
"date": "2025-03-02",
|
||||
"timeSlots": [
|
||||
{
|
||||
"id": "01813-01813-S-B*20873*ALL DAY DROP OFF",
|
||||
"startTime": "07:30",
|
||||
"endTime": "17:00",
|
||||
"offerPremium": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"date": "2025-03-03",
|
||||
"timeSlots": [
|
||||
{
|
||||
"id": "01813-01813-S-B*20873*ALL DAY DROP OFF",
|
||||
"startTime": "07:30",
|
||||
"endTime": "17:00",
|
||||
"offerPremium": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"date": "2025-03-04",
|
||||
"timeSlots": [
|
||||
{
|
||||
"id": "01813-01813-S-B*20873*ALL DAY DROP OFF",
|
||||
"startTime": "07:30",
|
||||
"endTime": "17:00",
|
||||
"offerPremium": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"date": "2025-03-24",
|
||||
"timeSlots": [
|
||||
{
|
||||
"id": "01813-01813-S-B*20875*ALL DAY DROP OFF",
|
||||
|
|
@ -25,7 +58,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"date": "2025-02-25",
|
||||
"date": "2025-03-25",
|
||||
"timeSlots": [
|
||||
{
|
||||
"id": "01813-01813-S-B*20876*ALL DAY DROP OFF",
|
||||
|
|
@ -36,7 +69,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"date": "2025-02-26",
|
||||
"date": "2025-03-26",
|
||||
"timeSlots": [
|
||||
{
|
||||
"id": "01813-01813-S-B*20877*ALL DAY DROP OFF",
|
||||
|
|
@ -47,7 +80,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"date": "2025-02-27",
|
||||
"date": "2025-04-27",
|
||||
"timeSlots": [
|
||||
{
|
||||
"id": "01813-01813-S-B*20878*ALL DAY DROP OFF",
|
||||
|
|
@ -58,7 +91,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"date": "2025-02-28",
|
||||
"date": "2025-05-28",
|
||||
"timeSlots": [
|
||||
{
|
||||
"id": "01813-01813-S-B*20879*ALL DAY DROP OFF",
|
||||
|
|
@ -69,7 +102,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"date": "2025-03-01",
|
||||
"date": "2025-06-01",
|
||||
"timeSlots": [
|
||||
{
|
||||
"id": "01813-01813-S-B*20880*ALL DAY DROP OFF",
|
||||
|
|
|
|||
Loading…
Reference in a new issue