minor changes related to OEM scenario
This commit is contained in:
parent
7791f88760
commit
a154a93b36
4 changed files with 12 additions and 8 deletions
|
|
@ -3,7 +3,8 @@ import { PaymentMethod } from './localTypes/Enums'
|
||||||
|
|
||||||
export interface ITestData extends base {
|
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.
|
// 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
|
paymentMethod: PaymentMethod,
|
||||||
isOptedInForTextMessages: boolean
|
isOptedInForTextMessages: boolean,
|
||||||
totalAmount?: number
|
totalAmount?: number,
|
||||||
|
isForcedOEM?: boolean
|
||||||
}
|
}
|
||||||
|
|
@ -499,12 +499,15 @@ export class PaymentMethodPage extends BasePage {
|
||||||
|
|
||||||
@step("PaymentMethodPage >> Select Payment Method: ")
|
@step("PaymentMethodPage >> Select Payment Method: ")
|
||||||
async handlePaymentMethodPage(testData: Partial<ITestData>) {
|
async handlePaymentMethodPage(testData: Partial<ITestData>) {
|
||||||
const { servicePackage, isRecalVehicle, paymentDetails } = testData;
|
const { servicePackage, isRecalVehicle, paymentDetails, isForcedOEM } = testData;
|
||||||
|
|
||||||
await this.validateProgressBar(ProgressBarPercentages.PaymentMethodPage);
|
await this.validateProgressBar(ProgressBarPercentages.PaymentMethodPage);
|
||||||
await this.validatePaymentDetailsPage(testData);
|
await this.validatePaymentDetailsPage(testData);
|
||||||
await this.ValidateAfterPayBreakOutSection();
|
await this.ValidateAfterPayBreakOutSection();
|
||||||
await this.validateOEMPart(testData.isOEM!);
|
|
||||||
|
if (isForcedOEM){
|
||||||
|
await this.validateOEMPart(isForcedOEM);
|
||||||
|
}
|
||||||
|
|
||||||
// Verify VAPS wipers on backend for standard and premium packages
|
// Verify VAPS wipers on backend for standard and premium packages
|
||||||
if (servicePackage === ServicePackage.Standard || servicePackage === ServicePackage.Premium) {
|
if (servicePackage === ServicePackage.Standard || servicePackage === ServicePackage.Premium) {
|
||||||
|
|
|
||||||
|
|
@ -325,7 +325,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function handleInsuranceFlow(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
|
// Check if the insurance policy has endorsements
|
||||||
const hasEndorsements = endorsements && endorsements.length > 0;
|
const hasEndorsements = endorsements && endorsements.length > 0;
|
||||||
|
|
@ -335,7 +335,7 @@ export async function handleInsuranceFlow(testCase: TestCase) {
|
||||||
await insuranceCompanyPage.handleInsuranceCompanyPage(testCase.testData);
|
await insuranceCompanyPage.handleInsuranceCompanyPage(testCase.testData);
|
||||||
|
|
||||||
// Handle OEM scenario
|
// Handle OEM scenario
|
||||||
if (isOEM === true) {
|
if (isForcedOEM) {
|
||||||
// User should be on heritage problem glass questions page after selecting Allstate on insurance company page
|
// User should be on heritage problem glass questions page after selecting Allstate on insurance company page
|
||||||
let HeritageProblemGlassQuestionsPage = testCase.pages.heritageProblemGlassQuestionsPage;
|
let HeritageProblemGlassQuestionsPage = testCase.pages.heritageProblemGlassQuestionsPage;
|
||||||
await HeritageProblemGlassQuestionsPage.handleHeritageProblemGlassQuestionsPage(testCase.testData);
|
await HeritageProblemGlassQuestionsPage.handleHeritageProblemGlassQuestionsPage(testCase.testData);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ const insuranceOEMAllstateData: Partial<ITestData> = {
|
||||||
isPolicyFound: false,
|
isPolicyFound: false,
|
||||||
isPolicyUnverified: true,
|
isPolicyUnverified: true,
|
||||||
isRecalVehicle: true,
|
isRecalVehicle: true,
|
||||||
isOEM: true,
|
isForcedOEM: true,
|
||||||
|
|
||||||
// Override customer details with specific name and California location
|
// Override customer details with specific name and California location
|
||||||
customerDetails: {
|
customerDetails: {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue