Add flag for when Safelite can recalibrate
This commit is contained in:
parent
9b849aac04
commit
ec3c83adfe
3 changed files with 27 additions and 7 deletions
|
|
@ -39,6 +39,7 @@ export interface ITestData {
|
|||
isRecalNotification: boolean,
|
||||
isRecalWarning: boolean,
|
||||
isRecalVehicle: boolean,
|
||||
isCanSafeliteRecalibrate: boolean, // Can Safelite recalibrate the vehicle? If no, modal displays after clicking time slot and continue
|
||||
isSeparateApptsWarning: boolean, // IF true, check for the separate appts warning on VehicleDamagePage
|
||||
isAuthenticationRequired: boolean,
|
||||
isMoldingQuestion: boolean,
|
||||
|
|
|
|||
|
|
@ -25,6 +25,11 @@ export class SchedulePage extends BasePage {
|
|||
readonly dateText: Locator;
|
||||
readonly viewMoreDatesLink: Locator;
|
||||
|
||||
readonly recalAcknowledgementModal: Locator;
|
||||
readonly learnMoreLinkRecalAcknowledgementModal: Locator;
|
||||
readonly recalAcknowledgementCheckBox: Locator;
|
||||
readonly continueButtonRecalAcknowledgementModal: Locator;
|
||||
|
||||
readonly continueButton: Locator;
|
||||
|
||||
constructor(page: Page) {
|
||||
|
|
@ -50,6 +55,12 @@ export class SchedulePage extends BasePage {
|
|||
this.dateText = this.page.locator('[class="modal-header mb-2 mt-2"]');
|
||||
this.viewMoreDatesLink = this.page.getByRole('button', { name: 'More Right arrow icon' });
|
||||
|
||||
// Recal acknowledgement modal when Safelite cannot recalibrate the vehicle
|
||||
this.recalAcknowledgementModal = this.page.getByLabel('ModalComponentLabel');
|
||||
this.learnMoreLinkRecalAcknowledgementModal = this.page.getByRole('link', { name: 'Learn more' });
|
||||
this.recalAcknowledgementCheckBox = this.page.getByRole('checkbox', { name: /I acknowledge/i });
|
||||
this.continueButtonRecalAcknowledgementModal = this.page.locator('#RecalAckModalWidget').getByRole('button', { name: 'Continue' });
|
||||
|
||||
this.continueButton = this.page.locator('#stacked').locator('button:has-text("Continue")');
|
||||
}
|
||||
|
||||
|
|
@ -111,4 +122,10 @@ export class SchedulePage extends BasePage {
|
|||
const nonDropOff = timeSlots.filter({ hasNotText: /Drop & Go/i });
|
||||
return nonDropOff.first();
|
||||
}
|
||||
|
||||
async validateRecalAcknowledgementModal() {
|
||||
await this.learnMoreLinkRecalAcknowledgementModal.click();
|
||||
await this.recalAcknowledgementCheckBox.click();
|
||||
await this.continueButtonRecalAcknowledgementModal.click();
|
||||
}
|
||||
}
|
||||
|
|
@ -379,7 +379,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
isRecalWarning, servicePackage, hasOemEndorsement, hasStateLawPopup, otherVehiclesOnPolicy, isUseVehicleFromAddressLookup,
|
||||
isSeparateApptsWarning, vehiclePartQuestions, editVehicleDetails, isAddressLookupValidations,
|
||||
hasMilitaryWarning, capabilityQuestions, isUseVehicleOnPolicy,
|
||||
isVehicleLookupValidations, isMoldingQuestion, isNonServiceable, isNonServiceableVin, isRecalVehicle } = testCase.testData;
|
||||
isVehicleLookupValidations, isMoldingQuestion, isNonServiceable, isNonServiceableVin, isRecalVehicle, isCanSafeliteRecalibrate } = testCase.testData;
|
||||
|
||||
let { isPolicyFound } = testCase.testData; // Allow isPolicyFound to be re-assigned
|
||||
|
||||
|
|
@ -732,7 +732,7 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
await expect(async () => {
|
||||
await providerPreferencePage.stateLawModalOkayButton.waitFor({ state: 'visible' });
|
||||
await providerPreferencePage.stateLawModalOkayButton.click();
|
||||
}).toPass({ timeout: 30000 });
|
||||
}).toPass({ timeout: 60_000 });
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -829,13 +829,15 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
|||
await test.step('SchedulePage >> Select day and time', async () => {
|
||||
await schedulePage.validateURL(schedulePage.issPageValue);
|
||||
|
||||
if (appointmentDetails?.serviceLocation === ServiceLocation.Mobile) {
|
||||
await schedulePage.scheduleMobile(appointmentDetails);
|
||||
if (isCanSafeliteRecalibrate === false) {
|
||||
await schedulePage.validateRecalAcknowledgementModal();
|
||||
await schedulePage.scheduleInShop(appointmentDetails!);
|
||||
} else if (appointmentDetails?.serviceLocation === ServiceLocation.InShop || appointmentDetails?.serviceLocation === ServiceLocation.DropOff) {
|
||||
await schedulePage.scheduleInShop(appointmentDetails!);
|
||||
} else {
|
||||
await schedulePage.scheduleMobile(appointmentDetails!);
|
||||
}
|
||||
|
||||
if (appointmentDetails?.serviceLocation === ServiceLocation.InShop || appointmentDetails?.serviceLocation === ServiceLocation.DropOff) {
|
||||
await schedulePage.scheduleInShop(appointmentDetails);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue