Add Liberty Mutual test
This commit is contained in:
parent
89441bd528
commit
0e32aa0f11
4 changed files with 68 additions and 2 deletions
|
|
@ -15,6 +15,7 @@ export interface ITestData extends base {
|
|||
isMSRZip?: boolean,
|
||||
isPIAEnabled?: boolean,
|
||||
isDualRecal?: boolean,
|
||||
isPolicyInfoPage?: boolean,
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { type Page } from '@playwright/test';
|
||||
import { expect, type Page } from '@playwright/test';
|
||||
import { BasePage } from './BasePage';
|
||||
import { step } from 'framework/localTypes/Step';
|
||||
import { ITestData } from 'framework/TestData';
|
||||
|
|
@ -12,6 +12,7 @@ export class PolicyInfoPage extends BasePage {
|
|||
|
||||
@step("PolicyInfoPage >> Continue")
|
||||
async handlePolicyInfoPage(testData: Partial<ITestData>): Promise<void> {
|
||||
await this.nextPage();
|
||||
|
||||
await expect(this.page).toHaveURL(/\/fmg\/policy-info/);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ import insuranceBigTruckVerifiedTests from "./InsuranceBigTruckVerified";
|
|||
import insuranceUnverifiedTests from "./InsuranceUnverified";
|
||||
import CashReplaceSplitWindshieldTests from "./CashReplaceSplitWindshield";
|
||||
import insuranceMeemicNearSchoolVerifiedTests from "./InsuranceMeemicNearSchoolVerified";
|
||||
import insuranceLibertyMutualTests from "./InsuranceLibertyMutual";
|
||||
import cashReplaceDualMobileMSRTests from "./CashReplaceDualMobileMSR";
|
||||
import cashReplaceDualNonMSRInshopTests from "./CashReplaceDualNonMSRInshop";
|
||||
|
||||
|
|
@ -101,6 +102,7 @@ const allStandardTests = [
|
|||
// {name: "InsuranceGeico", tests: insuranceGeicoTests},
|
||||
// {name: "InsuranceITACOptimizedPriceValidationAllState", tests: insuranceITACOptimizedPriceValidationAllStateTests}
|
||||
{ name: "InsuranceMeemicNearSchoolVerified", tests: insuranceMeemicNearSchoolVerifiedTests },
|
||||
{ name: "InsuranceLibertyMutual", tests: insuranceLibertyMutualTests },
|
||||
|
||||
];
|
||||
|
||||
|
|
@ -308,6 +310,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
// Insurance flow - if user selected Insurance as Payment Method
|
||||
if (paymentMethod == PaymentMethod.Insurance) {
|
||||
await handleInsuranceFlow(testCase);
|
||||
if (testCase.testData.isPolicyInfoPage) return; // If Liberty Mutual and on PolicyInfoPage, skip the rest of the flow until the page is built out
|
||||
}
|
||||
|
||||
//============================= SERVICE SCHEDULING =============================
|
||||
|
|
@ -364,6 +367,13 @@ async function handleInsuranceFlow(testCase: TestCase) {
|
|||
await HeritageProblemGlassQuestionsPage.handleHeritageProblemGlassQuestionsPage(testCase.testData);
|
||||
}
|
||||
|
||||
// Liberty Mutual route directly to PolicyInfoPage instead of CCPolicyInfoPage
|
||||
if (testCase.testData.isPolicyInfoPage) {
|
||||
let policyInfoPage = testCase.pages.policyInfoPage;
|
||||
await policyInfoPage.handlePolicyInfoPage(testCase.testData);
|
||||
return;
|
||||
}
|
||||
|
||||
// Handle ccPolicyInfoPage
|
||||
let ccPolicyInfoPage = testCase.pages.ccPolicyInfoPage;
|
||||
await ccPolicyInfoPage.handleCCPolicyInfoPage(testCase.testData);
|
||||
|
|
|
|||
54
playwright-tests/tests/InsuranceLibertyMutual.ts
Normal file
54
playwright-tests/tests/InsuranceLibertyMutual.ts
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
import { ITestData, getDefaultExperimentsData } from 'framework/TestData'
|
||||
import { DamageType, VehicleLookupType, VehicleDamage } from 'safelite-playwright-core';
|
||||
import { PaymentMethod } from "framework/localTypes/Enums";
|
||||
import { ITestCase } from '../framework/Typedefs'
|
||||
import { getDefaultTestData, setFakerSeedFromTestName } from 'safelite-playwright-core';
|
||||
|
||||
setFakerSeedFromTestName("InsuranceLibertyMutual");
|
||||
|
||||
const insuranceLibertyMutualData: Partial<ITestData> = {
|
||||
...getDefaultTestData(),
|
||||
|
||||
paymentMethod: PaymentMethod.Insurance,
|
||||
isPolicyInfoPage: true,
|
||||
|
||||
claimDetails: {
|
||||
client: 'Liberty Mutual Insurance',
|
||||
policyNumber: 'Mock123456LM',
|
||||
policyDeductible: 0,
|
||||
damageDate: new Date(new Date().setDate(new Date().getDate() - 1)).toLocaleDateString('en-US', { month: '2-digit', day: '2-digit', year: 'numeric' }),
|
||||
damageCause: DamageType.Hail
|
||||
},
|
||||
|
||||
// Vehicle details for truck with ZIP lookup
|
||||
vehicleDetails: {
|
||||
...getDefaultTestData().vehicleDetails!,
|
||||
year: '2015',
|
||||
make: 'Toyota',
|
||||
model: 'Tacoma Pickup',
|
||||
style: '4 door crew cab',
|
||||
vehicleLookupType: VehicleLookupType.Zip,
|
||||
},
|
||||
|
||||
// Driver door damage instead of windshield
|
||||
vehicleDamage: [
|
||||
VehicleDamage.DriverFrontDoor,
|
||||
],
|
||||
|
||||
paymentDetails: {},
|
||||
|
||||
experiments: {
|
||||
...getDefaultExperimentsData()
|
||||
}
|
||||
};
|
||||
|
||||
const insuranceLibertyMutualTests: ITestCase[] = [];
|
||||
|
||||
const tc = {
|
||||
name: `InsuranceLibertyMutual`,
|
||||
tags: ['@E2E', '@InsuranceLibertyMutual', '@test_report', '@Insurance'],
|
||||
testData: insuranceLibertyMutualData
|
||||
};
|
||||
insuranceLibertyMutualTests.push(tc);
|
||||
|
||||
export default insuranceLibertyMutualTests;
|
||||
Loading…
Reference in a new issue