changes related to heritage parity changes
This commit is contained in:
parent
b24c32781c
commit
7d40097bea
4 changed files with 48 additions and 24 deletions
|
|
@ -5,23 +5,23 @@ export enum PaymentMethod {
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum ProgressBarPercentages {
|
export enum ProgressBarPercentages {
|
||||||
VehicleSelectionPage = '4%',
|
VehicleSelectionPage = '8%',
|
||||||
VehicleDamagePage = '16%',
|
VehicleDamagePage = '11%',
|
||||||
EstimatePage = '28%',
|
EstimatePage = '18%',
|
||||||
ServiceZipPage = '32%',
|
ServiceZipPage = '22%',
|
||||||
VehicleLookupAddressPage = '32%',
|
VehicleLookupAddressPage = '22%',
|
||||||
VehicleLookupLicensePage = '32%',
|
VehicleLookupLicensePage = '22%',
|
||||||
VinLookupPage = '32%',
|
VinLookupPage = '22%',
|
||||||
PartQuestionsPage = '40%',
|
PartQuestionsPage = '30%',
|
||||||
MoldingQuestionsPage = '40%',
|
MoldingQuestionsPage = '30%',
|
||||||
CapabilityQuestionsPage = '40%',
|
CapabilityQuestionsPage = '30%',
|
||||||
VehiclePartsPage = '40%',
|
VehiclePartsPage = '30%',
|
||||||
ServicePackagePage = '48%',
|
ServicePackagePage = '62%',
|
||||||
InsuranceCompanyPage = '52%',
|
InsuranceCompanyPage = '52%',
|
||||||
ServiceLocationPage = '60%',
|
ServiceLocationPage = '76%',
|
||||||
SchedulePage = '64%',
|
SchedulePage = '76%',
|
||||||
MobileDetailsPage = '76%',
|
MobileDetailsPage = '76%',
|
||||||
ContactDetailsPage = '84%',
|
ContactDetailsPage = '84%',
|
||||||
PaymentMethodPage = '92%',
|
PaymentMethodPage = '97%',
|
||||||
OrderConfirmationPage = '100%'
|
OrderConfirmationPage = '100%'
|
||||||
}
|
}
|
||||||
|
|
@ -25,7 +25,7 @@ export class BasePage {
|
||||||
this.pageSpinner = page.getByRole('status');
|
this.pageSpinner = page.getByRole('status');
|
||||||
this.buttonLoadSpin = page.getByRole('alert');
|
this.buttonLoadSpin = page.getByRole('alert');
|
||||||
this.hamburgerMenu = this.page.getByRole('button', { name: 'Hamburger Menu (modal window)' });
|
this.hamburgerMenu = this.page.getByRole('button', { name: 'Hamburger Menu (modal window)' });
|
||||||
this.progressBar = this.page.locator('.progress-bar-inner');
|
this.progressBar = this.page.locator('.progress-bar-outer.progress-bar-inner');
|
||||||
}
|
}
|
||||||
|
|
||||||
async nextPage() {
|
async nextPage() {
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,11 @@ export class SchedulePage extends BasePage {
|
||||||
readonly militaryWarningMessage: Locator;
|
readonly militaryWarningMessage: Locator;
|
||||||
readonly changeZipButton: Locator;
|
readonly changeZipButton: Locator;
|
||||||
readonly updateZipTextBox: Locator;
|
readonly updateZipTextBox: Locator;
|
||||||
|
readonly safeliteShopsList: Locator;
|
||||||
|
readonly searchButton: Locator;
|
||||||
|
readonly storeAddressText: Locator;
|
||||||
readonly saveLocationButton: Locator;
|
readonly saveLocationButton: Locator;
|
||||||
readonly changeShopLocationLink: Locator;
|
readonly moreLocationsButton: Locator;
|
||||||
readonly selectAShopOptions: Locator;
|
readonly selectAShopOptions: Locator;
|
||||||
readonly yourSafeliteShop: Locator;
|
readonly yourSafeliteShop: Locator;
|
||||||
|
|
||||||
|
|
@ -44,8 +47,11 @@ export class SchedulePage extends BasePage {
|
||||||
this.militaryWarningMessage = this.page.locator('[class*="widget-name-AlertMilitaryBaseZipWidget"]');
|
this.militaryWarningMessage = this.page.locator('[class*="widget-name-AlertMilitaryBaseZipWidget"]');
|
||||||
this.changeZipButton = this.page.locator('a:has(span.sr-only:has-text("edit zip code"))');
|
this.changeZipButton = this.page.locator('a:has(span.sr-only:has-text("edit zip code"))');
|
||||||
this.updateZipTextBox = this.page.locator('#serviceZipCode').filter({ visible: true });
|
this.updateZipTextBox = this.page.locator('#serviceZipCode').filter({ visible: true });
|
||||||
|
this.safeliteShopsList = this.page.locator('fieldset:has(#chooseShop) label');
|
||||||
|
this.searchButton = this.page.locator('.search-icon-button');
|
||||||
|
this.storeAddressText = this.page.locator('#shop-location label:not(:first-child)');
|
||||||
this.saveLocationButton = this.page.getByText('Save location', { exact: true });
|
this.saveLocationButton = this.page.getByText('Save location', { exact: true });
|
||||||
this.changeShopLocationLink = this.page.locator(".shop-question a").filter({ hasText: "Change shop location " });
|
this.moreLocationsButton = this.page.locator(".shop-question a").filter({ hasText: "More locations " });
|
||||||
this.selectAShopOptions = this.page.locator('[class="shop-question"]');
|
this.selectAShopOptions = this.page.locator('[class="shop-question"]');
|
||||||
this.yourSafeliteShop = this.page.locator("fieldset:has(#chooseShop) label");
|
this.yourSafeliteShop = this.page.locator("fieldset:has(#chooseShop) label");
|
||||||
|
|
||||||
|
|
@ -58,7 +64,7 @@ export class SchedulePage extends BasePage {
|
||||||
this.dateText = this.page.locator('label.modal-title');
|
this.dateText = this.page.locator('label.modal-title');
|
||||||
this.viewMoreDatesLink = this.page.getByText(/View more dates/).first();
|
this.viewMoreDatesLink = this.page.getByText(/View more dates/).first();
|
||||||
this.appointmentDuration = this.page.locator('.duration-text-block');
|
this.appointmentDuration = this.page.locator('.duration-text-block');
|
||||||
this.timeSlots = this.page.locator('fieldset[aria-labelledby=\'chooseTimeSlot\'] label');
|
this.timeSlots = this.page.locator('fieldset:has(>legend#chooseTimeSlot) label');
|
||||||
}
|
}
|
||||||
|
|
||||||
async selectLocation(testData: Partial<ITestData>) {
|
async selectLocation(testData: Partial<ITestData>) {
|
||||||
|
|
@ -82,19 +88,37 @@ export class SchedulePage extends BasePage {
|
||||||
if (zipCodeMatch) {
|
if (zipCodeMatch) {
|
||||||
const zipCode = zipCodeMatch[0];
|
const zipCode = zipCodeMatch[0];
|
||||||
// Enter the ZIP code into the updateZipTextBox
|
// Enter the ZIP code into the updateZipTextBox
|
||||||
await this.changeShopLocationLink.click();
|
await this.moreLocationsButton.click();
|
||||||
await this.page.waitForTimeout(500);
|
await this.page.waitForTimeout(500);
|
||||||
await this.updateZipTextBox.fill(zipCode);
|
await this.updateZipTextBox.fill(zipCode);
|
||||||
|
await this.searchButton.click().then( async() => await this.page.locator('loader-wrapper').waitFor({state: 'hidden'}));
|
||||||
|
await this.safeliteShopsList.first().click();
|
||||||
// Click the save location button
|
// Click the save location button
|
||||||
await this.saveLocationButton.click();
|
await this.saveLocationButton.click();
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.inShopButton.click();
|
await this.inShopButton.click().then(async () => {
|
||||||
|
if (appointmentDetails && (appointmentDetails.shopAddress === "" || appointmentDetails.shopAddress === undefined )) {
|
||||||
|
appointmentDetails.shopAddress = '';
|
||||||
|
const elements = await this.storeAddressText.all();
|
||||||
|
elements.forEach(async(element) => {
|
||||||
|
appointmentDetails.shopAddress += await element.textContent() || "" + " ";
|
||||||
|
});
|
||||||
|
appointmentDetails.shopAddress?.trim();
|
||||||
|
}
|
||||||
|
});
|
||||||
// await this.selectAShopOptions.locator(`[buttonbodycopy="${appointmentDetails.shopAddress}"]`).scrollIntoViewIfNeeded().then(() => this.selectAShopOptions.locator(`[buttonbodycopy="${appointmentDetails.shopAddress}"]`).click());
|
// await this.selectAShopOptions.locator(`[buttonbodycopy="${appointmentDetails.shopAddress}"]`).scrollIntoViewIfNeeded().then(() => this.selectAShopOptions.locator(`[buttonbodycopy="${appointmentDetails.shopAddress}"]`).click());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (appointmentDetails && (appointmentDetails.shopAddress === "" || appointmentDetails.shopAddress === undefined )) {
|
if (appointmentDetails && (appointmentDetails.shopAddress === "" || appointmentDetails.shopAddress === undefined )) {
|
||||||
appointmentDetails.shopAddress = await this.yourSafeliteShop.getAttribute("buttonbodycopy") || "";
|
appointmentDetails.shopAddress = '';
|
||||||
|
const elements = await this.storeAddressText.all();
|
||||||
|
elements.forEach(async(element) =>
|
||||||
|
{
|
||||||
|
appointmentDetails.shopAddress += await element.textContent() || "" + " ";
|
||||||
|
}
|
||||||
|
)
|
||||||
|
appointmentDetails.shopAddress?.trim();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -186,7 +210,7 @@ export class SchedulePage extends BasePage {
|
||||||
}
|
}
|
||||||
|
|
||||||
// appointmentmentDetails.serviceLocation === ServiceLocation.DropOff ? await this.dropOffButton.click() : await this.firstAvailableTime.click();
|
// appointmentmentDetails.serviceLocation === ServiceLocation.DropOff ? await this.dropOffButton.click() : await this.firstAvailableTime.click();
|
||||||
customerDetails!.apptDuration = (await this.appointmentDuration.innerText()).replace("Duration: ", "");
|
customerDetails!.apptDuration = (await this.appointmentDuration.innerText()).replace("Your service will take approximately ", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
async getFormattedTimeSlot(timeSlot: Locator) {
|
async getFormattedTimeSlot(timeSlot: Locator) {
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ export class ServicePackagesPage extends BasePage {
|
||||||
this.iHavePromoCodeButton = this.page.getByRole('link', { name: 'I have a promo code' });
|
this.iHavePromoCodeButton = this.page.getByRole('link', { name: 'I have a promo code' });
|
||||||
this.skipQuoteEmailButton = this.page.getByRole('button', { name: 'Skip' });
|
this.skipQuoteEmailButton = this.page.getByRole('button', { name: 'Skip' });
|
||||||
this.emailInput = this.page.getByRole('textbox', { name: 'Enter your email address' });
|
this.emailInput = this.page.getByRole('textbox', { name: 'Enter your email address' });
|
||||||
this.getMyQuoteButton = this.page.getByRole('button', { name: 'Get my quote' });
|
this.getMyQuoteButton = this.page.getByRole('button', { name: 'Send' });
|
||||||
this.closeButton = this.page. getByRole('dialog').locator('button').filter({ hasText: 'Close' });
|
this.closeButton = this.page. getByRole('dialog').locator('button').filter({ hasText: 'Close' });
|
||||||
this.promoCodeTextbox = this.page.getByLabel('Enter a promo code');
|
this.promoCodeTextbox = this.page.getByLabel('Enter a promo code');
|
||||||
this.applyPromoButton = this.page.getByRole('button', { name: 'Apply promo code' });
|
this.applyPromoButton = this.page.getByRole('button', { name: 'Apply promo code' });
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue