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
This commit is contained in:
parent
1729b6e6b8
commit
d539df9550
18 changed files with 477 additions and 100 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -29,6 +29,8 @@ pnpm-debug.log*
|
|||
/playwright/.cache/
|
||||
artifacts/
|
||||
ortoni-report/
|
||||
/playwright-tests/.env.dev
|
||||
/playwright-tests/.env
|
||||
|
||||
# Misc
|
||||
coverage/*
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
# CLIENT_NAME="undefined" # TODO: evaluate necessity of this
|
||||
# CLIENT_TAG="undefined"
|
||||
# BASE_URL="https://selfservice.dev.glassclaim.com"
|
||||
|
||||
CCIS_API_AUTH= "" # Input manually
|
||||
|
||||
# DEV
|
||||
BASE_URL="https://selfservice.test.glassclaim.com"
|
||||
CCIS_API_URL="https://api.test.belronus.io" # Test API connects to our dev environment for some reason
|
||||
ADMIN_SERVICE_API_URL="https://issadminapi.dev.sagaws.net/iss-admin/api/v1/"
|
||||
|
||||
# QA
|
||||
# BASE_URL="https://selfservice.test.glassclaim.com"
|
||||
# CCIS_API_URL="https://api.test.belronus.io"
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
# CLIENT_NAME="undefined" # TODO: evaluate necessity of this
|
||||
# CLIENT_TAG="undefined"
|
||||
# BASE_URL="https://selfservice.dev.glassclaim.com"
|
||||
|
||||
CCIS_API_AUTH="" # Input manually
|
||||
|
||||
# DEV
|
||||
BASE_URL="https://selfservice.dev.glassclaim.com"
|
||||
CCIS_API_URL="https://api.test.belronus.io" # Test API connects to our dev environment for some reason
|
||||
ADMIN_SERVICE_API_URL="https://issadminapi.dev.sagaws.net/iss-admin/api/v1/"
|
||||
|
||||
# QA
|
||||
# BASE_URL="https://selfservice.test.glassclaim.com"
|
||||
# CCIS_API_URL="https://api.test.belronus.io"
|
||||
|
|
@ -1,12 +1,15 @@
|
|||
# Avoid inline comments in your environment variable files, as they may be interpreted as part of the value
|
||||
# Set value to API auth token
|
||||
CCIS_API_AUTH=
|
||||
|
||||
# DEV
|
||||
# Test API connects to our DEV environments for some reason
|
||||
BASE_URL="https://selfservice.dev.glassclaim.com"
|
||||
CCIS_API_URL="https://api.test.belronus.io" # Test API connects to our DEV environments for some reason
|
||||
CCIS_API_URL="https://api.test.belronus.io"
|
||||
ADMIN_SERVICE_API_URL="https://issadminapi.dev.sagaws.net/iss-admin/api/v1/"
|
||||
DIGITAL_API_URL="https://digitalapi.dev.safelite.io"
|
||||
ENABLE_ACCESSIBILITY_TESTING = true
|
||||
ENABLE_MOCK_TESTING = false
|
||||
ENABLE_ACCESSIBILITY_TESTING=true
|
||||
ENABLE_MOCK_TESTING=false
|
||||
|
||||
|
||||
# QA
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -50,6 +50,9 @@ export enum VehicleDamage {
|
|||
WindshieldTwoChips,
|
||||
WindshieldThreeChips,
|
||||
WindshieldCrack,
|
||||
WindshieldCrackSingleWindshield,
|
||||
WindshieldCrackDriverSide,
|
||||
WindshieldCrackPassengerSide,
|
||||
RearWindow,
|
||||
DriverFrontDoor,
|
||||
DriverRearDoor,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import { ServicePackage, VehicleDamage } from "./Enums"
|
||||
import { IAppointmentDetails, IClaimDetails, ICustomerDetails, IEndorsementDetails, IPartQuestion, IPaymentDetails, IVehicleDetails } from "./CustomerDetails"
|
||||
import IBailoutFlags from "./IBailoutFlags"
|
||||
import { IPart } from "./DigitalApi"
|
||||
|
||||
export interface ITestData {
|
||||
isMockTesting: boolean,
|
||||
|
|
@ -37,6 +36,8 @@ export interface ITestData {
|
|||
isRecalNotification: boolean,
|
||||
isRecalWarning: boolean,
|
||||
isSeparateApptsWarning: boolean, // IF true, check for the separate appts warning on VehicleDamagePage
|
||||
isAuthenticationRequired: boolean
|
||||
isAuthenticationRequired: boolean,
|
||||
isMoldingQuestion: boolean,
|
||||
}
|
||||
isNonServiceable: boolean, // For the flow where a a non-serviceable vehicle is selected on lookup
|
||||
isNonServiceableVin: boolean, // For the flow where a serviceable vehicle is selected on lookup, but then the VIN of a non-serviceable vehicle is entered
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,4 +24,10 @@ export class PolicyVehiclesPage extends BasePage {
|
|||
async selectVehicleNotListed(){
|
||||
await this.page.getByText('Vehicle not listed').click();
|
||||
}
|
||||
}
|
||||
|
||||
async assertNonServiceableAlertBehavior(){
|
||||
const nonServiceableWarning = this.page.getByText('Service not available for your vehicle');
|
||||
await expect(nonServiceableWarning).toBeVisible();
|
||||
await expect(this.continueButton).toBeDisabled();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,15 @@
|
|||
import { expect, type Locator, type Page } from '@playwright/test';
|
||||
import { BasePage } from './BasePage';
|
||||
import { SideDoorDamage, VehicleDamage, WindshieldDamage } from '@business-logic/types/Enums';
|
||||
import { VehicleDamage } from '@business-logic/types/Enums';
|
||||
|
||||
export class VehicleDamagePage extends BasePage {
|
||||
readonly page: Page;
|
||||
readonly windshieldChkBox: Locator;
|
||||
readonly crackButton: Locator;
|
||||
readonly chipButton: Locator;
|
||||
readonly singleWindshieldButton: Locator;
|
||||
readonly splitWindshieldDriverSideButton: Locator;
|
||||
readonly splitWindshieldPassengerSideButton: Locator;
|
||||
readonly sideDoorButton: Locator;
|
||||
readonly driverSideButton: Locator;
|
||||
readonly passengerSideButton: Locator;
|
||||
|
|
@ -30,6 +33,9 @@ export class VehicleDamagePage extends BasePage {
|
|||
this.windshieldChkBox = this.page.locator('[buttonlabel="Windshield"]');
|
||||
this.crackButton = this.page.locator('[buttonlabel="Crack"]');
|
||||
this.chipButton = this.page.locator('[buttonlabel="Chip(s)"]');
|
||||
this.singleWindshieldButton = this.page.locator('[buttonlabel="Single windshield"]');
|
||||
this.splitWindshieldDriverSideButton = this.page.locator('[buttonlabel="Split windshield, driver side"]');
|
||||
this.splitWindshieldPassengerSideButton = this.page.locator('[buttonlabel="Split windshield, passenger side"]');
|
||||
this.sideDoorButton = this.page.locator('[buttonlabel="Side door"]');
|
||||
this.driverSideButton = this.page.locator('[buttonlabel="Driver side"]');
|
||||
this.passengerSideButton = this.page.locator('[buttonlabel="Passenger side"]');
|
||||
|
|
@ -82,6 +88,21 @@ export class VehicleDamagePage extends BasePage {
|
|||
await this.windshieldChkBox.check();
|
||||
await this.selectCrack();
|
||||
break;
|
||||
case VehicleDamage.WindshieldCrackSingleWindshield:
|
||||
await this.windshieldChkBox.check();
|
||||
await this.selectCrack();
|
||||
await this.singleWindshieldButton.check();
|
||||
break;
|
||||
case VehicleDamage.WindshieldCrackDriverSide:
|
||||
await this.windshieldChkBox.check();
|
||||
await this.selectCrack();
|
||||
await this.splitWindshieldDriverSideButton.check();
|
||||
break;
|
||||
case VehicleDamage.WindshieldCrackPassengerSide:
|
||||
await this.windshieldChkBox.check();
|
||||
await this.selectCrack();
|
||||
await this.splitWindshieldPassengerSideButton.check();
|
||||
break;
|
||||
case VehicleDamage.DriverFrontDoor:
|
||||
await this.sideDoorButton.check();
|
||||
await this.driverSideButton.check();
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ export class VehicleSelectionPage extends BasePage {
|
|||
readonly makeDropdown: Locator;
|
||||
readonly modelDropdown: Locator;
|
||||
readonly styleDropdown: Locator;
|
||||
readonly nonServiceableWarning: Locator;
|
||||
|
||||
issPageValue = 'vehicle-selection';
|
||||
|
||||
|
|
@ -18,6 +19,7 @@ export class VehicleSelectionPage extends BasePage {
|
|||
this.makeDropdown = this.page.locator('#makeQuestionField');
|
||||
this.modelDropdown = this.page.locator('#modelQuestionField');
|
||||
this.styleDropdown = this.page.locator('#styleQuestionField');
|
||||
this.nonServiceableWarning = this.page.getByText('Service not available for your vehicle');
|
||||
// this.validateURL(this.url);
|
||||
}
|
||||
|
||||
|
|
@ -32,11 +34,13 @@ export class VehicleSelectionPage extends BasePage {
|
|||
await this.modelDropdown.press('Tab');
|
||||
if (vehicleDetails.style) {
|
||||
await this.styleDropdown.selectOption(vehicleDetails.style);
|
||||
} else {
|
||||
if (await this.styleDropdown.inputValue() === 'Select an option') {
|
||||
await this.styleDropdown.selectOption({ index: 1 })
|
||||
}
|
||||
|
||||
} else if (await this.styleDropdown.inputValue() === 'Select an option') {
|
||||
await this.styleDropdown.selectOption({ index: 1 })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async assertNonServiceableAlertBehavior() {
|
||||
await expect(this.nonServiceableWarning).toBeVisible();
|
||||
await expect(this.continueButton).toBeDisabled();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import test, { expect, type Locator, type Page } from '@playwright/test';
|
||||
import { expect, type Locator, type Page } from '@playwright/test';
|
||||
import { BasePage } from './BasePage';
|
||||
|
||||
export class VinLookupPage extends BasePage {
|
||||
|
|
@ -39,4 +39,11 @@ export class VinLookupPage extends BasePage {
|
|||
await this.continueButton.click();
|
||||
await this.lookupVinForMe.click();
|
||||
}
|
||||
}
|
||||
|
||||
async handleNonServiceableVin() {
|
||||
await this.continueButton.click();
|
||||
const nonServiceableWarning = this.page.getByText('Service not available for your vehicle');
|
||||
await expect(nonServiceableWarning).toBeVisible();
|
||||
await expect(this.continueButton).toBeDisabled();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import essentialTpaNotEnabledTestCases from "./0003_EssentialTpaNotEnabledBailou
|
|||
import essentialDoNotSeeShopTestCases from "./0011_EssentialDoNotSeeShopBailout";
|
||||
import essentialVehicleNotFoundTestCases from "./0010_EssentialVehicleNotFoundBailout";
|
||||
import essentialPartsServiceErrorBailout_0009 from "./0009_EssentialPartsServiceErrorBailout";
|
||||
import essentialHeavyVehicleBailoutTestCases from "./0008_EssentialHeavyVehicleBailout";
|
||||
import essentialRepairMobileTests from "./0014_EssentialRepairMobile";
|
||||
import essentialReplacePartsQuestionsDropoff_0015 from "./0015_EssentialReplacePartsQuestionsDropoff";
|
||||
import essentialUniqueGlassTests from "./0012_EssentialUniqueGlass";
|
||||
|
|
@ -26,6 +25,9 @@ import essentialReplaceDynamicAdasTests from "./0005_EssentialReplaceDynamicAdas
|
|||
import essentialReplaceStaticAdasTests from "./0001_EssentialReplaceStatisAdas";
|
||||
import essentialVehicleLookupBailoutTests from "./0020_EssentialVehicleLookupBailout";
|
||||
import essentialPriceServiceErrorBailoutTests from "./0021_EssentialPriceServiceErrorBailout";
|
||||
import essentialServiceableBigTruckTestCases from "./0022_EssentialServiceableBigTruck";
|
||||
import essentialNonServiceableBigTruckTestCases from "./0023_EssentialNonServiceableBigTruck";
|
||||
import essentialNonServiceableBigTruckVinTestCases from "./0024_EssentialNonServiceableBigTruckVin";
|
||||
import { forceAPIError, mockApiManager } from "@impl/utils/HttpUtils";
|
||||
|
||||
import advancedScenario0002TestCases from "./advanced/0002a_ReplaceOemEndorsement";
|
||||
|
|
@ -57,12 +59,15 @@ import advancedScenario0026aTestCases from "./advanced/0026a_NoDeductibleAdasBai
|
|||
import advancedScenario0028aTestCases from "./advanced/0028a_ItacCancelMyClaim";
|
||||
import advancedScenario0029aTestCases from "./advanced/0029a_HeavyVehicleBailout";
|
||||
import advancedScenario0030aTestCases from "./advanced/0030a_PartsServiceBailout";
|
||||
import advancedScenario0031aTestCases from "./advanced/0031a_ReplaceServiceableBigTruck";
|
||||
import advancedScenario0032aTestCases from "./advanced/0032a_DeclineNonServiceableBigTruck";
|
||||
|
||||
|
||||
|
||||
test.describe.parallel('ISS QA Automation Regression', () => {
|
||||
const ruleEngine = new RuleEngine<TestCase>();
|
||||
const options = new ValidationOptions();
|
||||
//TODO: Add new tests
|
||||
addSmokeTagToRandomTest(essentialReplaceStaticAdasTests);
|
||||
addSmokeTagToRandomTest(essentialRepairInShopAcuraTests);
|
||||
addSmokeTagToRandomTest(essentialTpaNotEnabledTestCases);
|
||||
|
|
@ -70,7 +75,6 @@ test.describe.parallel('ISS QA Automation Regression', () => {
|
|||
addSmokeTagToRandomTest(essentialReplaceDynamicAdasTests);
|
||||
addSmokeTagToRandomTest(essentialRepairMobileHyundaiTests);
|
||||
addSmokeTagToRandomTest(essentialVehicleNotFoundTestCases);
|
||||
addSmokeTagToRandomTest(essentialHeavyVehicleBailoutTestCases);
|
||||
addSmokeTagToRandomTest(essentialPartsServiceErrorBailout_0009);
|
||||
addSmokeTagToRandomTest(essentialDoNotSeeShopTestCases);
|
||||
addSmokeTagToRandomTest(essentialUniqueGlassTests);
|
||||
|
|
@ -83,6 +87,9 @@ test.describe.parallel('ISS QA Automation Regression', () => {
|
|||
addSmokeTagToRandomTest(essentialTpaEnabledReplaceRecal_0019);
|
||||
addSmokeTagToRandomTest(essentialVehicleLookupBailoutTests);
|
||||
addSmokeTagToRandomTest(essentialPriceServiceErrorBailoutTests);
|
||||
addSmokeTagToRandomTest(essentialServiceableBigTruckTestCases);
|
||||
addSmokeTagToRandomTest(essentialNonServiceableBigTruckTestCases);
|
||||
addSmokeTagToRandomTest(essentialNonServiceableBigTruckVinTestCases);
|
||||
|
||||
//Scenario 1
|
||||
for (const testCase of essentialReplaceStaticAdasTests) {
|
||||
|
|
@ -109,10 +116,6 @@ test.describe.parallel('ISS QA Automation Regression', () => {
|
|||
for (const testCase of essentialRepairMobileHyundaiTests) {
|
||||
test(...prepareTest(testCase, run, options, ruleEngine));
|
||||
}
|
||||
//Scenario 8
|
||||
for (const testCase of essentialHeavyVehicleBailoutTestCases) {
|
||||
test(...prepareTest(testCase, run, options, ruleEngine));
|
||||
}
|
||||
//Scenario 9
|
||||
for (const testCase of essentialPartsServiceErrorBailout_0009) {
|
||||
test(...prepareTest(testCase, run, options, ruleEngine));
|
||||
|
|
@ -165,6 +168,20 @@ test.describe.parallel('ISS QA Automation Regression', () => {
|
|||
for (const testCase of essentialPriceServiceErrorBailoutTests) {
|
||||
test(...prepareTest(testCase, run, options, ruleEngine));
|
||||
}
|
||||
//Scenario 22
|
||||
for (const testCase of essentialServiceableBigTruckTestCases) {
|
||||
test(...prepareTest(testCase, run, options, ruleEngine));
|
||||
}
|
||||
//Scenario 23
|
||||
for (const testCase of essentialNonServiceableBigTruckTestCases) {
|
||||
test(...prepareTest(testCase, run, options, ruleEngine));
|
||||
}
|
||||
// Scenario 24
|
||||
for (const testCase of essentialNonServiceableBigTruckVinTestCases) {
|
||||
test(...prepareTest(testCase, run, options, ruleEngine));
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Advanced Scenarios
|
||||
|
||||
|
|
@ -313,6 +330,16 @@ test.describe.parallel('ISS QA Automation Regression', () => {
|
|||
for (const testCase of advancedScenario0030aTestCases) {
|
||||
test(...prepareTest(testCase, run, options, ruleEngine));
|
||||
}
|
||||
|
||||
// Scenario 0031a
|
||||
for (const testCase of advancedScenario0031aTestCases) {
|
||||
test(...prepareTest(testCase, run, options, ruleEngine));
|
||||
}
|
||||
|
||||
// Scenario 0032a
|
||||
for (const testCase of advancedScenario0032aTestCases) {
|
||||
test(...prepareTest(testCase, run, options, ruleEngine));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
|
@ -358,7 +385,8 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
partQuestions, paymentDetails, isNoComp, isItac, isRecalNotification,
|
||||
isRecalWarning, servicePackage, hasStateLawPopup, otherVehiclesOnPolicy,
|
||||
isSeparateApptsWarning, vehiclePartQuestions, editVehicleDetails, isAddressLookupValidations,
|
||||
hasMilitaryWarning, capabilityQuestions, isUseVehicleOnPolicy, isVehicleLookupValidations, isMoldingQuestion } = testCase.testData;
|
||||
hasMilitaryWarning, capabilityQuestions, isUseVehicleOnPolicy,
|
||||
isVehicleLookupValidations, isMoldingQuestion, isNonServiceable, isNonServiceableVin } = testCase.testData;
|
||||
|
||||
let { isPolicyFound } = testCase.testData; // Allow isPolicyFound to be re-assigned
|
||||
|
||||
|
|
@ -374,8 +402,8 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
|
||||
// Destructure bailout flags
|
||||
const { isVehicleSelectBailout, isDoNotSeeMyShopBailout, isTpaNotEnabledBailout,
|
||||
isHeavyTruckVehicleBailout, isPartsServiceErrorBailout,
|
||||
isVehicleLookupBailout, isPriceServiceErrorBailout, isRequestCallbackBailout } = testCase.testData.bailoutFlags || {};
|
||||
isPartsServiceErrorBailout, isVehicleLookupBailout, isPriceServiceErrorBailout,
|
||||
isRequestCallbackBailout } = testCase.testData.bailoutFlags || {};
|
||||
|
||||
const repairTypes: VehicleDamage[] = [
|
||||
VehicleDamage.WindshieldOneChip,
|
||||
|
|
@ -424,15 +452,15 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
} else {
|
||||
// Select vehicle
|
||||
await policyVehiclesPage.selectVehicle(vehicleDetails!);
|
||||
if (isNonServiceable) {
|
||||
await policyVehiclesPage.assertNonServiceableAlertBehavior();
|
||||
return;
|
||||
}
|
||||
await policyVehiclesPage.nextPage();
|
||||
}
|
||||
});
|
||||
|
||||
if (isHeavyTruckVehicleBailout) {
|
||||
await test.step('BailoutPage >> Heavy Vehicle Bailout', async () => {
|
||||
await bailoutPage.validateURL(bailoutPage.issPageValue);
|
||||
await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.HeavyTruckVehicle);
|
||||
});
|
||||
if (isNonServiceable) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -460,9 +488,17 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
await test.step('VehicleDetailsPage >> Select Vehicle', async () => {
|
||||
await vehicleSelectionPage.validateURL(vehicleSelectionPage.issPageValue);
|
||||
await vehicleSelectionPage.selectVehicle(vehicleDetails!);
|
||||
if (isNonServiceable) {
|
||||
await vehicleSelectionPage.assertNonServiceableAlertBehavior();
|
||||
return;
|
||||
}
|
||||
await vehicleSelectionPage.nextPage();
|
||||
});
|
||||
|
||||
if (isNonServiceable) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isVehicleLookupBailout) {
|
||||
await test.step('BailoutPage >> Vehicle Lookup Bailout', async () => {
|
||||
await bailoutPage.validateURL(bailoutPage.issPageValue);
|
||||
|
|
@ -470,14 +506,6 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (isHeavyTruckVehicleBailout) {
|
||||
await test.step('BailoutPage >> Heavy Vehicle Bailout', async () => {
|
||||
await bailoutPage.validateURL(bailoutPage.issPageValue);
|
||||
await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.HeavyTruckVehicle);
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (editVehicleDetails) {
|
||||
|
|
@ -587,8 +615,15 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
await test.step('VinLookupPage >> Lookup by VIN: ' + vehicleDetails!.vin!, async () => {
|
||||
await vinLookupPage.validateURL(vinLookupPage.issPageValue);
|
||||
await vinLookupPage.enterVin(vehicleDetails!.vin!, isVehicleLookupValidations);
|
||||
if (isNonServiceableVin) {
|
||||
await vinLookupPage.handleNonServiceableVin();
|
||||
return;
|
||||
}
|
||||
await vinLookupPage.nextPage();
|
||||
});
|
||||
if (isNonServiceableVin) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
79
playwright-tests/tests/0022_EssentialServiceableBigTruck.ts
Normal file
79
playwright-tests/tests/0022_EssentialServiceableBigTruck.ts
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
import ClientData from "@business-logic/data/ClientData";
|
||||
import TestCase from "@business-logic/types/TestCase";
|
||||
import { DamageType, PartQuestionType, 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 essentialServiceableBigTruckData: Partial<ITestData> = {
|
||||
clientTag: 'ALL_ESSENTIAL',
|
||||
isDuplicateClaim: false,
|
||||
isPolicyFound: false,
|
||||
endorsements: [],
|
||||
isReplace: true,
|
||||
vehiclePartQuestions: [
|
||||
{
|
||||
partQuestionType: PartQuestionType.WindshieldColor,
|
||||
isOnPage: true,
|
||||
optionToSelect: 'Green Tint',
|
||||
secondaryQuestionOptionToSelect: 'one-piece, w/lane departure warning system',
|
||||
},
|
||||
],
|
||||
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: '2021',
|
||||
make: 'Freightliner',
|
||||
model: 'Cascadia',
|
||||
style: 'conventional cab',
|
||||
vin: '3AKJHPDV7MSLJ2958',
|
||||
vehicleLookupType: VehicleLookupType.Vin,
|
||||
},
|
||||
vehicleDamage: [
|
||||
VehicleDamage.WindshieldCrackSingleWindshield,
|
||||
],
|
||||
appointmentDetails: {
|
||||
serviceLocation: ServiceLocation.InShop,
|
||||
shopAddress: '6826 Sawmill Rd, Columbus, OH 43235',
|
||||
appointmentDate: nextWeekday
|
||||
},
|
||||
isUseVehicleOnPolicy: false,
|
||||
}
|
||||
|
||||
const essentialClients = ClientData.getEssentialClients();
|
||||
const essentialServiceableBigTruckTestCases: TestCase[] = [];
|
||||
for (const client of essentialClients) {
|
||||
const data = { ...essentialServiceableBigTruckData };
|
||||
data.clientTag = client.clientTag;
|
||||
data.isAuthenticationRequired = client.clientFlags.isAuthenticationEnabled ?? false
|
||||
const tc = new TestCase({
|
||||
name: `0022 Essential Serviceable Big Truck Client: "${client.accountName}"`,
|
||||
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@BigTruck', '@Essentials'],
|
||||
testData: data
|
||||
}, undefined, '0022');
|
||||
essentialServiceableBigTruckTestCases.push(tc);
|
||||
}
|
||||
|
||||
export default essentialServiceableBigTruckTestCases;
|
||||
|
|
@ -1,29 +1,26 @@
|
|||
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 { 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 essentialHeavyVehicleBailoutData: Partial<ITestData> = {
|
||||
const essentialNonServiceableBigTruckData: Partial<ITestData> = {
|
||||
clientTag: 'ALL_ESSENTIAL',
|
||||
isDuplicateClaim: false,
|
||||
isPolicyFound: false,
|
||||
endorsements: [],
|
||||
isReplace: false,
|
||||
isReplace: true,
|
||||
partQuestions: undefined,
|
||||
isSafelite: true,
|
||||
bailoutFlags: {
|
||||
isHeavyTruckVehicleBailout: 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]/),
|
||||
phoneNumber: faker.helpers.fromRegExp(/[2-9][0-9][0-9]-[0-9]{3}-[0-9]{4}/),
|
||||
notes: 'Automated Test',
|
||||
address: {
|
||||
street: faker.location.streetAddress(),
|
||||
|
|
@ -40,42 +37,35 @@ const essentialHeavyVehicleBailoutData: Partial<ITestData> = {
|
|||
damageCause: DamageType.Other
|
||||
},
|
||||
vehicleDetails: {
|
||||
year: '2017',
|
||||
make: 'Freightliner',
|
||||
model: '114sd',
|
||||
style: 'conventional cab' // TODO: Check correctness of vehicle style
|
||||
year: '2016',
|
||||
make: 'Isuzu',
|
||||
model: 'Reach',
|
||||
style: 'step van',
|
||||
},
|
||||
vehicleDamage: [
|
||||
// VehicleDamage.WindshieldThreeChips,
|
||||
VehicleDamage.WindshieldCrack,
|
||||
// VehicleDamage.DriverFrontDoor,
|
||||
// VehicleDamage.DriverQuarterPanel,
|
||||
// VehicleDamage.DriverRearDoor,
|
||||
// VehicleDamage.PassengerFrontDoor,
|
||||
// VehicleDamage.PassengerQuarterPanel,
|
||||
// VehicleDamage.PassengerRearDoor,
|
||||
// VehicleDamage.RearWindow
|
||||
],
|
||||
appointmentDetails: {
|
||||
serviceLocation: ServiceLocation.InShop,
|
||||
shopAddress: '6826 Sawmill Rd, Columbus, OH 43235',
|
||||
appointmentDate: nextWeekday
|
||||
}
|
||||
},
|
||||
isNonServiceable: true,
|
||||
|
||||
}
|
||||
|
||||
const essentialClients = ClientData.getEssentialClients();
|
||||
const essentialHeavyVehicleBailoutTestCases: TestCase[] = [];
|
||||
const essentialNonServiceableBigTruckTestCases: TestCase[] = [];
|
||||
for (const client of essentialClients) {
|
||||
const data = {...essentialHeavyVehicleBailoutData};
|
||||
const data = {...essentialNonServiceableBigTruckData};
|
||||
data.clientTag = client.clientTag;
|
||||
data.isAuthenticationRequired = client.clientFlags.isAuthenticationEnabled ?? false
|
||||
const tc = new TestCase({
|
||||
name: `0008 Essential Heavy Vehicle Bailout Client: "${client.accountName}"`,
|
||||
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@Bailout', '@HeavyVehicle', '@Essentials'],
|
||||
name: `0023 Essential Non-Serviceable Big Truck Client: "${client.accountName}"`,
|
||||
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@BigTruck', '@Essentials'],
|
||||
testData: data
|
||||
}, undefined, '0008');
|
||||
essentialHeavyVehicleBailoutTestCases.push(tc);
|
||||
}, undefined, '0023');
|
||||
essentialNonServiceableBigTruckTestCases.push(tc);
|
||||
}
|
||||
|
||||
export default essentialHeavyVehicleBailoutTestCases;
|
||||
export default essentialNonServiceableBigTruckTestCases;
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
import ClientData from "@business-logic/data/ClientData";
|
||||
import TestCase from "@business-logic/types/TestCase";
|
||||
import { DamageType, PartQuestionType, 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 essentialNonServiceableBigTruckVinData: Partial<ITestData> = {
|
||||
clientTag: 'ALL_ESSENTIAL',
|
||||
isDuplicateClaim: false,
|
||||
isPolicyFound: false,
|
||||
endorsements: [],
|
||||
isReplace: true,
|
||||
vehiclePartQuestions: [
|
||||
{
|
||||
partQuestionType: PartQuestionType.WindshieldColor,
|
||||
isOnPage: true,
|
||||
optionToSelect: 'Green Tint',
|
||||
secondaryQuestionOptionToSelect: 'one-piece, w/lane departure warning system',
|
||||
},
|
||||
],
|
||||
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: '2021',
|
||||
make: 'Freightliner',
|
||||
model: 'Cascadia',
|
||||
style: 'conventional cab',
|
||||
vin: 'JALB4T177G7W00847',
|
||||
vehicleLookupType: VehicleLookupType.Vin,
|
||||
},
|
||||
vehicleDamage: [
|
||||
VehicleDamage.WindshieldCrackSingleWindshield,
|
||||
],
|
||||
appointmentDetails: {
|
||||
serviceLocation: ServiceLocation.InShop,
|
||||
shopAddress: '6826 Sawmill Rd, Columbus, OH 43235',
|
||||
appointmentDate: nextWeekday
|
||||
},
|
||||
isNonServiceableVin: true,
|
||||
}
|
||||
|
||||
const essentialClients = ClientData.getEssentialClients();
|
||||
const essentialNonServiceableBigTruckVinTestCases: TestCase[] = [];
|
||||
for (const client of essentialClients) {
|
||||
const data = { ...essentialNonServiceableBigTruckVinData };
|
||||
data.clientTag = client.clientTag;
|
||||
data.isAuthenticationRequired = client.clientFlags.isAuthenticationEnabled ?? false
|
||||
const tc = new TestCase({
|
||||
name: `0024 Essential Non-Serviceable Big Truck Vin Client: "${client.accountName}"`,
|
||||
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@BigTruck', '@Essentials'],
|
||||
testData: data
|
||||
}, undefined, '0024');
|
||||
essentialNonServiceableBigTruckVinTestCases.push(tc);
|
||||
}
|
||||
|
||||
export default essentialNonServiceableBigTruckVinTestCases;
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
import ClientData from "@business-logic/data/ClientData";
|
||||
import TestCase from "@business-logic/types/TestCase";
|
||||
import { DamageType, PartQuestionType, 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: 'HOUSTON',
|
||||
state: 'TX',
|
||||
postalCode: '77001',
|
||||
country: 'United States'
|
||||
}
|
||||
}
|
||||
|
||||
const policyNumber = `~AutomatedScenario0031a${faker.string.uuid().substring(0, 6)}`;
|
||||
const policySoap = MockPolicyData.getPolicySoapByScenario('0031a', customerDetails, policyNumber);
|
||||
|
||||
const advancedScenario0031Data: Partial<ITestData> = {
|
||||
clientTag: '',
|
||||
isDuplicateClaim: false,
|
||||
isPolicyFound: true,
|
||||
isNoComp: false,
|
||||
hasStateLawPopup: false,
|
||||
endorsements: undefined,
|
||||
partQuestions: [
|
||||
{
|
||||
partQuestionType: PartQuestionType.LaneKeepAssist,
|
||||
isOnPage: true,
|
||||
optionToSelect: 'Yes',
|
||||
}
|
||||
],
|
||||
vehiclePartQuestions: [
|
||||
{
|
||||
partQuestionType: PartQuestionType.WindshieldColor,
|
||||
isOnPage: true,
|
||||
optionToSelect: 'Green Tint',
|
||||
secondaryQuestionOptionToSelect: 'one-piece, w/lane departure warning system',
|
||||
},
|
||||
],
|
||||
isSafelite: true,
|
||||
servicePackage: faker.helpers.enumValue(ServicePackage),
|
||||
customerDetails: customerDetails,
|
||||
claimDetails: {
|
||||
policyNumber: policyNumber,
|
||||
policyDeductible: 250,
|
||||
damageDate: '2025-09-01',
|
||||
damageCause: DamageType.Rock,
|
||||
},
|
||||
policySoap: policySoap,
|
||||
vehicleDetails: {
|
||||
year: '2021',
|
||||
make: 'Freightliner',
|
||||
model: 'Cascadia',
|
||||
style: 'conventional cab',
|
||||
vin: '3AKJHPDV7MSLJ2958',
|
||||
},
|
||||
vehicleDamage: [
|
||||
VehicleDamage.WindshieldCrackSingleWindshield,
|
||||
],
|
||||
appointmentDetails: {
|
||||
serviceLocation: ServiceLocation.InShop,
|
||||
shopAddress: undefined,
|
||||
appointmentDate: nextWeekday
|
||||
},
|
||||
paymentDetails: ClientData.getDefaultPaypalDetails()//ClientData.getDefaultCreditCardDetails()
|
||||
}
|
||||
|
||||
// TODO: Add validation for deductible/covered amount
|
||||
const advancedClients = ClientData.getAdvancedClients();
|
||||
const advancedScenario0031TestCases: TestCase[] = [];
|
||||
for (const client of advancedClients) {
|
||||
const data = { ...advancedScenario0031Data };
|
||||
data.clientTag = client.clientTag;
|
||||
const tc = new TestCase({
|
||||
name: `0031a Advanced Replace Serviceable Big Truck: "${client.accountName}"`,
|
||||
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@Advanced'],
|
||||
testData: data
|
||||
}, undefined, '0031a');
|
||||
advancedScenario0031TestCases.push(tc);
|
||||
}
|
||||
|
||||
export default advancedScenario0031TestCases;
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
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";
|
||||
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: 'HOUSTON',
|
||||
state: 'TX',
|
||||
postalCode: '77001',
|
||||
country: 'United States'
|
||||
}
|
||||
}
|
||||
|
||||
const policyNumber = `~AutomatedScenario0032a${faker.string.uuid().substring(0, 6)}`;
|
||||
const policySoap = MockPolicyData.getPolicySoapByScenario('0032a', customerDetails, policyNumber);
|
||||
|
||||
const advancedScenario0032Data: Partial<ITestData> = {
|
||||
clientTag: '',
|
||||
isDuplicateClaim: false,
|
||||
isPolicyFound: true,
|
||||
isNoComp: false,
|
||||
hasStateLawPopup: false,
|
||||
endorsements: undefined,
|
||||
vehiclePartQuestions: [
|
||||
|
||||
],
|
||||
isSafelite: true,
|
||||
servicePackage: faker.helpers.enumValue(ServicePackage),
|
||||
customerDetails: customerDetails,
|
||||
claimDetails: {
|
||||
policyNumber: policyNumber,
|
||||
policyDeductible: 250,
|
||||
damageDate: '2025-09-01',
|
||||
damageCause: DamageType.Rock,
|
||||
},
|
||||
policySoap: policySoap,
|
||||
vehicleDetails: {
|
||||
year: '2016',
|
||||
make: 'Isuzu',
|
||||
model: 'Reach',
|
||||
style: 'step van',
|
||||
},
|
||||
vehicleDamage: [
|
||||
VehicleDamage.WindshieldCrack,
|
||||
],
|
||||
appointmentDetails: {
|
||||
serviceLocation: ServiceLocation.InShop,
|
||||
shopAddress: undefined,
|
||||
appointmentDate: nextWeekday
|
||||
},
|
||||
paymentDetails: ClientData.getDefaultPaypalDetails(),//ClientData.getDefaultCreditCardDetails()
|
||||
isNonServiceable: true,
|
||||
}
|
||||
|
||||
// TODO: Add validation for deductible/covered amount
|
||||
const advancedClients = ClientData.getAdvancedClients();
|
||||
const advancedScenario0032TestCases: TestCase[] = [];
|
||||
for (const client of advancedClients) {
|
||||
const data = { ...advancedScenario0032Data };
|
||||
data.clientTag = client.clientTag;
|
||||
const tc = new TestCase({
|
||||
name: `0032a Advanced Decline Non-Serviceable Big Truck: "${client.accountName}"`,
|
||||
tags: [`@${client.clientTag}`, `@${client.accountName}`, '@Advanced'],
|
||||
testData: data
|
||||
}, undefined, '0032a');
|
||||
advancedScenario0032TestCases.push(tc);
|
||||
}
|
||||
|
||||
export default advancedScenario0032TestCases;
|
||||
|
|
@ -264,7 +264,7 @@ describe('address-vehicles.vue', () => {
|
|||
make: 'Isuzu',
|
||||
model: 'Reach',
|
||||
style: 'Step Van',
|
||||
year: 2015,
|
||||
year: 2016,
|
||||
isBigTruck: true,
|
||||
canSafeliteService: false
|
||||
},
|
||||
|
|
@ -286,8 +286,8 @@ describe('address-vehicles.vue', () => {
|
|||
isBigTruck: true,
|
||||
canSafeliteService: false
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Act
|
||||
await wrapper.vm.$nextTick();
|
||||
|
||||
|
|
@ -331,8 +331,8 @@ describe('address-vehicles.vue', () => {
|
|||
isBigTruck: true,
|
||||
canSafeliteService: true
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Act
|
||||
await wrapper.vm.$nextTick();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue