Fix naming and test for new policy info page

This commit is contained in:
JennyNou 2026-05-21 14:21:49 -04:00
parent de4554c31a
commit b0b96787b5
4 changed files with 6 additions and 5 deletions

View file

@ -15,7 +15,7 @@ export interface ITestData extends base {
isMSRZip?: boolean, isMSRZip?: boolean,
isPIAEnabled?: boolean, isPIAEnabled?: boolean,
isDualRecal?: boolean, isDualRecal?: boolean,
isPolicyInfoPage?: boolean, isNewInsuranceFlow?: boolean,
} }

View file

@ -1,6 +1,7 @@
import { expect, type Page } from '@playwright/test'; import { expect, type Page } from '@playwright/test';
import { BasePage } from './BasePage'; import { BasePage } from './BasePage';
import { step } from 'framework/localTypes/Step'; import { step } from 'framework/localTypes/Step';
import { TestSuccessAlert } from 'safelite-playwright-core';
import { ITestData } from 'framework/TestData'; import { ITestData } from 'framework/TestData';
export class PolicyInfoPage extends BasePage { export class PolicyInfoPage extends BasePage {
@ -14,5 +15,6 @@ export class PolicyInfoPage extends BasePage {
async handlePolicyInfoPage(testData: Partial<ITestData>): Promise<void> { async handlePolicyInfoPage(testData: Partial<ITestData>): Promise<void> {
await expect(this.page).toHaveURL(/\/fmg\/policy-info/); await expect(this.page).toHaveURL(/\/fmg\/policy-info/);
throw new TestSuccessAlert('Policy info page validated successfully.');
} }
} }

View file

@ -324,7 +324,6 @@ async function runWorkflow(page: Page, testCase: TestCase) {
// Insurance flow - if user selected Insurance as Payment Method // Insurance flow - if user selected Insurance as Payment Method
if (paymentMethod == PaymentMethod.Insurance) { if (paymentMethod == PaymentMethod.Insurance) {
await handleInsuranceFlow(testCase); 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 ============================= //============================= SERVICE SCHEDULING =============================
@ -365,7 +364,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
} }
async function handleInsuranceFlow(testCase: TestCase) { async function handleInsuranceFlow(testCase: TestCase) {
const { isPolicyFound, isPolicyDriver, endorsements, isRecalVehicle, isCashInsuranceFlow, isForcedOEM, flow } = testCase.testData; const { isPolicyFound, isPolicyDriver, endorsements, isRecalVehicle, isCashInsuranceFlow, isForcedOEM, flow, isNewInsuranceFlow } = testCase.testData;
// Check if the insurance policy has endorsements // Check if the insurance policy has endorsements
const hasEndorsements = endorsements && endorsements.length > 0; const hasEndorsements = endorsements && endorsements.length > 0;
@ -382,7 +381,7 @@ async function handleInsuranceFlow(testCase: TestCase) {
} }
// Liberty Mutual route directly to PolicyInfoPage instead of CCPolicyInfoPage // Liberty Mutual route directly to PolicyInfoPage instead of CCPolicyInfoPage
if (testCase.testData.isPolicyInfoPage) { if (isNewInsuranceFlow) {
let policyInfoPage = testCase.pages.policyInfoPage; let policyInfoPage = testCase.pages.policyInfoPage;
await policyInfoPage.handlePolicyInfoPage(testCase.testData); await policyInfoPage.handlePolicyInfoPage(testCase.testData);
return; return;

View file

@ -10,7 +10,7 @@ const insuranceLibertyMutualData: Partial<ITestData> = {
...getDefaultTestData(), ...getDefaultTestData(),
paymentMethod: PaymentMethod.Insurance, paymentMethod: PaymentMethod.Insurance,
isPolicyInfoPage: true, isNewInsuranceFlow: true,
claimDetails: { claimDetails: {
client: 'Liberty Mutual Insurance', client: 'Liberty Mutual Insurance',