From b0b96787b525807737b64aa4037bb1182bb47a28 Mon Sep 17 00:00:00 2001 From: JennyNou Date: Thu, 21 May 2026 14:21:49 -0400 Subject: [PATCH] Fix naming and test for new policy info page --- playwright-tests/framework/TestData.ts | 2 +- playwright-tests/pages/PolicyInfoPage.ts | 2 ++ playwright-tests/tests/0000__M.test.ts | 5 ++--- playwright-tests/tests/InsuranceLibertyMutual.ts | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/playwright-tests/framework/TestData.ts b/playwright-tests/framework/TestData.ts index 0fe04a1f9..8100fdf09 100644 --- a/playwright-tests/framework/TestData.ts +++ b/playwright-tests/framework/TestData.ts @@ -15,7 +15,7 @@ export interface ITestData extends base { isMSRZip?: boolean, isPIAEnabled?: boolean, isDualRecal?: boolean, - isPolicyInfoPage?: boolean, + isNewInsuranceFlow?: boolean, } diff --git a/playwright-tests/pages/PolicyInfoPage.ts b/playwright-tests/pages/PolicyInfoPage.ts index 7974e3099..04f35c346 100644 --- a/playwright-tests/pages/PolicyInfoPage.ts +++ b/playwright-tests/pages/PolicyInfoPage.ts @@ -1,6 +1,7 @@ import { expect, type Page } from '@playwright/test'; import { BasePage } from './BasePage'; import { step } from 'framework/localTypes/Step'; +import { TestSuccessAlert } from 'safelite-playwright-core'; import { ITestData } from 'framework/TestData'; export class PolicyInfoPage extends BasePage { @@ -14,5 +15,6 @@ export class PolicyInfoPage extends BasePage { async handlePolicyInfoPage(testData: Partial): Promise { await expect(this.page).toHaveURL(/\/fmg\/policy-info/); + throw new TestSuccessAlert('Policy info page validated successfully.'); } } diff --git a/playwright-tests/tests/0000__M.test.ts b/playwright-tests/tests/0000__M.test.ts index 58d5cc675..88e4101f5 100644 --- a/playwright-tests/tests/0000__M.test.ts +++ b/playwright-tests/tests/0000__M.test.ts @@ -324,7 +324,6 @@ 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 ============================= @@ -365,7 +364,7 @@ async function runWorkflow(page: Page, 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 const hasEndorsements = endorsements && endorsements.length > 0; @@ -382,7 +381,7 @@ async function handleInsuranceFlow(testCase: TestCase) { } // Liberty Mutual route directly to PolicyInfoPage instead of CCPolicyInfoPage - if (testCase.testData.isPolicyInfoPage) { + if (isNewInsuranceFlow) { let policyInfoPage = testCase.pages.policyInfoPage; await policyInfoPage.handlePolicyInfoPage(testCase.testData); return; diff --git a/playwright-tests/tests/InsuranceLibertyMutual.ts b/playwright-tests/tests/InsuranceLibertyMutual.ts index 0c89d6084..9edff185f 100644 --- a/playwright-tests/tests/InsuranceLibertyMutual.ts +++ b/playwright-tests/tests/InsuranceLibertyMutual.ts @@ -10,7 +10,7 @@ const insuranceLibertyMutualData: Partial = { ...getDefaultTestData(), paymentMethod: PaymentMethod.Insurance, - isPolicyInfoPage: true, + isNewInsuranceFlow: true, claimDetails: { client: 'Liberty Mutual Insurance',