Added url validation

Changed existing validateURL function on BasePage to WaitForURL, and
added a new function for checking the url of the page. Added calls
to this function throughout the workflow, on each page change
This commit is contained in:
Alex Humphries 2025-03-06 16:15:58 -05:00
parent f324ca1eb1
commit cf4c4d8585
3 changed files with 51 additions and 4 deletions

View file

@ -37,7 +37,7 @@ export class BasePage {
}).toPass({ timeout: 180_000 }); }).toPass({ timeout: 180_000 });
} }
async validateURL(url: string) { async waitForURL(url: string) {
await expect(this.pageSpinner).toHaveCount(0, { timeout: 60000 }); await expect(this.pageSpinner).toHaveCount(0, { timeout: 60000 });
await this.page.waitForURL(url); await this.page.waitForURL(url);
} }
@ -115,4 +115,8 @@ export class BasePage {
} }
async validateURL(url: string) {
const currentUrl = this.page.url();
expect(currentUrl).toEqual(url);
}
} }

View file

@ -35,7 +35,7 @@ export class WelcomePage extends BasePage {
async goto(clientTag: string) { async goto(clientTag: string) {
await this.page.goto(process.env['BASE_URL']! + `/?issPage=entry-page&ClientTag=${clientTag}`); 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(); await this.cookieCloseButton.click();
} }
@ -54,7 +54,7 @@ export class WelcomePage extends BasePage {
} }
const result = await getClientSignature(request); 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.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.logReferralNumber();
await this.cookieCloseButton.click(); await this.cookieCloseButton.click();
} }

View file

@ -370,6 +370,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
// TODO: Dynamic for when we don't care if duplicate page appears // TODO: Dynamic for when we don't care if duplicate page appears
await test.step('DuplicateCheckPage >> Start New Claim', async () => { await test.step('DuplicateCheckPage >> Start New Claim', async () => {
await duplicateCheckPage.validateURL(duplicateCheckPage.url);
await duplicateCheckPage.startNewClaim(); await duplicateCheckPage.startNewClaim();
await duplicateCheckPage.nextPage(); await duplicateCheckPage.nextPage();
}); });
@ -377,6 +378,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
if (isPolicyFound) { if (isPolicyFound) {
await test.step('PolicyVehiclesPage >> Select vehicle', async () => { await test.step('PolicyVehiclesPage >> Select vehicle', async () => {
await policyVehiclesPage.validateURL(policyVehiclesPage.url);
await policyVehiclesPage.logReferralNumber(); await policyVehiclesPage.logReferralNumber();
// Validate other vehicles on policy // Validate other vehicles on policy
if (otherVehiclesOnPolicy && otherVehiclesOnPolicy.length > 0) { if (otherVehiclesOnPolicy && otherVehiclesOnPolicy.length > 0) {
@ -398,6 +400,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
if (isHeavyTruckVehicleBailout) { if (isHeavyTruckVehicleBailout) {
await test.step('BailoutPage >> Heavy Vehicle Bailout', async () => { await test.step('BailoutPage >> Heavy Vehicle Bailout', async () => {
await bailoutPage.validateURL(bailoutPage.url);
await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.HeavyTruckVehicle); await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.HeavyTruckVehicle);
}); });
return; return;
@ -405,6 +408,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
if (hasEndorsements) { if (hasEndorsements) {
await test.step('EndorsementsPage >> Select Endorsements', async () => { await test.step('EndorsementsPage >> Select Endorsements', async () => {
await endorsementsPage.validateURL(endorsementsPage.url);
await endorsementsPage.verifyEndorsements(endorsements); await endorsementsPage.verifyEndorsements(endorsements);
await endorsementsPage.selectEndorsements(endorsements); await endorsementsPage.selectEndorsements(endorsements);
await endorsementsPage.nextPage(); await endorsementsPage.nextPage();
@ -414,6 +418,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
} else { } else {
await policyVehiclesPage.logReferralNumber(); await policyVehiclesPage.logReferralNumber();
await test.step('PolicyHolderDetailsPage >> Enter customer data', async () => { await test.step('PolicyHolderDetailsPage >> Enter customer data', async () => {
await policyHolderDetailsPage.validateURL(policyHolderDetailsPage.url);
await policyHolderDetailsPage.fillCustomerDetails(customerDetails!); await policyHolderDetailsPage.fillCustomerDetails(customerDetails!);
await policyHolderDetailsPage.nextPage(); await policyHolderDetailsPage.nextPage();
}); });
@ -423,12 +428,14 @@ async function runWorkflow(page: Page, testCase: TestCase) {
} }
await test.step('VehicleDetailsPage >> Select Vehicle', async () => { await test.step('VehicleDetailsPage >> Select Vehicle', async () => {
await vehicleSelectionPage.validateURL(vehicleSelectionPage.url);
await vehicleSelectionPage.selectVehicle(vehicleDetails!); await vehicleSelectionPage.selectVehicle(vehicleDetails!);
await vehicleSelectionPage.nextPage(); await vehicleSelectionPage.nextPage();
}); });
if (isVehicleLookupBailout) { if (isVehicleLookupBailout) {
await test.step('BailoutPage >> Vehicle Lookup Bailout', async () => { await test.step('BailoutPage >> Vehicle Lookup Bailout', async () => {
await bailoutPage.validateURL(bailoutPage.url);
await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.VehicleLookupError); await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.VehicleLookupError);
}); });
return; return;
@ -436,6 +443,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
if (isHeavyTruckVehicleBailout) { if (isHeavyTruckVehicleBailout) {
await test.step('BailoutPage >> Heavy Vehicle Bailout', async () => { await test.step('BailoutPage >> Heavy Vehicle Bailout', async () => {
await bailoutPage.validateURL(bailoutPage.url);
await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.HeavyTruckVehicle); await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.HeavyTruckVehicle);
}); });
return; return;
@ -446,11 +454,13 @@ async function runWorkflow(page: Page, testCase: TestCase) {
isPolicyFound = false; // Flow proceeds as unverified isPolicyFound = false; // Flow proceeds as unverified
testCase.testData.isPolicyFound = false; testCase.testData.isPolicyFound = false;
await test.step('VehicleDamagePage >> Click Edit Vehicle', async () => { await test.step('VehicleDamagePage >> Click Edit Vehicle', async () => {
await vehicleDamagePage.validateURL(vehicleDamagePage.url);
await vehicleDamagePage.editVehicleButton.click(); await vehicleDamagePage.editVehicleButton.click();
}); });
await test.step('VehicleDetailsPage >> Select edited vehicle', async () => { await test.step('VehicleDetailsPage >> Select edited vehicle', async () => {
await test.step('VehicleDetailsPage >> Select Vehicle', async () => { await test.step('VehicleDetailsPage >> Select Vehicle', async () => {
await vehicleSelectionPage.validateURL(vehicleSelectionPage.url);
await vehicleSelectionPage.selectVehicle(editVehicleDetails); await vehicleSelectionPage.selectVehicle(editVehicleDetails);
await vehicleSelectionPage.nextPage(); await vehicleSelectionPage.nextPage();
}); });
@ -458,6 +468,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
} }
await test.step('VehicleDamagePage >> Select Damage', async () => { await test.step('VehicleDamagePage >> Select Damage', async () => {
await vehicleDamagePage.validateURL(vehicleDamagePage.url);
if (isSeparateApptsWarning) { if (isSeparateApptsWarning) {
await vehicleDamagePage.checkSeparateApptsWarning(); await vehicleDamagePage.checkSeparateApptsWarning();
} }
@ -467,14 +478,17 @@ async function runWorkflow(page: Page, testCase: TestCase) {
if (isPartsServiceErrorBailout) { if (isPartsServiceErrorBailout) {
await test.step('VehicleLookupPage >> Select Lookup Type', async () => { await test.step('VehicleLookupPage >> Select Lookup Type', async () => {
await vehicleLookupPage.validateURL(vehicleLookupPage.url);
await vehicleLookupPage.vehicleLookup(vehicleDetails!); await vehicleLookupPage.vehicleLookup(vehicleDetails!);
}); });
await test.step('VinLookupPage >> Lookup by VIN', async () => { await test.step('VinLookupPage >> Lookup by VIN', async () => {
await vinLookupPage.validateURL(vinLookupPage.url);
await vinLookupPage.enterVin(vehicleDetails!.vin!); await vinLookupPage.enterVin(vehicleDetails!.vin!);
forceAPIError(page, '/parts/api/v1/parts') forceAPIError(page, '/parts/api/v1/parts')
await vinLookupPage.nextPage(); await vinLookupPage.nextPage();
}); });
await test.step('BailoutPage >> Parts Service Error Bailout', async () => { await test.step('BailoutPage >> Parts Service Error Bailout', async () => {
await bailoutPage.validateURL(bailoutPage.url);
await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.PartsServiceError); await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.PartsServiceError);
return; return;
}); });
@ -485,11 +499,13 @@ async function runWorkflow(page: Page, testCase: TestCase) {
await test.step('VehicleLookupPage >> Select Lookup Type' + vehicleDetails?.vehicleLookupType, async () => { await test.step('VehicleLookupPage >> Select Lookup Type' + vehicleDetails?.vehicleLookupType, async () => {
await vehicleLookupPage.validateURL(vehicleLookupPage.url);
await vehicleLookupPage.vehicleLookup(vehicleDetails!); await vehicleLookupPage.vehicleLookup(vehicleDetails!);
}); });
if (testCase.testData.isVehicleSelectBailout) { if (isVehicleSelectBailout) {
await vinLookupPage.validateURL(vinLookupPage.url);
await test.step('Lookup vehicle >> By VIN-' + vehicleDetails!.vin!, async () => { await test.step('Lookup vehicle >> By VIN-' + vehicleDetails!.vin!, async () => {
await vinLookupPage.enterVin(vehicleDetails!.vin!); await vinLookupPage.enterVin(vehicleDetails!.vin!);
}); });
@ -507,11 +523,13 @@ async function runWorkflow(page: Page, testCase: TestCase) {
switch (vehicleDetails!.vehicleLookupType!) { switch (vehicleDetails!.vehicleLookupType!) {
case VehicleLookupType.Address: case VehicleLookupType.Address:
await test.step('VehicleLookupAddressPage >> Lookup by address: ' + customerDetails!.address.street, async () => { await test.step('VehicleLookupAddressPage >> Lookup by address: ' + customerDetails!.address.street, async () => {
await vehicleLookupAddressPage.validateURL(vehicleLookupAddressPage.url);
await vehicleLookupAddressPage.lookupVehicleByAddress(customerDetails!, vehicleDetails!); await vehicleLookupAddressPage.lookupVehicleByAddress(customerDetails!, vehicleDetails!);
await vehicleLookupAddressPage.nextPage(); await vehicleLookupAddressPage.nextPage();
}); });
break; break;
case VehicleLookupType.LicensePlateNumber: case VehicleLookupType.LicensePlateNumber:
await vehicleLookupLicensePage.validateURL(vehicleLookupLicensePage.url);
if (isVehicleLookupValidations) { if (isVehicleLookupValidations) {
await test.step('VehicleLookupLicensePage >> Lookup by license plate: ' + vehicleDetails!.licensePlateNumber, async () => { await test.step('VehicleLookupLicensePage >> Lookup by license plate: ' + vehicleDetails!.licensePlateNumber, async () => {
await vehicleLookupLicensePage.enterPlateDetails(vehicleDetails!, isVehicleLookupValidations); await vehicleLookupLicensePage.enterPlateDetails(vehicleDetails!, isVehicleLookupValidations);
@ -527,6 +545,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
break; break;
case VehicleLookupType.Vin: case VehicleLookupType.Vin:
await test.step('VinLookupPage >> Lookup by VIN: ' + vehicleDetails!.vin!, async () => { await test.step('VinLookupPage >> Lookup by VIN: ' + vehicleDetails!.vin!, async () => {
await vinLookupPage.validateURL(vinLookupPage.url);
await vinLookupPage.enterVin(vehicleDetails!.vin!, isVehicleLookupValidations); await vinLookupPage.enterVin(vehicleDetails!.vin!, isVehicleLookupValidations);
await vinLookupPage.nextPage(); await vinLookupPage.nextPage();
}); });
@ -535,6 +554,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
} }
if (isMoldingQuestion) { if (isMoldingQuestion) {
await test.step('Molding Questions Page >> Select Yes', async () => { await test.step('Molding Questions Page >> Select Yes', async () => {
await moldingQuestionsPage.validateURL(moldingQuestionsPage.url);
if (!moldingQuestionsPage) { if (!moldingQuestionsPage) {
console.error("moldingQuestionsPage is not initialized"); console.error("moldingQuestionsPage is not initialized");
} }
@ -543,24 +563,28 @@ async function runWorkflow(page: Page, testCase: TestCase) {
}); });
} }
if (capabilityQuestions && capabilityQuestions.length > 0) { if (capabilityQuestions && capabilityQuestions.length > 0) {
await capabilityQuestionsPage.validateURL(capabilityQuestionsPage.url);
await capabilityQuestionsPage.validatePartQuestions(capabilityQuestions); await capabilityQuestionsPage.validatePartQuestions(capabilityQuestions);
await capabilityQuestionsPage.selectPartQuestionResponses(capabilityQuestions); await capabilityQuestionsPage.selectPartQuestionResponses(capabilityQuestions);
await capabilityQuestionsPage.nextPage(); await capabilityQuestionsPage.nextPage();
} }
if (partQuestions && partQuestions.length > 0) { if (partQuestions && partQuestions.length > 0) {
await partQuestionsPage.validateURL(partQuestionsPage.url);
await partQuestionsPage.validatePartQuestions(partQuestions); await partQuestionsPage.validatePartQuestions(partQuestions);
await partQuestionsPage.selectPartQuestionResponses(partQuestions); await partQuestionsPage.selectPartQuestionResponses(partQuestions);
await partQuestionsPage.nextPage(); await partQuestionsPage.nextPage();
} }
if (vehiclePartQuestions && vehiclePartQuestions.length > 0) { if (vehiclePartQuestions && vehiclePartQuestions.length > 0) {
await vehiclePartQuestionsPage.validateURL(vehiclePartQuestionsPage.url);
await vehiclePartQuestionsPage.validatePartQuestions(vehiclePartQuestions); await vehiclePartQuestionsPage.validatePartQuestions(vehiclePartQuestions);
await vehiclePartQuestionsPage.selectPartQuestionResponses(vehiclePartQuestions); await vehiclePartQuestionsPage.selectPartQuestionResponses(vehiclePartQuestions);
await vehiclePartQuestionsPage.nextPage(); await vehiclePartQuestionsPage.nextPage();
} }
await test.step('CoverageStatementPage >> Next page', async () => { await test.step('CoverageStatementPage >> Next page', async () => {
await coverageStatementPage.validateURL(coverageStatementPage.url);
// Confirm no coverage // Confirm no coverage
if (isPolicyFound && (isItac || isNoComp)) { if (isPolicyFound && (isItac || isNoComp)) {
await coverageStatementPage.continueToScheduleButton.click(); await coverageStatementPage.continueToScheduleButton.click();
@ -571,6 +595,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
if (hasStateLawPopup) { if (hasStateLawPopup) {
await test.step('ProviderPreferencePage >> Dismiss state law popup', async () => { await test.step('ProviderPreferencePage >> Dismiss state law popup', async () => {
await providerPreferencePage.validateURL(providerPreferencePage.url);
await providerPreferencePage.validateStateLawModalIsVisible(); await providerPreferencePage.validateStateLawModalIsVisible();
await providerPreferencePage.gotItButton.click(); await providerPreferencePage.gotItButton.click();
}); });
@ -578,17 +603,20 @@ async function runWorkflow(page: Page, testCase: TestCase) {
if (!isPolicyFound || !(isItac || isNoComp)) { if (!isPolicyFound || !(isItac || isNoComp)) {
await test.step('ProviderPreferencePage >> Select Provider ' + isSafelite ? "Safelite" : "Other shops(Non-Safelite)", async () => { await test.step('ProviderPreferencePage >> Select Provider ' + isSafelite ? "Safelite" : "Other shops(Non-Safelite)", async () => {
await providerPreferencePage.validateURL(providerPreferencePage.url);
await providerPreferencePage.selectProvider(isSafelite); await providerPreferencePage.selectProvider(isSafelite);
}); });
} }
// validations for Recal warning mesage // validations for Recal warning mesage
if (isRecalWarning) { if (isRecalWarning) {
await serviceLocationPage.validateURL(serviceLocationPage.url);
await serviceLocationPage.validateRecalWarning(); await serviceLocationPage.validateRecalWarning();
} }
// if isRecalNotifidation flag true additional step to acknowledge Recal notification. // if isRecalNotifidation flag true additional step to acknowledge Recal notification.
if (isRecalNotification) { if (isRecalNotification) {
await providerPreferencePage.validateURL(providerPreferencePage.url);
await providerPreferencePage.acknowledgeRecalNotificaiton(); await providerPreferencePage.acknowledgeRecalNotificaiton();
} }
// If No-Comp or ITAC, ProviderPreferencePage does not appear // If No-Comp or ITAC, ProviderPreferencePage does not appear
@ -599,6 +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. 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('***** Performing Safelite flow for Federal Insurance due to defec# SSR-1984 *****', async () => { });
await test.step('TpaSearchPage >> TPA Search', async () => { await test.step('TpaSearchPage >> TPA Search', async () => {
await tpaSearchPage.validateURL(tpaSearchPage.url);
await tpaSearchPage.selectFirstLocation(); await tpaSearchPage.selectFirstLocation();
// await tpaSearchPage.nextPage(); // await tpaSearchPage.nextPage();
}); });
@ -606,6 +635,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
} }
if (isTpaNotEnabledBailout) { if (isTpaNotEnabledBailout) {
await test.step('validateBailoutDetails >> Bailout code : ' + BailoutCode.TPANotEnabled, async () => { await test.step('validateBailoutDetails >> Bailout code : ' + BailoutCode.TPANotEnabled, async () => {
await bailoutPage.validateURL(bailoutPage.url);
await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.TPANotEnabled); await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.TPANotEnabled);
return; return;
}); });
@ -614,23 +644,28 @@ async function runWorkflow(page: Page, testCase: TestCase) {
if (isDoNotSeeMyShopBailout) { if (isDoNotSeeMyShopBailout) {
await test.step('TpaSearchPage >> Select "Do Not See My Shop"', async () => { await test.step('TpaSearchPage >> Select "Do Not See My Shop"', async () => {
await tpaSearchPage.validateURL(tpaSearchPage.url);
await tpaSearchPage.selectDoNotSeeMyShop(); await tpaSearchPage.selectDoNotSeeMyShop();
}); });
await bailoutPage.validateURL(bailoutPage.url);
await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.DoNotSeeMyShop); await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.DoNotSeeMyShop);
return; return;
} }
await test.step('TpaSearchPage >> TPA Search', async () => { await test.step('TpaSearchPage >> TPA Search', async () => {
await tpaSearchPage.validateURL(tpaSearchPage.url);
await tpaSearchPage.selectFirstLocation(); await tpaSearchPage.selectFirstLocation();
await tpaSearchPage.nextPage(); await tpaSearchPage.nextPage();
}); });
await test.step('TpaSubmitPage >> TPA Submit', async () => { await test.step('TpaSubmitPage >> TPA Submit', async () => {
// TODO: Validations // TODO: Validations
await tpaSubmitPage.validateURL(tpaSubmitPage.url);
await tpaSubmitPage.nextPage(); await tpaSubmitPage.nextPage();
}); });
await test.step('TpaConfirmationPage >> TPA Confirmation', async () => { await test.step('TpaConfirmationPage >> TPA Confirmation', async () => {
await tpaConfirmationPage.validateURL(tpaConfirmationPage.url);
await tpaConfirmationPage.validateSuccessMessage(); await tpaConfirmationPage.validateSuccessMessage();
return; return;
}); });
@ -639,6 +674,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
} }
await test.step('ServiceLocationPage >> Select service location', async () => { await test.step('ServiceLocationPage >> Select service location', async () => {
await serviceLocationPage.validateURL(serviceLocationPage.url);
await serviceLocationPage.selectLocation(appointmentDetails!); await serviceLocationPage.selectLocation(appointmentDetails!);
if (hasMilitaryWarning) { if (hasMilitaryWarning) {
await expect.soft(serviceLocationPage.militaryWarningMessage).toBeVisible(); await expect.soft(serviceLocationPage.militaryWarningMessage).toBeVisible();
@ -647,6 +683,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
}); });
await test.step('SchedulePage >> Select day and time', async () => { await test.step('SchedulePage >> Select day and time', async () => {
await schedulePage.validateURL(schedulePage.url);
customerDetails!.apptDate = await schedulePage.scheduleFirstAppointment(appointmentDetails!.serviceLocation); customerDetails!.apptDate = await schedulePage.scheduleFirstAppointment(appointmentDetails!.serviceLocation);
}); });
@ -657,6 +694,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
email: customerDetails!.email, email: customerDetails!.email,
phoneNumber: customerDetails!.phoneNumber phoneNumber: customerDetails!.phoneNumber
}; };
await contactDetailsPage.validateURL(contactDetailsPage.url);
const actualContactDetails = await contactDetailsPage.getContactDetails(); const actualContactDetails = await contactDetailsPage.getContactDetails();
expect.soft(actualContactDetails).toEqual(expectedContactDetails); expect.soft(actualContactDetails).toEqual(expectedContactDetails);
@ -671,28 +709,33 @@ async function runWorkflow(page: Page, testCase: TestCase) {
if (isPriceServiceErrorBailout) { if (isPriceServiceErrorBailout) {
await test.step('BailoutPage >> Price Service Error Bailout', async () => { await test.step('BailoutPage >> Price Service Error Bailout', async () => {
await bailoutPage.validateURL(bailoutPage.url);
await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.PricingResponseError); await bailoutPage.validateBailoutDetails(customerDetails!, BailoutCode.PricingResponseError);
}); });
return; return;
} }
await test.step('ServicePackagesPage >> Choose service package', async () => { await test.step('ServicePackagesPage >> Choose service package', async () => {
await servicePackagesPage.validateURL(servicePackagesPage.url);
customerDetails!.packagePrice = await servicePackagesPage.selectServicePackage(servicePackage!); customerDetails!.packagePrice = await servicePackagesPage.selectServicePackage(servicePackage!);
await servicePackagesPage.nextPage(); await servicePackagesPage.nextPage();
}); });
if (isPolicyFound && (isUseVehicleOnPolicy ?? true) && claimDetails!.policyDeductible > 0) { if (isPolicyFound && (isUseVehicleOnPolicy ?? true) && claimDetails!.policyDeductible > 0) {
await test.step('PaymentMethodPage >> Execute Payment', async () => { await test.step('PaymentMethodPage >> Execute Payment', async () => {
await paymentMethodPage.validateURL(paymentMethodPage.url);
await paymentMethodPage.executePayment(paymentDetails!); await paymentMethodPage.executePayment(paymentDetails!);
await paymentMethodPage.nextPage(); await paymentMethodPage.nextPage();
}); });
} else { } else {
await test.step('PaymentMethodPage >> Skip to Order Confirmation', async () => { await test.step('PaymentMethodPage >> Skip to Order Confirmation', async () => {
await paymentMethodPage.validateURL(paymentMethodPage.url);
await paymentMethodPage.nextPage(); await paymentMethodPage.nextPage();
}); });
} }
await test.step('OrderConfirmationPage >> Validate order', async () => { await test.step('OrderConfirmationPage >> Validate order', async () => {
await orderConfirmationPage.validateURL(orderConfirmationPage.url);
await orderConfirmationPage.validateOrderConfirmationPage(testCase.testData); await orderConfirmationPage.validateOrderConfirmationPage(testCase.testData);
}); });
} }