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,
|
isRecalNotification: boolean,
|
||||||
isRecalWarning: boolean,
|
isRecalWarning: boolean,
|
||||||
isRecalVehicle: 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
|
isSeparateApptsWarning: boolean, // IF true, check for the separate appts warning on VehicleDamagePage
|
||||||
isAuthenticationRequired: boolean,
|
isAuthenticationRequired: boolean,
|
||||||
isMoldingQuestion: boolean,
|
isMoldingQuestion: boolean,
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,11 @@ export class SchedulePage extends BasePage {
|
||||||
readonly dateText: Locator;
|
readonly dateText: Locator;
|
||||||
readonly viewMoreDatesLink: Locator;
|
readonly viewMoreDatesLink: Locator;
|
||||||
|
|
||||||
|
readonly recalAcknowledgementModal: Locator;
|
||||||
|
readonly learnMoreLinkRecalAcknowledgementModal: Locator;
|
||||||
|
readonly recalAcknowledgementCheckBox: Locator;
|
||||||
|
readonly continueButtonRecalAcknowledgementModal: Locator;
|
||||||
|
|
||||||
readonly continueButton: Locator;
|
readonly continueButton: Locator;
|
||||||
|
|
||||||
constructor(page: Page) {
|
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.dateText = this.page.locator('[class="modal-header mb-2 mt-2"]');
|
||||||
this.viewMoreDatesLink = this.page.getByRole('button', { name: 'More Right arrow icon' });
|
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")');
|
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 });
|
const nonDropOff = timeSlots.filter({ hasNotText: /Drop & Go/i });
|
||||||
return nonDropOff.first();
|
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,
|
isRecalWarning, servicePackage, hasOemEndorsement, hasStateLawPopup, otherVehiclesOnPolicy, isUseVehicleFromAddressLookup,
|
||||||
isSeparateApptsWarning, vehiclePartQuestions, editVehicleDetails, isAddressLookupValidations,
|
isSeparateApptsWarning, vehiclePartQuestions, editVehicleDetails, isAddressLookupValidations,
|
||||||
hasMilitaryWarning, capabilityQuestions, isUseVehicleOnPolicy,
|
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
|
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 expect(async () => {
|
||||||
await providerPreferencePage.stateLawModalOkayButton.waitFor({ state: 'visible' });
|
await providerPreferencePage.stateLawModalOkayButton.waitFor({ state: 'visible' });
|
||||||
await providerPreferencePage.stateLawModalOkayButton.click();
|
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 test.step('SchedulePage >> Select day and time', async () => {
|
||||||
await schedulePage.validateURL(schedulePage.issPageValue);
|
await schedulePage.validateURL(schedulePage.issPageValue);
|
||||||
|
|
||||||
if (appointmentDetails?.serviceLocation === ServiceLocation.Mobile) {
|
if (isCanSafeliteRecalibrate === false) {
|
||||||
await schedulePage.scheduleMobile(appointmentDetails);
|
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