minor changes related to OEM scenario

This commit is contained in:
kpatel8hs4io 2025-11-19 14:33:56 -05:00
parent 7791f88760
commit a154a93b36
4 changed files with 12 additions and 8 deletions

View file

@ -3,7 +3,8 @@ import { PaymentMethod } from './localTypes/Enums'
export interface ITestData extends base {
// Put any project-specific data here. Anything useful to other Safelite projects should be submitted as a pull request to safelite-playwright-core.
paymentMethod: PaymentMethod
isOptedInForTextMessages: boolean
totalAmount?: number
paymentMethod: PaymentMethod,
isOptedInForTextMessages: boolean,
totalAmount?: number,
isForcedOEM?: boolean
}

View file

@ -499,12 +499,15 @@ export class PaymentMethodPage extends BasePage {
@step("PaymentMethodPage >> Select Payment Method: ")
async handlePaymentMethodPage(testData: Partial<ITestData>) {
const { servicePackage, isRecalVehicle, paymentDetails } = testData;
const { servicePackage, isRecalVehicle, paymentDetails, isForcedOEM } = testData;
await this.validateProgressBar(ProgressBarPercentages.PaymentMethodPage);
await this.validatePaymentDetailsPage(testData);
await this.ValidateAfterPayBreakOutSection();
await this.validateOEMPart(testData.isOEM!);
if (isForcedOEM){
await this.validateOEMPart(isForcedOEM);
}
// Verify VAPS wipers on backend for standard and premium packages
if (servicePackage === ServicePackage.Standard || servicePackage === ServicePackage.Premium) {

View file

@ -325,7 +325,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
}
export async function handleInsuranceFlow(testCase: TestCase) {
const { isPolicyFound, isPolicyDriver, endorsements, isRecalVehicle, isCashInsuranceFlow, isOEM, flow } = testCase.testData;
const { isPolicyFound, isPolicyDriver, endorsements, isRecalVehicle, isCashInsuranceFlow, isForcedOEM, flow } = testCase.testData;
// Check if the insurance policy has endorsements
const hasEndorsements = endorsements && endorsements.length > 0;
@ -335,7 +335,7 @@ export async function handleInsuranceFlow(testCase: TestCase) {
await insuranceCompanyPage.handleInsuranceCompanyPage(testCase.testData);
// Handle OEM scenario
if (isOEM === true) {
if (isForcedOEM) {
// User should be on heritage problem glass questions page after selecting Allstate on insurance company page
let HeritageProblemGlassQuestionsPage = testCase.pages.heritageProblemGlassQuestionsPage;
await HeritageProblemGlassQuestionsPage.handleHeritageProblemGlassQuestionsPage(testCase.testData);

View file

@ -20,7 +20,7 @@ const insuranceOEMAllstateData: Partial<ITestData> = {
isPolicyFound: false,
isPolicyUnverified: true,
isRecalVehicle: true,
isOEM: true,
isForcedOEM: true,
// Override customer details with specific name and California location
customerDetails: {