From de4554c31a948f4623d64555e1ca6e31eccd7318 Mon Sep 17 00:00:00 2001 From: JennyNou Date: Thu, 14 May 2026 18:05:19 -0400 Subject: [PATCH] Add big truck test for cash scenario --- playwright-tests/pages/SchedulePage.ts | 4 +- playwright-tests/tests/0000__M.test.ts | 2 + playwright-tests/tests/CashBigTruck.ts | 64 ++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 playwright-tests/tests/CashBigTruck.ts diff --git a/playwright-tests/pages/SchedulePage.ts b/playwright-tests/pages/SchedulePage.ts index 03106fa00..9ba237a8e 100644 --- a/playwright-tests/pages/SchedulePage.ts +++ b/playwright-tests/pages/SchedulePage.ts @@ -3,7 +3,7 @@ import { BasePage } from './BasePage'; import { IAppointmentDetails, ServiceLocation } from 'safelite-playwright-core'; import { formatDate, formatTime } from 'safelite-playwright-core'; import { AppointmentTimeslot } from 'safelite-playwright-core'; -import { ProgressBarPercentages } from 'framework/localTypes/Enums'; +import { ProgressBarPercentages, PaymentMethod } from 'framework/localTypes/Enums'; import { time } from 'console'; import { step } from 'framework/localTypes/Step'; import { ITestData } from 'framework/TestData'; @@ -262,7 +262,7 @@ export class SchedulePage extends BasePage { await this.validateProgressBar(ProgressBarPercentages.SchedulePage); //Labor2 fee will show for cash orders and some insurance orders but USAA will not show it - if (testData.isHeavyTruck && testData.claimDetails?.client !== 'USAA') { + if (testData.isHeavyTruck && (testData.paymentMethod !== PaymentMethod.Insurance || testData.claimDetails?.client !== 'USAA')) { const vuexState = JSON.parse(await this.page.evaluate('localStorage.getItem(\'vuex\')')); expect(vuexState.order.lineItems.supportingItems[0].partNumber).toBe("LABOR2"); } diff --git a/playwright-tests/tests/0000__M.test.ts b/playwright-tests/tests/0000__M.test.ts index eef0709fe..58d5cc675 100644 --- a/playwright-tests/tests/0000__M.test.ts +++ b/playwright-tests/tests/0000__M.test.ts @@ -49,6 +49,7 @@ import insuranceMeemicNearSchoolVerifiedTests from "./InsuranceMeemicNearSchoolV import insuranceLibertyMutualTests from "./InsuranceLibertyMutual"; import cashReplaceDualMobileMSRTests from "./CashReplaceDualMobileMSR"; import cashReplaceDualNonMSRInshopTests from "./CashReplaceDualNonMSRInshop"; +import cashBigTruckTests from "./CashBigTruck"; const test = getTestObject(); @@ -86,6 +87,7 @@ const allStandardTests = [ { name: "CashReplaceVinMobile", tests: cashReplaceVinMobileTests }, { name: "CashReplaceWiperDropoff", tests: cashReplaceWiperDropoffTests }, { name: "CashReplaceStaticInshop", tests: cashReplaceStaticInshopTests }, + { name: "CashBigTruck", tests: cashBigTruckTests }, { name: "CashReplaceDualMobileMSR", tests: cashReplaceDualMobileMSRTests }, { name: "CashReplaceDualNonMSRInshop", tests: cashReplaceDualNonMSRInshopTests }, { name: "CashReplaceStaticMobileMSR", tests: cashReplaceStaticMobileMSRTests }, diff --git a/playwright-tests/tests/CashBigTruck.ts b/playwright-tests/tests/CashBigTruck.ts new file mode 100644 index 000000000..47daffe86 --- /dev/null +++ b/playwright-tests/tests/CashBigTruck.ts @@ -0,0 +1,64 @@ +import { ITestData, getDefaultExperimentsData } from 'framework/TestData' +import { ServiceLocation, PaymentType } 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("CashBigTruckInshop"); + +const cashBigTruckData: Partial = { + ...getDefaultTestData(), + + paymentMethod: PaymentMethod.SelfPay, + + isHeavyTruck: true, + isCanNotRecal: true, + + customerDetails: { + ...getDefaultTestData().customerDetails!, + firstName: 'Big', + lastName: 'Truck', + address: { + ...getDefaultTestData().customerDetails!.address, + city: 'Urbancrest', + state: 'Ohio', + postalCode: '43123' + } + }, + + vehicleDetails: { + ...getDefaultTestData().vehicleDetails!, + year: '2025', + make: 'Peterbilt', + model: '579', + style: 'conventional cab', + vin: '1XPBDP9X6SD693446', + vehicleLookupType: VehicleLookupType.Vin, + }, + + appointmentDetails: { + serviceLocation: ServiceLocation.InShop, + shopAddress: '3455 Centerpoint Dr, Urbancrest, OH 43123', + appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate + }, + + paymentDetails: { + paymentType: PaymentType.PayAtService + }, + + experiments: { + ...getDefaultExperimentsData() + } +} + +const cashBigTruckTests: ITestCase[] = []; + +const tc = { + name: `CashBigTruck`, + tags: ['@E2E', '@CashBigTruck', '@test_report', '@CASH'], + testData: cashBigTruckData +}; +cashBigTruckTests.push(tc); + +export default cashBigTruckTests;