Update validateURL to account for variations in query string
In scenarios that reach the order confirmation page, the query string includes more than the issPageValue, whiche was breaking validateURL
This commit is contained in:
parent
b935cf0efa
commit
49c951fe25
31 changed files with 75 additions and 74 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -115,9 +115,9 @@ export class BasePage {
|
|||
|
||||
}
|
||||
|
||||
async validateURL(url: string) {
|
||||
async validateURL(issPageValue: string) {
|
||||
|
||||
await test.step(`Validating URL:${url}`, async () => {
|
||||
await test.step(`Validating page value:${issPageValue}`, async () => {
|
||||
let failCount = 0;
|
||||
/*
|
||||
We can't assume that the URL has already changed when we get here, but the point of this
|
||||
|
|
@ -128,7 +128,7 @@ export class BasePage {
|
|||
await this.page.waitForTimeout(1000);
|
||||
const currentUrl = this.page.url();
|
||||
console.log(`Current URL: ${currentUrl}`)
|
||||
if(currentUrl == url)
|
||||
if(currentUrl.includes(issPageValue))
|
||||
break;
|
||||
else {
|
||||
failCount++;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 = 'part-questions';
|
||||
readonly yesButton: Locator;
|
||||
|
||||
constructor(page: Page) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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-lookup';
|
||||
issPageValue = 'address-lookup';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -370,7 +370,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.url);
|
||||
await duplicateCheckPage.validateURL(duplicateCheckPage.issPageValue);
|
||||
await duplicateCheckPage.startNewClaim();
|
||||
await duplicateCheckPage.nextPage();
|
||||
});
|
||||
|
|
@ -378,7 +378,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
|
||||
if (isPolicyFound) {
|
||||
await test.step('PolicyVehiclesPage >> Select vehicle', async () => {
|
||||
await policyVehiclesPage.validateURL(policyVehiclesPage.url);
|
||||
await policyVehiclesPage.validateURL(policyVehiclesPage.issPageValue);
|
||||
await policyVehiclesPage.logReferralNumber();
|
||||
// Validate other vehicles on policy
|
||||
if (otherVehiclesOnPolicy && otherVehiclesOnPolicy.length > 0) {
|
||||
|
|
@ -400,7 +400,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
|
||||
if (isHeavyTruckVehicleBailout) {
|
||||
await test.step('BailoutPage >> Heavy Vehicle Bailout', async () => {
|
||||
await bailoutPage.validateURL(bailoutPage.url);
|
||||
await bailoutPage.validateURL(bailoutPage.issPageValue);
|
||||
await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.HeavyTruckVehicle);
|
||||
});
|
||||
return;
|
||||
|
|
@ -408,7 +408,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
|
||||
if (hasEndorsements) {
|
||||
await test.step('EndorsementsPage >> Select Endorsements', async () => {
|
||||
await endorsementsPage.validateURL(endorsementsPage.url);
|
||||
await endorsementsPage.validateURL(endorsementsPage.issPageValue);
|
||||
await endorsementsPage.verifyEndorsements(endorsements);
|
||||
await endorsementsPage.selectEndorsements(endorsements);
|
||||
await endorsementsPage.nextPage();
|
||||
|
|
@ -418,7 +418,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
} else {
|
||||
await policyVehiclesPage.logReferralNumber();
|
||||
await test.step('PolicyHolderDetailsPage >> Enter customer data', async () => {
|
||||
await policyHolderDetailsPage.validateURL(policyHolderDetailsPage.url);
|
||||
await policyHolderDetailsPage.validateURL(policyHolderDetailsPage.issPageValue);
|
||||
await policyHolderDetailsPage.fillCustomerDetails(customerDetails!);
|
||||
await policyHolderDetailsPage.nextPage();
|
||||
});
|
||||
|
|
@ -428,14 +428,14 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
}
|
||||
|
||||
await test.step('VehicleDetailsPage >> Select Vehicle', async () => {
|
||||
await vehicleSelectionPage.validateURL(vehicleSelectionPage.url);
|
||||
await vehicleSelectionPage.validateURL(vehicleSelectionPage.issPageValue);
|
||||
await vehicleSelectionPage.selectVehicle(vehicleDetails!);
|
||||
await vehicleSelectionPage.nextPage();
|
||||
});
|
||||
|
||||
if (isVehicleLookupBailout) {
|
||||
await test.step('BailoutPage >> Vehicle Lookup Bailout', async () => {
|
||||
await bailoutPage.validateURL(bailoutPage.url);
|
||||
await bailoutPage.validateURL(bailoutPage.issPageValue);
|
||||
await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.VehicleYMMSLookupError);
|
||||
});
|
||||
return;
|
||||
|
|
@ -443,7 +443,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
|
||||
if (isHeavyTruckVehicleBailout) {
|
||||
await test.step('BailoutPage >> Heavy Vehicle Bailout', async () => {
|
||||
await bailoutPage.validateURL(bailoutPage.url);
|
||||
await bailoutPage.validateURL(bailoutPage.issPageValue);
|
||||
await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.HeavyTruckVehicle);
|
||||
});
|
||||
return;
|
||||
|
|
@ -454,13 +454,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.url);
|
||||
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.url);
|
||||
await vehicleSelectionPage.validateURL(vehicleSelectionPage.issPageValue);
|
||||
await vehicleSelectionPage.selectVehicle(editVehicleDetails);
|
||||
await vehicleSelectionPage.nextPage();
|
||||
});
|
||||
|
|
@ -468,7 +468,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
}
|
||||
|
||||
await test.step('VehicleDamagePage >> Select Damage', async () => {
|
||||
await vehicleDamagePage.validateURL(vehicleDamagePage.url);
|
||||
await vehicleDamagePage.validateURL(vehicleDamagePage.issPageValue);
|
||||
if (isSeparateApptsWarning) {
|
||||
await vehicleDamagePage.checkSeparateApptsWarning();
|
||||
}
|
||||
|
|
@ -478,17 +478,17 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
|
||||
if (isPartsServiceErrorBailout) {
|
||||
await test.step('VehicleLookupPage >> Select Lookup Type', async () => {
|
||||
await vehicleLookupPage.validateURL(vehicleLookupPage.url);
|
||||
await vehicleLookupPage.validateURL(vehicleLookupPage.issPageValue);
|
||||
await vehicleLookupPage.vehicleLookup(vehicleDetails!);
|
||||
});
|
||||
await test.step('VinLookupPage >> Lookup by VIN', async () => {
|
||||
await vinLookupPage.validateURL(vinLookupPage.url);
|
||||
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.url);
|
||||
await bailoutPage.validateURL(bailoutPage.issPageValue);
|
||||
await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.PartsServiceError);
|
||||
return;
|
||||
});
|
||||
|
|
@ -499,13 +499,13 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
|
||||
|
||||
await test.step('VehicleLookupPage >> Select Lookup Type' + vehicleDetails?.vehicleLookupType, async () => {
|
||||
await vehicleLookupPage.validateURL(vehicleLookupPage.url);
|
||||
await vehicleLookupPage.validateURL(vehicleLookupPage.issPageValue);
|
||||
await vehicleLookupPage.vehicleLookup(vehicleDetails!);
|
||||
});
|
||||
|
||||
|
||||
if (isVehicleSelectBailout) {
|
||||
await vinLookupPage.validateURL(vinLookupPage.url);
|
||||
await vinLookupPage.validateURL(vinLookupPage.issPageValue);
|
||||
await test.step('Lookup vehicle >> By VIN-' + vehicleDetails!.vin!, async () => {
|
||||
await vinLookupPage.enterVin(vehicleDetails!.vin!);
|
||||
});
|
||||
|
|
@ -523,13 +523,13 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
switch (vehicleDetails!.vehicleLookupType!) {
|
||||
case VehicleLookupType.Address:
|
||||
await test.step('VehicleLookupAddressPage >> Lookup by address: ' + customerDetails!.address.street, async () => {
|
||||
await vehicleLookupAddressPage.validateURL(vehicleLookupAddressPage.url);
|
||||
await vehicleLookupAddressPage.validateURL(vehicleLookupAddressPage.issPageValue);
|
||||
await vehicleLookupAddressPage.lookupVehicleByAddress(customerDetails!, vehicleDetails!);
|
||||
await vehicleLookupAddressPage.nextPage();
|
||||
});
|
||||
break;
|
||||
case VehicleLookupType.LicensePlateNumber:
|
||||
await vehicleLookupLicensePage.validateURL(vehicleLookupLicensePage.url);
|
||||
await vehicleLookupLicensePage.validateURL(vehicleLookupLicensePage.issPageValue);
|
||||
if (isVehicleLookupValidations) {
|
||||
await test.step('VehicleLookupLicensePage >> Lookup by license plate: ' + vehicleDetails!.licensePlateNumber, async () => {
|
||||
await vehicleLookupLicensePage.enterPlateDetails(vehicleDetails!, isVehicleLookupValidations);
|
||||
|
|
@ -545,7 +545,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
break;
|
||||
case VehicleLookupType.Vin:
|
||||
await test.step('VinLookupPage >> Lookup by VIN: ' + vehicleDetails!.vin!, async () => {
|
||||
await vinLookupPage.validateURL(vinLookupPage.url);
|
||||
await vinLookupPage.validateURL(vinLookupPage.issPageValue);
|
||||
await vinLookupPage.enterVin(vehicleDetails!.vin!, isVehicleLookupValidations);
|
||||
await vinLookupPage.nextPage();
|
||||
});
|
||||
|
|
@ -554,7 +554,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
}
|
||||
if (isMoldingQuestion) {
|
||||
await test.step('Molding Questions Page >> Select Yes', async () => {
|
||||
await moldingQuestionsPage.validateURL(moldingQuestionsPage.url);
|
||||
await moldingQuestionsPage.validateURL(moldingQuestionsPage.issPageValue);
|
||||
if (!moldingQuestionsPage) {
|
||||
console.error("moldingQuestionsPage is not initialized");
|
||||
}
|
||||
|
|
@ -563,28 +563,28 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
});
|
||||
}
|
||||
if (capabilityQuestions && capabilityQuestions.length > 0) {
|
||||
await capabilityQuestionsPage.validateURL(capabilityQuestionsPage.url);
|
||||
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.url);
|
||||
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.url);
|
||||
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.url);
|
||||
await coverageStatementPage.validateURL(coverageStatementPage.issPageValue);
|
||||
// Confirm no coverage
|
||||
if (isPolicyFound && (isItac || isNoComp)) {
|
||||
await coverageStatementPage.continueToScheduleButton.click();
|
||||
|
|
@ -595,7 +595,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
|
||||
if (hasStateLawPopup) {
|
||||
await test.step('ProviderPreferencePage >> Dismiss state law popup', async () => {
|
||||
await providerPreferencePage.validateURL(providerPreferencePage.url);
|
||||
await providerPreferencePage.validateURL(providerPreferencePage.issPageValue);
|
||||
await providerPreferencePage.validateStateLawModalIsVisible();
|
||||
await providerPreferencePage.gotItButton.click();
|
||||
});
|
||||
|
|
@ -603,20 +603,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.url);
|
||||
await providerPreferencePage.validateURL(providerPreferencePage.issPageValue);
|
||||
await providerPreferencePage.selectProvider(isSafelite);
|
||||
});
|
||||
}
|
||||
|
||||
// validations for Recal warning mesage
|
||||
if (isRecalWarning) {
|
||||
await serviceLocationPage.validateURL(serviceLocationPage.url);
|
||||
await serviceLocationPage.validateURL(serviceLocationPage.issPageValue);
|
||||
await serviceLocationPage.validateRecalWarning();
|
||||
}
|
||||
|
||||
// if isRecalNotifidation flag true additional step to acknowledge Recal notification.
|
||||
if (isRecalNotification) {
|
||||
await providerPreferencePage.validateURL(providerPreferencePage.url);
|
||||
await providerPreferencePage.validateURL(providerPreferencePage.issPageValue);
|
||||
await providerPreferencePage.acknowledgeRecalNotificaiton();
|
||||
}
|
||||
// If No-Comp or ITAC, ProviderPreferencePage does not appear
|
||||
|
|
@ -627,7 +627,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.url);
|
||||
await tpaSearchPage.validateURL(tpaSearchPage.issPageValue);
|
||||
await tpaSearchPage.selectFirstLocation();
|
||||
// await tpaSearchPage.nextPage();
|
||||
});
|
||||
|
|
@ -635,7 +635,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
}
|
||||
if (isTpaNotEnabledBailout) {
|
||||
await test.step('validateBailoutDetails >> Bailout code : ' + BailoutCode.TPANotEnabled, async () => {
|
||||
await bailoutPage.validateURL(bailoutPage.url);
|
||||
await bailoutPage.validateURL(bailoutPage.issPageValue);
|
||||
await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.TPANotEnabled);
|
||||
return;
|
||||
});
|
||||
|
|
@ -644,28 +644,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.url);
|
||||
await tpaSearchPage.validateURL(tpaSearchPage.issPageValue);
|
||||
await tpaSearchPage.selectDoNotSeeMyShop();
|
||||
});
|
||||
await bailoutPage.validateURL(bailoutPage.url);
|
||||
await bailoutPage.validateURL(bailoutPage.issPageValue);
|
||||
await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.DoNotSeeMyShop);
|
||||
return;
|
||||
}
|
||||
|
||||
await test.step('TpaSearchPage >> TPA Search', async () => {
|
||||
await tpaSearchPage.validateURL(tpaSearchPage.url);
|
||||
await tpaSearchPage.validateURL(tpaSearchPage.issPageValue);
|
||||
await tpaSearchPage.selectFirstLocation();
|
||||
await tpaSearchPage.nextPage();
|
||||
});
|
||||
|
||||
await test.step('TpaSubmitPage >> TPA Submit', async () => {
|
||||
// TODO: Validations
|
||||
await tpaSubmitPage.validateURL(tpaSubmitPage.url);
|
||||
await tpaSubmitPage.validateURL(tpaSubmitPage.issPageValue);
|
||||
await tpaSubmitPage.nextPage();
|
||||
});
|
||||
|
||||
await test.step('TpaConfirmationPage >> TPA Confirmation', async () => {
|
||||
await tpaConfirmationPage.validateURL(tpaConfirmationPage.url);
|
||||
await tpaConfirmationPage.validateURL(tpaConfirmationPage.issPageValue);
|
||||
await tpaConfirmationPage.validateSuccessMessage();
|
||||
return;
|
||||
});
|
||||
|
|
@ -674,7 +674,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
}
|
||||
|
||||
await test.step('ServiceLocationPage >> Select service location', async () => {
|
||||
await serviceLocationPage.validateURL(serviceLocationPage.url);
|
||||
await serviceLocationPage.validateURL(serviceLocationPage.issPageValue);
|
||||
await serviceLocationPage.selectLocation(appointmentDetails!);
|
||||
if (hasMilitaryWarning) {
|
||||
await expect.soft(serviceLocationPage.militaryWarningMessage).toBeVisible();
|
||||
|
|
@ -683,7 +683,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
});
|
||||
|
||||
await test.step('SchedulePage >> Select day and time', async () => {
|
||||
await schedulePage.validateURL(schedulePage.url);
|
||||
await schedulePage.validateURL(schedulePage.issPageValue);
|
||||
customerDetails!.apptDate = await schedulePage.scheduleFirstAppointment(appointmentDetails!.serviceLocation);
|
||||
});
|
||||
|
||||
|
|
@ -694,7 +694,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
email: customerDetails!.email,
|
||||
phoneNumber: customerDetails!.phoneNumber
|
||||
};
|
||||
await contactDetailsPage.validateURL(contactDetailsPage.url);
|
||||
await contactDetailsPage.validateURL(contactDetailsPage.issPageValue);
|
||||
const actualContactDetails = await contactDetailsPage.getContactDetails();
|
||||
expect.soft(actualContactDetails).toEqual(expectedContactDetails);
|
||||
|
||||
|
|
@ -709,33 +709,33 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
|
||||
if (isPriceServiceErrorBailout) {
|
||||
await test.step('BailoutPage >> Price Service Error Bailout', async () => {
|
||||
await bailoutPage.validateURL(bailoutPage.url);
|
||||
await bailoutPage.validateURL(bailoutPage.issPageValue);
|
||||
await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.PricingResponseError);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await test.step('ServicePackagesPage >> Choose service package', async () => {
|
||||
await servicePackagesPage.validateURL(servicePackagesPage.url);
|
||||
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.url);
|
||||
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.url);
|
||||
await paymentMethodPage.validateURL(paymentMethodPage.issPageValue);
|
||||
await paymentMethodPage.nextPage();
|
||||
});
|
||||
}
|
||||
|
||||
await test.step('OrderConfirmationPage >> Validate order', async () => {
|
||||
await orderConfirmationPage.validateURL(orderConfirmationPage.url);
|
||||
await orderConfirmationPage.validateURL(orderConfirmationPage.issPageValue);
|
||||
await orderConfirmationPage.validateOrderConfirmationPage(testCase.testData);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue