Add big truck test for cash scenario
This commit is contained in:
parent
27aaf2f186
commit
de4554c31a
3 changed files with 68 additions and 2 deletions
|
|
@ -3,7 +3,7 @@ import { BasePage } from './BasePage';
|
||||||
import { IAppointmentDetails, ServiceLocation } from 'safelite-playwright-core';
|
import { IAppointmentDetails, ServiceLocation } from 'safelite-playwright-core';
|
||||||
import { formatDate, formatTime } from 'safelite-playwright-core';
|
import { formatDate, formatTime } from 'safelite-playwright-core';
|
||||||
import { AppointmentTimeslot } 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 { time } from 'console';
|
||||||
import { step } from 'framework/localTypes/Step';
|
import { step } from 'framework/localTypes/Step';
|
||||||
import { ITestData } from 'framework/TestData';
|
import { ITestData } from 'framework/TestData';
|
||||||
|
|
@ -262,7 +262,7 @@ export class SchedulePage extends BasePage {
|
||||||
await this.validateProgressBar(ProgressBarPercentages.SchedulePage);
|
await this.validateProgressBar(ProgressBarPercentages.SchedulePage);
|
||||||
|
|
||||||
//Labor2 fee will show for cash orders and some insurance orders but USAA will not show it
|
//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\')'));
|
const vuexState = JSON.parse(await this.page.evaluate('localStorage.getItem(\'vuex\')'));
|
||||||
expect(vuexState.order.lineItems.supportingItems[0].partNumber).toBe("LABOR2");
|
expect(vuexState.order.lineItems.supportingItems[0].partNumber).toBe("LABOR2");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ import insuranceMeemicNearSchoolVerifiedTests from "./InsuranceMeemicNearSchoolV
|
||||||
import insuranceLibertyMutualTests from "./InsuranceLibertyMutual";
|
import insuranceLibertyMutualTests from "./InsuranceLibertyMutual";
|
||||||
import cashReplaceDualMobileMSRTests from "./CashReplaceDualMobileMSR";
|
import cashReplaceDualMobileMSRTests from "./CashReplaceDualMobileMSR";
|
||||||
import cashReplaceDualNonMSRInshopTests from "./CashReplaceDualNonMSRInshop";
|
import cashReplaceDualNonMSRInshopTests from "./CashReplaceDualNonMSRInshop";
|
||||||
|
import cashBigTruckTests from "./CashBigTruck";
|
||||||
|
|
||||||
|
|
||||||
const test = getTestObject();
|
const test = getTestObject();
|
||||||
|
|
@ -86,6 +87,7 @@ const allStandardTests = [
|
||||||
{ name: "CashReplaceVinMobile", tests: cashReplaceVinMobileTests },
|
{ name: "CashReplaceVinMobile", tests: cashReplaceVinMobileTests },
|
||||||
{ name: "CashReplaceWiperDropoff", tests: cashReplaceWiperDropoffTests },
|
{ name: "CashReplaceWiperDropoff", tests: cashReplaceWiperDropoffTests },
|
||||||
{ name: "CashReplaceStaticInshop", tests: cashReplaceStaticInshopTests },
|
{ name: "CashReplaceStaticInshop", tests: cashReplaceStaticInshopTests },
|
||||||
|
{ name: "CashBigTruck", tests: cashBigTruckTests },
|
||||||
{ name: "CashReplaceDualMobileMSR", tests: cashReplaceDualMobileMSRTests },
|
{ name: "CashReplaceDualMobileMSR", tests: cashReplaceDualMobileMSRTests },
|
||||||
{ name: "CashReplaceDualNonMSRInshop", tests: cashReplaceDualNonMSRInshopTests },
|
{ name: "CashReplaceDualNonMSRInshop", tests: cashReplaceDualNonMSRInshopTests },
|
||||||
{ name: "CashReplaceStaticMobileMSR", tests: cashReplaceStaticMobileMSRTests },
|
{ name: "CashReplaceStaticMobileMSR", tests: cashReplaceStaticMobileMSRTests },
|
||||||
|
|
|
||||||
64
playwright-tests/tests/CashBigTruck.ts
Normal file
64
playwright-tests/tests/CashBigTruck.ts
Normal file
|
|
@ -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<ITestData> = {
|
||||||
|
...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;
|
||||||
Loading…
Reference in a new issue