From 73dd248f0c1e05cd7641bd60afc9bc087d1e37c8 Mon Sep 17 00:00:00 2001 From: JennyNou Date: Thu, 14 May 2026 17:21:13 -0400 Subject: [PATCH] Add unverified big truck with labor2 fee test --- playwright-tests/pages/SchedulePage.ts | 8 +- .../InsuranceAllstateBigTruckUnverified.ts | 74 +++++++++++++++++++ 2 files changed, 78 insertions(+), 4 deletions(-) create mode 100644 playwright-tests/tests/InsuranceAllstateBigTruckUnverified.ts diff --git a/playwright-tests/pages/SchedulePage.ts b/playwright-tests/pages/SchedulePage.ts index 8d863e94f..03106fa00 100644 --- a/playwright-tests/pages/SchedulePage.ts +++ b/playwright-tests/pages/SchedulePage.ts @@ -261,11 +261,11 @@ export class SchedulePage extends BasePage { await this.waitForPageOrComponentload(); await this.validateProgressBar(ProgressBarPercentages.SchedulePage); - //Looks like an issue with the insurance flow - remove comments once fixed - /*if (testData.isHeavyTruck) { + //Labor2 fee will show for cash orders and some insurance orders but USAA will not show it + if (testData.isHeavyTruck && testData.claimDetails?.client !== 'USAA') { const vuexState = JSON.parse(await this.page.evaluate('localStorage.getItem(\'vuex\')')); - expect(vuexState.order.lineItems.supportingItems.find((item: any) => item && item.partNumber == "labor2")).toBeTruthy(); - }*/ + expect(vuexState.order.lineItems.supportingItems[0].partNumber).toBe("LABOR2"); + } if (handleMobileFirstModal) { return await this.handleMobileFirstPopUp(testData); diff --git a/playwright-tests/tests/InsuranceAllstateBigTruckUnverified.ts b/playwright-tests/tests/InsuranceAllstateBigTruckUnverified.ts new file mode 100644 index 000000000..ef374411d --- /dev/null +++ b/playwright-tests/tests/InsuranceAllstateBigTruckUnverified.ts @@ -0,0 +1,74 @@ +import { ITestData, getDefaultExperimentsData } from 'framework/TestData' +import { ServiceLocation, DamageType } from 'safelite-playwright-core'; +import { ITestCase } from '../framework/Typedefs' +import { PaymentMethod } from "framework/localTypes/Enums"; +import { VehicleLookupType } from 'safelite-playwright-core'; +import { getDefaultTestData, setFakerSeedFromTestName } from 'safelite-playwright-core'; + +setFakerSeedFromTestName("InsuranceAllstateBigTruckUnverified"); + +const insuranceAllstateBigTruckUnverifiedData: Partial = { + ...getDefaultTestData(), + + paymentMethod: PaymentMethod.Insurance, + + isPolicyFound: false, + isPolicyUnverified: true, + isHeavyTruck: true, + isCanNotRecal: true, + + customerDetails: { + ...getDefaultTestData().customerDetails!, + firstName: 'Big', + lastName: 'Truck', + address: { + ...getDefaultTestData().customerDetails!.address, + city: 'Dayton', + state: 'Ohio', + postalCode: '45424' + } + }, + + claimDetails: { + client: 'Allstate', + policyNumber: 'MockUnverifiedBigTruck', + policyDeductible: "Unverified", + policyZip: '45424', + damageDate: new Date(new Date().setDate(new Date().getDate() - 1)) + .toLocaleDateString('en-US', { month: '2-digit', day: '2-digit', year: 'numeric' }), + damageCause: DamageType.Rock + }, + + vehicleDetails: { + ...getDefaultTestData().vehicleDetails!, + year: '2025', + make: 'Peterbilt', + model: '579', + style: 'conventional cab', + vin: '1XPBDP9X6SD693446', + vehicleLookupType: VehicleLookupType.Zip, + }, + + appointmentDetails: { + serviceLocation: ServiceLocation.InShop, + shopAddress: '5719 Brandt Pike, Dayton, OH 45424', + appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate + }, + + paymentDetails: {}, + + experiments: { + ...getDefaultExperimentsData() + } +} + +const insuranceAllstateBigTruckUnverifiedTests: ITestCase[] = []; + +const tc = { + name: `InsuranceAllstateBigTruckUnverified`, + tags: ['@E2E', '@InsuranceAllstateBigTruckUnverified', '@test_report', '@Insurance'], + testData: insuranceAllstateBigTruckUnverifiedData +}; +insuranceAllstateBigTruckUnverifiedTests.push(tc); + +export default insuranceAllstateBigTruckUnverifiedTests;