Merge remote-tracking branch 'origin/feature/INSR-2126' into sshaik/develop

This commit is contained in:
Siraj Shaik 2025-03-10 12:14:12 -04:00
commit 394180cfc7
33 changed files with 121 additions and 69 deletions

View file

@ -141,7 +141,8 @@ export enum BailoutCode {
HeavyTruckVehicle,
NoPartsAvailable,
PartsServiceError,
SafeliteNotTheProvider
SafeliteNotTheProvider,
VehicleYMMSLookupError
}
export enum SignatureAlgorithm {

View file

@ -11,7 +11,7 @@ export class AddressLookupPage extends BasePage {
readonly lastNameTextBox: Locator;
readonly addressNoMatchTextBox: Locator;
readonly stateRestrictionsTextBox: Locator;
url = process.env['baseurl']! + '/?issPage=address-lookup';
issPageValue = 'address-lookup';
constructor(page: Page) {
super(page);

View file

@ -9,7 +9,7 @@ export class BailoutPage extends BasePage {
readonly phoneNumberTextBox: Locator;
readonly emailAddressTextBox: Locator;
url = process.env['BASE_URL']! + '/?issPage=bailout-page';
issPageValue = 'bailout-page';
constructor(page: Page) {
super(page);

View file

@ -37,7 +37,7 @@ export class BasePage {
}).toPass({ timeout: 180_000 });
}
async validateURL(url: string) {
async waitForURL(url: string) {
await expect(this.pageSpinner).toHaveCount(0, { timeout: 60000 });
await this.page.waitForURL(url);
}
@ -115,4 +115,13 @@ export class BasePage {
}
async validateURL(issPageValue: string) {
await expect(async () => {
const currentUrl = this.page.url();
expect(currentUrl).toContain(issPageValue);
}).toPass({
intervals: [1_000],
timeout: 15_000
});
}
}

View file

@ -2,7 +2,7 @@ import { Page } from "@playwright/test";
import { PartQuestionsPage } from "./PartQuestionsPage";
export default class CapabilityQuestionsPage extends PartQuestionsPage {
url = process.env['BASE_URL']! + '/?issPage=capability-questions';
issPageValue = 'capability-questions';
constructor(page: Page) {
super(page);

View file

@ -6,7 +6,7 @@ export class ContactConfirmationPage extends BasePage {
readonly page: Page;
readonly ConfirmMessageLabel: Locator;
url = process.env['BASE_URL']! + '/?issPage=contact-confirmation';
issPageValue = 'contact-confirmation';
constructor(page: Page) {
super(page);

View file

@ -4,7 +4,7 @@ import { ICustomerDetails } from '@business-logic/types/CustomerDetails';
export class ContactDetailsPage extends BasePage {
readonly page: Page;
url = process.env['BASE_URL']! + '/?issPage=contact-details';
issPageValue = 'contact-details';
// Contact details form
// TODO: Check if we can consolidate

View file

@ -8,7 +8,7 @@ export class CoverageStatementPage extends BasePage {
readonly deductibleAmount: Locator;
readonly verfiyingCoverageText: Locator;
readonly continueToScheduleButton: Locator; // For ITAC/NoComp
url = process.env['BASE_URL']! + '/?issPage=coverage-statement';
issPageValue = 'coverage-statement';
constructor(page: Page) {
super(page);

View file

@ -4,7 +4,7 @@ import { BasePage } from './BasePage';
export class DuplicateCheckPage extends BasePage {
readonly page: Page;
readonly newClaimButton: Locator;
url = process.env['BASE_URL']! + '/?issPage=duplicate-check';
issPageValue = 'duplicate-check';
constructor(page: Page) {
super(page);

View file

@ -7,7 +7,7 @@ export class EndorsementsPage extends BasePage {
readonly page: Page;
readonly educatorYesButton: Locator;
readonly educatorNoButton: Locator;
url = process.env['BASE_URL']! + '/?issPage=policy-endorsements';
issPageValue = 'policy-endorsements';
constructor(page: Page) {
super(page);

View file

@ -3,7 +3,7 @@ import { BasePage } from './BasePage';
export class MoldingQuestionsPage extends BasePage {
readonly page: Page;
url = process.env['BASE_URL']! + '/?issPage=part-questions';
issPageValue = 'molding-questions';
readonly yesButton: Locator;
constructor(page: Page) {

View file

@ -15,7 +15,7 @@ export class OrderConfirmationPage extends BasePage {
readonly subtotalText: Locator;
readonly finalAmountDue: Locator;
readonly cartServicePackageText: Locator;
url = process.env['BASE_URL']! + '/?issPage=order-confirmation';
issPageValue = 'order-confirmation';
constructor(page: Page) {
super(page);

View file

@ -4,7 +4,7 @@ import { IPartQuestion } from '@business-logic/types/CustomerDetails';
export class PartQuestionsPage extends BasePage {
readonly page: Page;
url = process.env['BASE_URL']! + '/?issPage=part-questions';
issPageValue = 'part-questions';
constructor(page: Page) {
super(page);

View file

@ -15,7 +15,7 @@ export class PaymentMethodPage extends BasePage {
readonly paypalButton: Locator;
readonly paymentPage: PaymentPage;
readonly paypalPage: PaypalPage;
url = process.env['BASE_URL']! + '/?issPage=payment-method';
issPageValue = 'payment-method';
constructor(page: Page) {
super(page);

View file

@ -13,7 +13,7 @@ export class PaymentPage extends BasePage {
readonly stateDropDown: Locator;
readonly billingZipTextField: Locator;
readonly submitPaymentButton: Locator;
url = process.env['BASE_URL']! + '/?issPage=payment-page';
issPageValue = 'payment-page';
constructor(page: Page) {
super(page);

View file

@ -6,7 +6,7 @@ import { AddressForm } from './forms/AddressForm';
export class PolicyHolderDetailsPage extends BasePage {
readonly page: Page;
readonly addressForm: AddressForm;
readonly url = process.env['BASE_URL']! + '/?issPage=policy-holder-details';
readonly issPageValue = 'policy-holder-details';
constructor(page: Page) {
super(page);

View file

@ -4,7 +4,7 @@ import { IVehicleDetails } from '@business-logic/types/CustomerDetails';
export class PolicyVehiclesPage extends BasePage {
readonly page: Page;
url = process.env['BASE_URL']! + '/?issPage=policy-vehicles';
issPageValue = 'policy-vehicles';
constructor(page: Page) {
super(page);

View file

@ -9,7 +9,7 @@ export class ProviderPreferencePage extends BasePage {
readonly gotItButton: Locator;
readonly acknowledgeCheckbox: Locator;
readonly stateLawModalHeading: Locator;
url = process.env['BASE_URL']! + '/?issPage=provider-preference';
issPageValue = 'provider-preference';
constructor(page: Page) {
super(page);

View file

@ -6,7 +6,7 @@ import { ServiceLocation } from '@business-logic/types/Enums';
export class SchedulePage extends BasePage {
readonly page: Page;
url = process.env['BASE_URL']! + '/?issPage=schedule-page';
issPageValue = 'schedule-page';
readonly firstAvailableDate: Locator;
readonly firstAvailableTime: Locator;
readonly modalContinueButton: Locator;

View file

@ -36,7 +36,7 @@ export class ServiceLocationPage extends BasePage {
readonly vehicleProtectedNoButton: Locator;
readonly saveAddressButton: Locator;
url = process.env['BASE_URL']! + '/?issPage=service-location';
issPageValue = 'service-location';
constructor(page: Page) {
super(page);

View file

@ -7,7 +7,7 @@ export class ServicePackagesPage extends BasePage {
readonly standardPackageButton: Locator;
readonly premiumPackageButton: Locator;
readonly glassOnlyButton: Locator;
url = process.env['BASE_URL']! + '/?issPage=service-packages';
issPageValue = 'service-packages';
constructor(page: Page) {
super(page);

View file

@ -4,7 +4,7 @@ import { BasePage } from './BasePage';
export class TpaConfirmationPage extends BasePage {
readonly page: Page;
readonly successMessage: Locator;
readonly url = process.env['BASE_URL']! + '/?issPage=tpa-confirmation';
readonly issPageValue = 'tpa-confirmation';
constructor(page: Page) {
super(page);

View file

@ -5,7 +5,7 @@ export class TpaSearchPage extends BasePage {
readonly page: Page;
readonly firstLocationButton: Locator;
readonly doNotSeeMyShopButton: Locator;
url = process.env['BASE_URL']! + '/?issPage=tpa-search';
issPageValue = 'tpa-search';
constructor(page: Page) {
super(page);

View file

@ -4,7 +4,7 @@ import { BasePage } from './BasePage';
export class TpaSubmitPage extends BasePage {
readonly page: Page;
readonly deductible: Locator;
url = process.env['BASE_URL']! + '/?issPage=tpa-submit';
issPageValue = 'tpa-submit';
constructor(page: Page) {
super(page);

View file

@ -22,7 +22,7 @@ export class VehicleDamagePage extends BasePage {
readonly rearWindowChkBox: Locator;
readonly separateApptsWarning: Locator;
readonly editVehicleButton: Locator;
url = process.env['BASE_URL']! + '/?issPage=vehicle-damage';
issPageValue = 'vehicle-damage';
constructor(page: Page) {
super(page);

View file

@ -8,7 +8,7 @@ export class VehicleLookupAddressPage extends BasePage {
readonly page: Page;
readonly addressForm: AddressForm;
readonly vehicleSelectionForm: VehicleSelectionForm;
url = process.env['BASE_URL']! + '/?issPage=address-vehicles';
issPageValue = 'address-lookup';
constructor(page: Page) {
super(page);

View file

@ -8,7 +8,7 @@ export class VehicleLookupLicensePage extends BasePage {
readonly licensePlateStateDrpDwn: Locator;
readonly plateNoMatchError: Locator;
readonly plateMismatchAlert: Locator;
url = process.env['BASE_URL']! + '/?issPage='; // TODO: Input correct URL
issPageValue = 'license-plate-lookup';
constructor(page: Page) {
super(page);

View file

@ -14,7 +14,7 @@ export class VehicleLookupPage extends BasePage {
readonly vinLookupPage: VinLookupPage;
readonly vehicleLookupAddressPage: VehicleLookupAddressPage;
readonly vehicleLookupLicensePage: VehicleLookupLicensePage;
url = process.env['BASE_URL']! + '/?issPage=vehicle-lookup';
issPageValue = 'vehicle-lookup';
constructor(page: Page) {
super(page);

View file

@ -2,7 +2,7 @@ import { Page } from "@playwright/test";
import { PartQuestionsPage } from "./PartQuestionsPage";
export default class VehiclePartQuestionsPage extends PartQuestionsPage{
url = process.env['BASE_URL']! + '/?issPage=vehicle-parts';
issPageValue = 'vehicle-parts';
constructor(page: Page) {
super(page);

View file

@ -9,7 +9,7 @@ export class VehicleSelectionPage extends BasePage {
readonly modelDropdown: Locator;
readonly styleDropdown: Locator;
url = process.env['BASE_URL']! + '/?issPage=vehicle-selection';
issPageValue = 'vehicle-selection';
constructor(page: Page) {
super(page);

View file

@ -6,7 +6,7 @@ export class VinLookupPage extends BasePage {
readonly vinLookupTextBox: Locator;
readonly lookupVinForMe: Locator;
readonly vinMismatchAlert: Locator;
url = process.env['BASE_URL']! + '/?issPage=vin-lookup'; // TODO: Input correct URL
issPageValue = 'vin-lookup';
constructor(page: Page) {
super(page);

View file

@ -17,6 +17,7 @@ export class WelcomePage extends BasePage {
readonly state: Locator;
readonly cookieCloseButton: Locator;
url = process.env['BASE_URL']! + '/?issPage=welcome-page';
issPageValue = 'welcome-page';
constructor(page: Page) {
super(page);
@ -35,7 +36,7 @@ export class WelcomePage extends BasePage {
async goto(clientTag: string) {
await this.page.goto(process.env['BASE_URL']! + `/?issPage=entry-page&ClientTag=${clientTag}`);
await this.validateURL(this.url);
await this.waitForURL(this.url);
await this.cookieCloseButton.click();
}
@ -54,7 +55,7 @@ export class WelcomePage extends BasePage {
}
const result = await getClientSignature(request);
await this.page.goto(process.env['BASE_URL']! + `/?issPage=entry-page&ClientTag=${clientTag}&token=${request.token}&signature=${result.signature}`);
await this.validateURL(this.url);
await this.waitForURL(this.url);
await this.logReferralNumber();
await this.cookieCloseButton.click();
}

View file

@ -376,6 +376,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
// TODO: Dynamic for when we don't care if duplicate page appears
await test.step('DuplicateCheckPage >> Start New Claim', async () => {
await duplicateCheckPage.validateURL(duplicateCheckPage.issPageValue);
await duplicateCheckPage.startNewClaim();
await duplicateCheckPage.nextPage();
});
@ -383,6 +384,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
if (isPolicyFound) {
await test.step('PolicyVehiclesPage >> Select vehicle', async () => {
await policyVehiclesPage.validateURL(policyVehiclesPage.issPageValue);
await policyVehiclesPage.logReferralNumber();
// Validate other vehicles on policy
if (otherVehiclesOnPolicy && otherVehiclesOnPolicy.length > 0) {
@ -404,6 +406,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
if (isHeavyTruckVehicleBailout) {
await test.step('BailoutPage >> Heavy Vehicle Bailout', async () => {
await bailoutPage.validateURL(bailoutPage.issPageValue);
await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.HeavyTruckVehicle);
});
return;
@ -411,6 +414,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
if (hasEndorsements) {
await test.step('EndorsementsPage >> Select Endorsements', async () => {
await endorsementsPage.validateURL(endorsementsPage.issPageValue);
await endorsementsPage.verifyEndorsements(endorsements);
await endorsementsPage.selectEndorsements(endorsements);
await endorsementsPage.nextPage();
@ -420,6 +424,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
} else {
await policyVehiclesPage.logReferralNumber();
await test.step('PolicyHolderDetailsPage >> Enter customer data', async () => {
await policyHolderDetailsPage.validateURL(policyHolderDetailsPage.issPageValue);
await policyHolderDetailsPage.fillCustomerDetails(customerDetails!);
await policyHolderDetailsPage.nextPage();
});
@ -429,19 +434,22 @@ async function runWorkflow(page: Page, testCase: TestCase) {
}
await test.step('VehicleDetailsPage >> Select Vehicle', async () => {
await vehicleSelectionPage.validateURL(vehicleSelectionPage.issPageValue);
await vehicleSelectionPage.selectVehicle(vehicleDetails!);
await vehicleSelectionPage.nextPage();
});
if (isVehicleLookupBailout) {
await test.step('BailoutPage >> Vehicle Lookup Bailout', async () => {
await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.VehicleLookupError);
await bailoutPage.validateURL(bailoutPage.issPageValue);
await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.VehicleYMMSLookupError);
});
return;
}
if (isHeavyTruckVehicleBailout) {
await test.step('BailoutPage >> Heavy Vehicle Bailout', async () => {
await bailoutPage.validateURL(bailoutPage.issPageValue);
await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.HeavyTruckVehicle);
});
return;
@ -452,11 +460,13 @@ async function runWorkflow(page: Page, testCase: TestCase) {
isPolicyFound = false; // Flow proceeds as unverified
testCase.testData.isPolicyFound = false;
await test.step('VehicleDamagePage >> Click Edit Vehicle', async () => {
await vehicleDamagePage.validateURL(vehicleDamagePage.issPageValue);
await vehicleDamagePage.editVehicleButton.click();
});
await test.step('VehicleDetailsPage >> Select edited vehicle', async () => {
await test.step('VehicleDetailsPage >> Select Vehicle', async () => {
await vehicleSelectionPage.validateURL(vehicleSelectionPage.issPageValue);
await vehicleSelectionPage.selectVehicle(editVehicleDetails);
await vehicleSelectionPage.nextPage();
});
@ -464,6 +474,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
}
await test.step('VehicleDamagePage >> Select Damage', async () => {
await vehicleDamagePage.validateURL(vehicleDamagePage.issPageValue);
if (isSeparateApptsWarning) {
await vehicleDamagePage.checkSeparateApptsWarning();
}
@ -473,14 +484,17 @@ async function runWorkflow(page: Page, testCase: TestCase) {
if (isPartsServiceErrorBailout) {
await test.step('VehicleLookupPage >> Select Lookup Type', async () => {
await vehicleLookupPage.validateURL(vehicleLookupPage.issPageValue);
await vehicleLookupPage.vehicleLookup(vehicleDetails!);
});
await test.step('VinLookupPage >> Lookup by VIN', async () => {
await vinLookupPage.validateURL(vinLookupPage.issPageValue);
await vinLookupPage.enterVin(vehicleDetails!.vin!);
forceAPIError(page, '/parts/api/v1/parts')
await vinLookupPage.nextPage();
});
await test.step('BailoutPage >> Parts Service Error Bailout', async () => {
await bailoutPage.validateURL(bailoutPage.issPageValue);
await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.PartsServiceError);
return;
});
@ -491,12 +505,13 @@ async function runWorkflow(page: Page, testCase: TestCase) {
await test.step('VehicleLookupPage >> Select Lookup Type' + vehicleDetails?.vehicleLookupType, async () => {
await vehicleLookupPage.validateURL(vehicleLookupPage.issPageValue);
await vehicleLookupPage.vehicleLookup(vehicleDetails!);
});
if (testCase.testData.isVehicleSelectBailout) {
if (isVehicleSelectBailout) {
await vinLookupPage.validateURL(vinLookupPage.issPageValue);
await test.step('Lookup vehicle >> By VIN-' + vehicleDetails!.vin!, async () => {
await vinLookupPage.enterVin(vehicleDetails!.vin!);
});
@ -511,48 +526,51 @@ async function runWorkflow(page: Page, testCase: TestCase) {
return;
}
if (isAddressLookupValidations) {
await test.step('Address Lookup validations >> Vehicle Lookup by address: ' + customerDetails!.address.street, async () => {
if (Array.isArray(vehicleDetails?.address)) {
await addressLookupPage.validateAddressLookupAlerts(vehicleDetails?.address);
await addressLookupPage.nextPage();
}
});
} else {
switch (vehicleDetails!.vehicleLookupType!) {
case VehicleLookupType.Address:
switch (vehicleDetails!.vehicleLookupType!) {
case VehicleLookupType.Address:
if (isAddressLookupValidations) {
await test.step('Address Lookup validations >> Vehicle Lookup by address: ' + customerDetails!.address.street, async () => {
if (Array.isArray(vehicleDetails?.address)) {
await addressLookupPage.validateURL(addressLookupPage.issPageValue);
await addressLookupPage.validateAddressLookupAlerts(vehicleDetails?.address);
await addressLookupPage.nextPage();
}
});
} else {
await test.step('VehicleLookupAddressPage >> Lookup by address: ' + customerDetails!.address.street, async () => {
await vehicleLookupAddressPage.validateURL(vehicleLookupAddressPage.issPageValue);
await vehicleLookupAddressPage.lookupVehicleByAddress(customerDetails!, vehicleDetails!);
await vehicleLookupAddressPage.nextPage();
});
break;
case VehicleLookupType.LicensePlateNumber:
if (isVehicleLookupValidations) {
await test.step('VehicleLookupLicensePage >> Lookup by license plate: ' + vehicleDetails!.licensePlateNumber, async () => {
await vehicleLookupLicensePage.enterPlateDetails(vehicleDetails!, isVehicleLookupValidations);
await vehicleLookupLicensePage.nextPage();
});
} else {
await test.step('VehicleLookupLicensePage >> Lookup by license plate: ' + vehicleDetails!.licensePlateNumber, async () => {
await vehicleLookupLicensePage.enterPlateDetails(vehicleDetails!);
await vehicleLookupLicensePage.nextPage();
});
}
break;
case VehicleLookupType.Vin:
await test.step('VinLookupPage >> Lookup by VIN: ' + vehicleDetails!.vin!, async () => {
await vinLookupPage.enterVin(vehicleDetails!.vin!, isVehicleLookupValidations);
await vinLookupPage.nextPage();
}
break;
case VehicleLookupType.LicensePlateNumber:
await vehicleLookupLicensePage.validateURL(vehicleLookupLicensePage.issPageValue);
if (isVehicleLookupValidations) {
await test.step('VehicleLookupLicensePage >> Lookup by license plate: ' + vehicleDetails!.licensePlateNumber, async () => {
await vehicleLookupLicensePage.enterPlateDetails(vehicleDetails!, isVehicleLookupValidations);
await vehicleLookupLicensePage.nextPage();
});
break;
}
} else {
await test.step('VehicleLookupLicensePage >> Lookup by license plate: ' + vehicleDetails!.licensePlateNumber, async () => {
await vehicleLookupLicensePage.enterPlateDetails(vehicleDetails!);
await vehicleLookupLicensePage.nextPage();
});
}
break;
case VehicleLookupType.Vin:
await test.step('VinLookupPage >> Lookup by VIN: ' + vehicleDetails!.vin!, async () => {
await vinLookupPage.validateURL(vinLookupPage.issPageValue);
await vinLookupPage.enterVin(vehicleDetails!.vin!, isVehicleLookupValidations);
await vinLookupPage.nextPage();
});
break;
}
}
if (isMoldingQuestion) {
await test.step('Molding Questions Page >> Select Yes', async () => {
await moldingQuestionsPage.validateURL(moldingQuestionsPage.issPageValue);
if (!moldingQuestionsPage) {
console.error("moldingQuestionsPage is not initialized");
}
@ -561,24 +579,28 @@ async function runWorkflow(page: Page, testCase: TestCase) {
});
}
if (capabilityQuestions && capabilityQuestions.length > 0) {
await capabilityQuestionsPage.validateURL(capabilityQuestionsPage.issPageValue);
await capabilityQuestionsPage.validatePartQuestions(capabilityQuestions);
await capabilityQuestionsPage.selectPartQuestionResponses(capabilityQuestions);
await capabilityQuestionsPage.nextPage();
}
if (partQuestions && partQuestions.length > 0) {
await partQuestionsPage.validateURL(partQuestionsPage.issPageValue);
await partQuestionsPage.validatePartQuestions(partQuestions);
await partQuestionsPage.selectPartQuestionResponses(partQuestions);
await partQuestionsPage.nextPage();
}
if (vehiclePartQuestions && vehiclePartQuestions.length > 0) {
await vehiclePartQuestionsPage.validateURL(vehiclePartQuestionsPage.issPageValue);
await vehiclePartQuestionsPage.validatePartQuestions(vehiclePartQuestions);
await vehiclePartQuestionsPage.selectPartQuestionResponses(vehiclePartQuestions);
await vehiclePartQuestionsPage.nextPage();
}
await test.step('CoverageStatementPage >> Next page', async () => {
await coverageStatementPage.validateURL(coverageStatementPage.issPageValue);
// Confirm no coverage
if (isPolicyFound && (isItac || isNoComp)) {
await coverageStatementPage.continueToScheduleButton.click();
@ -589,6 +611,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
if (hasStateLawPopup) {
await test.step('ProviderPreferencePage >> Dismiss state law popup', async () => {
await providerPreferencePage.validateURL(providerPreferencePage.issPageValue);
await providerPreferencePage.validateStateLawModalIsVisible();
await providerPreferencePage.gotItButton.click();
});
@ -596,17 +619,20 @@ async function runWorkflow(page: Page, testCase: TestCase) {
if (!isPolicyFound || !(isItac || isNoComp)) {
await test.step('ProviderPreferencePage >> Select Provider ' + isSafelite ? "Safelite" : "Other shops(Non-Safelite)", async () => {
await providerPreferencePage.validateURL(providerPreferencePage.issPageValue);
await providerPreferencePage.selectProvider(isSafelite);
});
}
// validations for Recal warning mesage
if (isRecalWarning) {
await serviceLocationPage.validateURL(serviceLocationPage.issPageValue);
await serviceLocationPage.validateRecalWarning();
}
// if isRecalNotifidation flag true additional step to acknowledge Recal notification.
if (isRecalNotification) {
await providerPreferencePage.validateURL(providerPreferencePage.issPageValue);
await providerPreferencePage.acknowledgeRecalNotificaiton();
}
// If No-Comp or ITAC, ProviderPreferencePage does not appear
@ -617,6 +643,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
if (testCase.testData!.clientTag == '05CC1609-3631-4044-B45A-E78E13343B9A') { // Avoiding TPA flow for Federated Insureance due to Defect# SSR-1984 //Temporary fix until Defect# SSR-1984 is addressed.
await test.step('***** Performing Safelite flow for Federal Insurance due to defec# SSR-1984 *****', async () => { });
await test.step('TpaSearchPage >> TPA Search', async () => {
await tpaSearchPage.validateURL(tpaSearchPage.issPageValue);
await tpaSearchPage.selectFirstLocation();
// await tpaSearchPage.nextPage();
});
@ -624,6 +651,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
}
if (isTpaNotEnabledBailout) {
await test.step('validateBailoutDetails >> Bailout code : ' + BailoutCode.TPANotEnabled, async () => {
await bailoutPage.validateURL(bailoutPage.issPageValue);
await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.TPANotEnabled);
return;
});
@ -632,23 +660,28 @@ async function runWorkflow(page: Page, testCase: TestCase) {
if (isDoNotSeeMyShopBailout) {
await test.step('TpaSearchPage >> Select "Do Not See My Shop"', async () => {
await tpaSearchPage.validateURL(tpaSearchPage.issPageValue);
await tpaSearchPage.selectDoNotSeeMyShop();
});
await bailoutPage.validateURL(bailoutPage.issPageValue);
await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.DoNotSeeMyShop);
return;
}
await test.step('TpaSearchPage >> TPA Search', async () => {
await tpaSearchPage.validateURL(tpaSearchPage.issPageValue);
await tpaSearchPage.selectFirstLocation();
await tpaSearchPage.nextPage();
});
await test.step('TpaSubmitPage >> TPA Submit', async () => {
// TODO: Validations
await tpaSubmitPage.validateURL(tpaSubmitPage.issPageValue);
await tpaSubmitPage.nextPage();
});
await test.step('TpaConfirmationPage >> TPA Confirmation', async () => {
await tpaConfirmationPage.validateURL(tpaConfirmationPage.issPageValue);
await tpaConfirmationPage.validateSuccessMessage();
return;
});
@ -657,6 +690,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
}
await test.step('ServiceLocationPage >> Select service location', async () => {
await serviceLocationPage.validateURL(serviceLocationPage.issPageValue);
await serviceLocationPage.selectLocation(appointmentDetails!);
if (hasMilitaryWarning) {
await expect.soft(serviceLocationPage.militaryWarningMessage).toBeVisible();
@ -665,6 +699,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
});
await test.step('SchedulePage >> Select day and time', async () => {
await schedulePage.validateURL(schedulePage.issPageValue);
customerDetails!.apptDate = await schedulePage.scheduleFirstAppointment(appointmentDetails!.serviceLocation);
});
@ -675,6 +710,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
email: customerDetails!.email,
phoneNumber: customerDetails!.phoneNumber
};
await contactDetailsPage.validateURL(contactDetailsPage.issPageValue);
const actualContactDetails = await contactDetailsPage.getContactDetails();
expect.soft(actualContactDetails).toEqual(expectedContactDetails);
@ -689,28 +725,33 @@ async function runWorkflow(page: Page, testCase: TestCase) {
if (isPriceServiceErrorBailout) {
await test.step('BailoutPage >> Price Service Error Bailout', async () => {
await bailoutPage.validateURL(bailoutPage.issPageValue);
await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.PricingResponseError);
});
return;
}
await test.step('ServicePackagesPage >> Choose service package', async () => {
await servicePackagesPage.validateURL(servicePackagesPage.issPageValue);
customerDetails!.packagePrice = await servicePackagesPage.selectServicePackage(servicePackage!);
await servicePackagesPage.nextPage();
});
if (isPolicyFound && (isUseVehicleOnPolicy ?? true) && claimDetails!.policyDeductible > 0) {
await test.step('PaymentMethodPage >> Execute Payment', async () => {
await paymentMethodPage.validateURL(paymentMethodPage.issPageValue);
await paymentMethodPage.executePayment(paymentDetails!);
await paymentMethodPage.nextPage();
});
} else {
await test.step('PaymentMethodPage >> Skip to Order Confirmation', async () => {
await paymentMethodPage.validateURL(paymentMethodPage.issPageValue);
await paymentMethodPage.nextPage();
});
}
await test.step('OrderConfirmationPage >> Validate order', async () => {
await orderConfirmationPage.validateURL(orderConfirmationPage.issPageValue);
await orderConfirmationPage.validateOrderConfirmationPage(testCase.testData);
});
}