From 458e552d6baa412d17709d347f8d08928d17ef53 Mon Sep 17 00:00:00 2001 From: maguire-arman Date: Mon, 14 Jul 2025 16:13:56 -0400 Subject: [PATCH] Removes URL declaration from page classes Removes the explicit URL declaration from the page classes. The URL validation and navigation are now handled directly within the tests, providing greater flexibility and control over test execution and removing the need to manage URLs within each page object. --- playwright-tests/pages/BaseHomepage.ts | 1 - playwright-tests/pages/BasePage.ts | 5 ----- playwright-tests/pages/CCPolicyInfoPage.ts | 2 -- playwright-tests/pages/CapabilityQuestionsPage.ts | 1 - playwright-tests/pages/ContactDetailsPage.ts | 1 - playwright-tests/pages/CoverageStatementPage.ts | 2 -- playwright-tests/pages/DuplicateCheckPage.ts | 2 -- playwright-tests/pages/EndorsementsPage.ts | 1 - playwright-tests/pages/EstimatePage.ts | 3 --- playwright-tests/pages/HomePage.ts | 1 - playwright-tests/pages/InsuranceCompanyPage.ts | 4 ---- playwright-tests/pages/LeadgenHomePage.ts | 2 -- playwright-tests/pages/MoldingQuestionsPage.ts | 1 - playwright-tests/pages/OrderConfirmationPage.ts | 3 --- playwright-tests/pages/PartQuestionPage.ts | 1 - playwright-tests/pages/PaymentMethodPage.ts | 2 -- playwright-tests/pages/PaymentPage.ts | 3 +-- playwright-tests/pages/PolicyDriverPage.ts | 3 --- playwright-tests/pages/PolicyInfoSubmittedPage.ts | 4 ---- playwright-tests/pages/PolicyVehiclesPage.ts | 2 -- playwright-tests/pages/RecalibrationInfoPage.ts | 1 - playwright-tests/pages/SchedulePage.ts | 1 - playwright-tests/pages/ServiceLocationPage.ts | 2 -- playwright-tests/pages/ServicePackagesPage.ts | 5 ----- playwright-tests/pages/ServiceZipPage.ts | 2 -- playwright-tests/pages/VehicleDamagePage.ts | 1 - playwright-tests/pages/VehicleLookupAddressPage.ts | 2 -- playwright-tests/pages/VehicleLookupLicensePage.ts | 2 -- playwright-tests/pages/VehiclePartsPage.ts | 1 - playwright-tests/pages/VehicleSelectionPage.ts | 3 --- playwright-tests/pages/VerifyDetailsPage.ts | 3 --- playwright-tests/pages/VinLookupPage.ts | 2 -- playwright-tests/pages/ZipLookupPage.ts | 1 - playwright-tests/tests/0000__M.test.ts | 2 +- 34 files changed, 2 insertions(+), 70 deletions(-) diff --git a/playwright-tests/pages/BaseHomepage.ts b/playwright-tests/pages/BaseHomepage.ts index 981756f90..e84d25908 100644 --- a/playwright-tests/pages/BaseHomepage.ts +++ b/playwright-tests/pages/BaseHomepage.ts @@ -8,7 +8,6 @@ export abstract class BaseHomePage extends BasePage { constructor(page: Page) { super(page); this.page = page; - this.url = process.env['BASE_URL']!; } abstract letsGetStarted(zip?: string): Promise; diff --git a/playwright-tests/pages/BasePage.ts b/playwright-tests/pages/BasePage.ts index 5ea7f4c4c..2d8d2b07a 100644 --- a/playwright-tests/pages/BasePage.ts +++ b/playwright-tests/pages/BasePage.ts @@ -53,11 +53,6 @@ export class BasePage { }).toPass({ timeout: 240_000 }); } - async validateURL(url:string){ - await expect(this.pageSpinner).toHaveCount(0, {timeout: 60000}); - await this.page.waitForURL(url); - } - async fillAndValidate(element: Locator, value: string){ await expect(async () => { var text = await element.textContent(); diff --git a/playwright-tests/pages/CCPolicyInfoPage.ts b/playwright-tests/pages/CCPolicyInfoPage.ts index cac55a01c..557ba00f7 100644 --- a/playwright-tests/pages/CCPolicyInfoPage.ts +++ b/playwright-tests/pages/CCPolicyInfoPage.ts @@ -18,8 +18,6 @@ export class CCPolicyInfoPage extends InsuranceBasePage { readonly isOtherPartyResponsibleForCoverage: Locator; readonly lossLocation: Locator; - url = `${process.env['BASE_URL']!}/FixMyGlass/CCPolicyInfo.aspx*`; - constructor(page: Page) { super(page); diff --git a/playwright-tests/pages/CapabilityQuestionsPage.ts b/playwright-tests/pages/CapabilityQuestionsPage.ts index f8f7efeb0..dd648282a 100644 --- a/playwright-tests/pages/CapabilityQuestionsPage.ts +++ b/playwright-tests/pages/CapabilityQuestionsPage.ts @@ -5,7 +5,6 @@ import { ITestData } from 'framework/TestData'; import { ProgressBarPercentages } from 'framework/localTypes/Enums'; export default class CapabilityQuestionsPage extends PartQuestionsPage { - url = process.env['BASE_URL']! + '/fmg/?fmgPage=capability-questions'; constructor(page: Page) { super(page); diff --git a/playwright-tests/pages/ContactDetailsPage.ts b/playwright-tests/pages/ContactDetailsPage.ts index 472f9db33..543ffe1b2 100644 --- a/playwright-tests/pages/ContactDetailsPage.ts +++ b/playwright-tests/pages/ContactDetailsPage.ts @@ -7,7 +7,6 @@ import { ProgressBarPercentages } from 'framework/localTypes/Enums'; export class ContactDetailsPage extends BasePage { readonly page: Page; - url = process.env['BASE_URL']! + '/fmg/?fmgPage=customer-details'; // Contact details form // TODO: Check if we can consolidate diff --git a/playwright-tests/pages/CoverageStatementPage.ts b/playwright-tests/pages/CoverageStatementPage.ts index 2931f613b..032104ec1 100644 --- a/playwright-tests/pages/CoverageStatementPage.ts +++ b/playwright-tests/pages/CoverageStatementPage.ts @@ -12,7 +12,6 @@ export class CoverageStatementPage extends InsuranceBasePage { readonly verifyingCoverageText: Locator; readonly noCompText: Locator; readonly continueButton: Locator; // For ITAC/NoComp - url = process.env['BASE_URL']! + '/FixMyGlass/CoverageStatement.aspx'; constructor(page: Page) { super(page); @@ -23,7 +22,6 @@ export class CoverageStatementPage extends InsuranceBasePage { this.verifyingCoverageText = this.page.getByRole('heading', { name: 'We\'re verifying your coverage' }); this.noCompText = this.page.getByRole('heading', { name: 'Your policy doesn\'t cover this service' }); this.continueButton = page.getByRole('button', { name: 'Continue' }); - // this.validateURL(this.url); } async scheduleOnline(){ diff --git a/playwright-tests/pages/DuplicateCheckPage.ts b/playwright-tests/pages/DuplicateCheckPage.ts index d296be792..088f7fb6a 100644 --- a/playwright-tests/pages/DuplicateCheckPage.ts +++ b/playwright-tests/pages/DuplicateCheckPage.ts @@ -6,13 +6,11 @@ import { step } from 'framework/localTypes/Step'; export class DuplicateCheckPage extends InsuranceBasePage { readonly page: Page; readonly newClaimButton: Locator; - url = process.env['BASE_URL']! + '/FixMyGlass/DuplicateCheck.aspx'; constructor(page: Page) { super(page); this.page = page; this.newClaimButton = page.locator('a').filter({ hasText: 'Start a new claim Start a new' }); - // this.validateURL(this.url); } async startNewClaim(){ diff --git a/playwright-tests/pages/EndorsementsPage.ts b/playwright-tests/pages/EndorsementsPage.ts index 5cff75f17..d5396180b 100644 --- a/playwright-tests/pages/EndorsementsPage.ts +++ b/playwright-tests/pages/EndorsementsPage.ts @@ -10,7 +10,6 @@ export class EndorsementsPage extends InsuranceBasePage { readonly page: Page; readonly educatorYesButton: Locator; readonly educatorNoButton: Locator; - url = process.env['BASE_URL']! + '/FixMyGlass/PolicyEndorsements.aspx'; constructor(page: Page) { super(page); diff --git a/playwright-tests/pages/EstimatePage.ts b/playwright-tests/pages/EstimatePage.ts index deb494a92..b004c3c47 100644 --- a/playwright-tests/pages/EstimatePage.ts +++ b/playwright-tests/pages/EstimatePage.ts @@ -18,7 +18,6 @@ export class EstimatePage extends BasePage { readonly zipLookupButton: Locator; readonly vehicleLookupAddressPage: VehicleLookupAddressPage; readonly vehicleLookupLicensePage: VehicleLookupLicensePage; - url = process.env['BASE_URL']! + '/fmg/?fmgPage=estimate'; constructor(page: Page) { super(page); @@ -28,8 +27,6 @@ export class EstimatePage extends BasePage { this.addressLookupButton = page.getByLabel('Provide my home address', { exact: true }); this.licenseLookupButton = page.getByLabel('Provide my license plate #', { exact: true }); this.vinLookupPage = new VinLookupPage(page); - - // this.validateURL(this.url); } async vehicleLookup(vehicleDetails: IVehicleDetails) { diff --git a/playwright-tests/pages/HomePage.ts b/playwright-tests/pages/HomePage.ts index 9afb0a2e1..3f934f9c9 100644 --- a/playwright-tests/pages/HomePage.ts +++ b/playwright-tests/pages/HomePage.ts @@ -53,7 +53,6 @@ export class HomePage extends BasePage { async goto() { await this.page.goto(process.env['BASE_URL']!); - // await this.validateURL(this.url); } async isCurrentVariant(): Promise { diff --git a/playwright-tests/pages/InsuranceCompanyPage.ts b/playwright-tests/pages/InsuranceCompanyPage.ts index 48ae0b588..62c199da8 100644 --- a/playwright-tests/pages/InsuranceCompanyPage.ts +++ b/playwright-tests/pages/InsuranceCompanyPage.ts @@ -10,15 +10,11 @@ export class InsuranceCompanyPage extends BasePage { readonly insuranceInputBox: Locator; readonly payOnMyOwnLink: Locator; - url = process.env['BASE_URL']! + '/fmg/?fmgPage=insurance-company'; - constructor(page: Page) { super(page); this.page = page; this.insuranceInputBox = this.page.getByRole('textbox', { name: 'Enter your insurance company' }); this.payOnMyOwnLink = this.page.getByRole('link', { name: 'Pay on my own' }); - - // this.validateURL(this.url); } async enterInsuranceCompany(company: string): Promise { diff --git a/playwright-tests/pages/LeadgenHomePage.ts b/playwright-tests/pages/LeadgenHomePage.ts index 747ed1794..8d2197728 100644 --- a/playwright-tests/pages/LeadgenHomePage.ts +++ b/playwright-tests/pages/LeadgenHomePage.ts @@ -9,7 +9,6 @@ export class LeadgenHomePage extends BasePage { readonly page: Page; readonly letsGetStartedButton: Locator; readonly zipTextbox: Locator; - url = process.env['BASE_URL']!; constructor(page: Page) { super(page); @@ -21,7 +20,6 @@ export class LeadgenHomePage extends BasePage { async goto() { await this.page.goto(process.env['BASE_URL']!); - // await this.validateURL(this.url); } async letsGetStarted(zip: string) { diff --git a/playwright-tests/pages/MoldingQuestionsPage.ts b/playwright-tests/pages/MoldingQuestionsPage.ts index 4a64901ae..3be6cd2f2 100644 --- a/playwright-tests/pages/MoldingQuestionsPage.ts +++ b/playwright-tests/pages/MoldingQuestionsPage.ts @@ -5,7 +5,6 @@ import { ITestData } from 'framework/TestData'; import { ProgressBarPercentages } from 'framework/localTypes/Enums'; export default class MoldingQuestionsPage extends PartQuestionsPage { - url = process.env['BASE_URL']! + '/fmg/?fmgPage=molding-questions'; constructor(page: Page) { super(page); diff --git a/playwright-tests/pages/OrderConfirmationPage.ts b/playwright-tests/pages/OrderConfirmationPage.ts index c6d1cb9d6..1f316dfad 100644 --- a/playwright-tests/pages/OrderConfirmationPage.ts +++ b/playwright-tests/pages/OrderConfirmationPage.ts @@ -23,8 +23,6 @@ export class OrderConfirmationPage extends BasePage { readonly rainDefense: Locator; readonly appointmentSummarySection: Locator; - url = process.env['BASE_URL']! + '/fmg/?fmgPage=confirmation'; - constructor(page: Page) { super(page); this.page = page; @@ -40,7 +38,6 @@ export class OrderConfirmationPage extends BasePage { this.finalAmountDue = this.page.locator('div.amount-due'); this.cartServicePackageText = this.cartServicePackageText = this.page.locator('.cart-panel'); this.appointmentSummarySection = this.page.locator('.main .scheduleText, .main .add-to-calendar-text, .main .appointment-text, .main .duration-text-block'); - // this.validateURL(this.url); } async validateOrderConfirmationPage(testData: Partial) { diff --git a/playwright-tests/pages/PartQuestionPage.ts b/playwright-tests/pages/PartQuestionPage.ts index 756366cb3..a6ecbc0bd 100644 --- a/playwright-tests/pages/PartQuestionPage.ts +++ b/playwright-tests/pages/PartQuestionPage.ts @@ -7,7 +7,6 @@ import { ProgressBarPercentages } from 'framework/localTypes/Enums'; export class PartQuestionsPage extends BasePage { readonly page: Page; - url = process.env['BASE_URL']! + '/fmg/?fmgPage=part-questions'; constructor(page: Page) { super(page); diff --git a/playwright-tests/pages/PaymentMethodPage.ts b/playwright-tests/pages/PaymentMethodPage.ts index 4d5c39553..7359ab436 100644 --- a/playwright-tests/pages/PaymentMethodPage.ts +++ b/playwright-tests/pages/PaymentMethodPage.ts @@ -43,8 +43,6 @@ export class PaymentMethodPage extends BasePage { readonly rainDefenseText: Locator; readonly deductibleText: Locator; - url = process.env['BASE_URL']! + '/fmg/?fmgPage=payment-method'; - constructor(page: Page) { super(page); this.page = page; diff --git a/playwright-tests/pages/PaymentPage.ts b/playwright-tests/pages/PaymentPage.ts index 9c69cb96b..9bc95fb66 100644 --- a/playwright-tests/pages/PaymentPage.ts +++ b/playwright-tests/pages/PaymentPage.ts @@ -14,7 +14,6 @@ export class PaymentPage extends BasePage { readonly billingZipTextField: Locator; readonly submitPaymentButton: Locator; readonly payPalButton: Locator; - url = process.env['BASE_URL']! + '/fmg/?fmgPage=payment'; constructor(page: Page) { super(page); @@ -29,7 +28,7 @@ export class PaymentPage extends BasePage { this.billingZipTextField = page.frameLocator('iframe[name="card-frame"]').getByRole('textbox', { name: 'Billing ZIP code' });; this.submitPaymentButton = page.frameLocator('iframe[name="card-frame"]').locator('#buttonContainer'); this.payPalButton = page.frameLocator('iframe[name="card-frame"]').locator('#paypalParentLink'); - // this.validateURL(this.url); + } async populateCreditCardDetails(paymentDetails: IPaymentDetails){ diff --git a/playwright-tests/pages/PolicyDriverPage.ts b/playwright-tests/pages/PolicyDriverPage.ts index 94bd9db19..f1c97e3ad 100644 --- a/playwright-tests/pages/PolicyDriverPage.ts +++ b/playwright-tests/pages/PolicyDriverPage.ts @@ -9,7 +9,6 @@ export class PolicyDriverPage extends InsuranceBasePage { readonly driverListItems: Locator; readonly driverNotListedOption: Locator; readonly vehicleParkedOption: Locator; - url = process.env['BASE_URL']! + '/FixMyGlass/PolicyDriver.aspx'; constructor(page: Page) { super(page); @@ -20,8 +19,6 @@ export class PolicyDriverPage extends InsuranceBasePage { // Locators for driver options this.driverNotListedOption = this.page.getByRole('link', { name: 'Driver not listed' }); this.vehicleParkedOption = this.page.getByRole('link', { name: 'Vehicle was parked' }); - - // this.validateURL(this.url); } async selectPolicyDriver(customerDetails: ICustomerDetails): Promise { diff --git a/playwright-tests/pages/PolicyInfoSubmittedPage.ts b/playwright-tests/pages/PolicyInfoSubmittedPage.ts index 7d7d7f009..08134ea57 100644 --- a/playwright-tests/pages/PolicyInfoSubmittedPage.ts +++ b/playwright-tests/pages/PolicyInfoSubmittedPage.ts @@ -5,15 +5,11 @@ import { step } from 'framework/localTypes/Step'; export class PolicyInfoSubmittedPage extends InsuranceBasePage { readonly page: Page; readonly policyInfoMessage: Locator; - - url = process.env['BASE_URL']! + '/FixMyGlass/PolicyInfoSubmitted.aspx'; constructor(page: Page) { super(page); this.page = page; this.policyInfoMessage = this.page.getByRole('heading', { name: 'Your policy and vehicle' }); - - // this.validateURL(this.url); } async verifyPolicyInfoSubmitted(): Promise { diff --git a/playwright-tests/pages/PolicyVehiclesPage.ts b/playwright-tests/pages/PolicyVehiclesPage.ts index bd749e056..ddc2b1b6b 100644 --- a/playwright-tests/pages/PolicyVehiclesPage.ts +++ b/playwright-tests/pages/PolicyVehiclesPage.ts @@ -6,12 +6,10 @@ import { step } from 'framework/localTypes/Step'; export class PolicyVehiclesPage extends InsuranceBasePage { readonly page: Page; - url = process.env['BASE_URL']! + '/FixMyGlass/PolicyVehicle.aspx'; constructor(page: Page) { super(page); this.page = page; - // this.validateURL(this.url); } async validateVehicleIsOnPolicy(vehicleDetails: IVehicleDetails) { diff --git a/playwright-tests/pages/RecalibrationInfoPage.ts b/playwright-tests/pages/RecalibrationInfoPage.ts index 493714a66..2671367b6 100644 --- a/playwright-tests/pages/RecalibrationInfoPage.ts +++ b/playwright-tests/pages/RecalibrationInfoPage.ts @@ -3,7 +3,6 @@ import { InsuranceBasePage } from "./InsuranceBasePage"; import { step } from 'framework/localTypes/Step'; export default class RecalibrationInfoPage extends InsuranceBasePage { - url = process.env['BASE_URL']! + '/FixMyGlass/RecalibrationInfo.aspx'; readonly continueButton: Locator; diff --git a/playwright-tests/pages/SchedulePage.ts b/playwright-tests/pages/SchedulePage.ts index 7f960c2c0..0966e9984 100644 --- a/playwright-tests/pages/SchedulePage.ts +++ b/playwright-tests/pages/SchedulePage.ts @@ -10,7 +10,6 @@ import { ITestData } from 'framework/TestData'; export class SchedulePage extends BasePage { readonly page: Page; - url = process.env['BASE_URL']! + '/fmg/?fmgPage=schedule'; readonly firstAvailableDate: Locator; readonly firstAvailableTime: Locator; readonly modalContinueButton: Locator; diff --git a/playwright-tests/pages/ServiceLocationPage.ts b/playwright-tests/pages/ServiceLocationPage.ts index e7af1a4ba..65c30481c 100644 --- a/playwright-tests/pages/ServiceLocationPage.ts +++ b/playwright-tests/pages/ServiceLocationPage.ts @@ -39,8 +39,6 @@ export class ServiceLocationPage extends BasePage { readonly vehicleProtectedNoButton: Locator; readonly repeatedClicksModalCloseButton: Locator; - url = process.env['BASE_URL']! + '/fmg/?fmgPage=service-location'; - constructor(page: Page) { super(page); this.page = page; diff --git a/playwright-tests/pages/ServicePackagesPage.ts b/playwright-tests/pages/ServicePackagesPage.ts index d8888ccba..71f246da5 100644 --- a/playwright-tests/pages/ServicePackagesPage.ts +++ b/playwright-tests/pages/ServicePackagesPage.ts @@ -20,15 +20,12 @@ export class ServicePackagesPage extends BasePage { readonly emailInput: Locator; readonly getMyQuoteButton: Locator; readonly closeButton: Locator; - url = process.env['BASE_URL']! + '/fmg/?fmgPage=quote'; //Enter a promo code modal readonly promoCodeTextbox: Locator; readonly applyPromoButton: Locator; - readonly repeatedClicksModalCloseButton: Locator; - constructor(page: Page) { super(page); this.page = page; @@ -45,8 +42,6 @@ export class ServicePackagesPage extends BasePage { this.promoCodeTextbox = this.page.getByLabel('Enter a promo code'); this.applyPromoButton = this.page.getByRole('button', { name: 'Apply promo code' }); this.repeatedClicksModalCloseButton = this.page.locator('.QSISlider').locator('img[src*=\'close\']'); - - // this.validateURL(this.url); } async selectPaymentMethod(method: PaymentMethod): Promise { diff --git a/playwright-tests/pages/ServiceZipPage.ts b/playwright-tests/pages/ServiceZipPage.ts index dec4a8c44..2aa446eca 100644 --- a/playwright-tests/pages/ServiceZipPage.ts +++ b/playwright-tests/pages/ServiceZipPage.ts @@ -6,8 +6,6 @@ import { ProgressBarPercentages } from 'framework/localTypes/Enums'; export class ServiceZipPage extends LookupPage { - url = process.env['BASE_URL']! + '/fmg/?fmgPage=service-zip'; - constructor(page: Page) { super(page); } diff --git a/playwright-tests/pages/VehicleDamagePage.ts b/playwright-tests/pages/VehicleDamagePage.ts index f1d2e4fac..5de6cb1d4 100644 --- a/playwright-tests/pages/VehicleDamagePage.ts +++ b/playwright-tests/pages/VehicleDamagePage.ts @@ -34,7 +34,6 @@ export class VehicleDamagePage extends BasePage { readonly noReplacementAvailableAlert: Locator; readonly bothReplaceRepairAlert: Locator; readonly splitWindshieldAlert: Locator; - url = process.env['BASE_URL']! + '/fmg/?fmgPage=vehicle-damage'; constructor(page: Page) { super(page); diff --git a/playwright-tests/pages/VehicleLookupAddressPage.ts b/playwright-tests/pages/VehicleLookupAddressPage.ts index c3835131c..c5f37ee3d 100644 --- a/playwright-tests/pages/VehicleLookupAddressPage.ts +++ b/playwright-tests/pages/VehicleLookupAddressPage.ts @@ -10,8 +10,6 @@ import { ProgressBarPercentages } from 'framework/localTypes/Enums'; export class VehicleLookupAddressPage extends LookupPage { readonly addressForm: AddressForm; readonly vehicleSelectionForm: VehicleSelectionForm; - - url = process.env['BASE_URL']! + '/fmg/?fmgPage=service-zip'; constructor(page: Page) { super(page); diff --git a/playwright-tests/pages/VehicleLookupLicensePage.ts b/playwright-tests/pages/VehicleLookupLicensePage.ts index 3ed9e33c5..e20828b6e 100644 --- a/playwright-tests/pages/VehicleLookupLicensePage.ts +++ b/playwright-tests/pages/VehicleLookupLicensePage.ts @@ -8,8 +8,6 @@ import { ProgressBarPercentages } from 'framework/localTypes/Enums'; export class VehicleLookupLicensePage extends LookupPage { readonly licensePlateNumTextBox: Locator; readonly licensePlateStateDrpDwn: Locator; - - url = process.env['BASE_URL']! + '/fmg/?fmgPage=license-plate-lookup'; constructor(page: Page) { super(page); diff --git a/playwright-tests/pages/VehiclePartsPage.ts b/playwright-tests/pages/VehiclePartsPage.ts index ddea1f5f8..63d079f87 100644 --- a/playwright-tests/pages/VehiclePartsPage.ts +++ b/playwright-tests/pages/VehiclePartsPage.ts @@ -5,7 +5,6 @@ import { ITestData } from 'framework/TestData'; import { ProgressBarPercentages } from 'framework/localTypes/Enums'; export default class VehiclePartQuestionsPage extends PartQuestionsPage{ - url = process.env['BASE_URL']! + '/fmg/?fmgPage=vehicle-parts'; constructor(page: Page) { super(page); diff --git a/playwright-tests/pages/VehicleSelectionPage.ts b/playwright-tests/pages/VehicleSelectionPage.ts index d2e16c02f..b83a85351 100644 --- a/playwright-tests/pages/VehicleSelectionPage.ts +++ b/playwright-tests/pages/VehicleSelectionPage.ts @@ -15,8 +15,6 @@ export class VehicleSelectionPage extends BasePage { readonly zipCodeTextBox: Locator; readonly discontinuedServiceAlert: Locator; - url = process.env['BASE_URL']! + '/fmg/?fmgPage=vehicle'; - constructor(page: Page) { super(page); this.page = page; @@ -26,7 +24,6 @@ export class VehicleSelectionPage extends BasePage { this.styleDropdown = this.page.locator('#styleQuestionField'); this.zipCodeTextBox = this.page.getByRole('textbox', { name: 'Zip code' }); this.discontinuedServiceAlert = this.page.locator('.alert-danger.widget-name-AlertNoServiceWidget'); - // this.validateURL(this.url); } async selectVehicle(vehicleDetails: IVehicleDetails) { diff --git a/playwright-tests/pages/VerifyDetailsPage.ts b/playwright-tests/pages/VerifyDetailsPage.ts index cf8cbeba4..6b825e4b6 100644 --- a/playwright-tests/pages/VerifyDetailsPage.ts +++ b/playwright-tests/pages/VerifyDetailsPage.ts @@ -10,15 +10,12 @@ export class VerifyDetailsPage extends InsuranceBasePage { readonly policyZipTextBox: Locator; readonly damageDate: Locator; - url = process.env['BASE_URL']! + '/FixMyGlass/VerifyDetails.aspx'; - constructor(page: Page) { super(page); this.page = page; this.policyNumberTextBox = page.locator('#PolicyNumber'); this.policyZipTextBox = page.locator('#PolicyZip'); this.damageDate = page.locator('#LossDate'); - // this.validateURL(this.url); } async verifyPolicyDetails(customerDetails: ICustomerDetails, claimDetails: IClaimDetails): Promise { diff --git a/playwright-tests/pages/VinLookupPage.ts b/playwright-tests/pages/VinLookupPage.ts index ae3ce3f21..3b69fc2d6 100644 --- a/playwright-tests/pages/VinLookupPage.ts +++ b/playwright-tests/pages/VinLookupPage.ts @@ -10,8 +10,6 @@ export class VinLookupPage extends LookupPage { readonly cameraButton: Locator; readonly whereCanIFindMyVinLink: Locator; - url = process.env['BASE_URL']! + '/fmg/?fmgPage=vin-lookup'; - constructor(page: Page) { super(page); this.vinLookupTextBox = page.getByRole('textbox', { name: 'Enter your VIN' }); diff --git a/playwright-tests/pages/ZipLookupPage.ts b/playwright-tests/pages/ZipLookupPage.ts index 7785fc3c2..33122b852 100644 --- a/playwright-tests/pages/ZipLookupPage.ts +++ b/playwright-tests/pages/ZipLookupPage.ts @@ -2,7 +2,6 @@ import { type Page } from '@playwright/test'; import { LookupPage } from './LookupPage'; export class ZipLookupPage extends LookupPage { - url = process.env['BASE_URL']! + '/fmg/?fmgPage=service-zip'; constructor(page: Page) { super(page); diff --git a/playwright-tests/tests/0000__M.test.ts b/playwright-tests/tests/0000__M.test.ts index 39c02ffb7..86cc54c81 100644 --- a/playwright-tests/tests/0000__M.test.ts +++ b/playwright-tests/tests/0000__M.test.ts @@ -200,7 +200,7 @@ async function runWorkflow(page: Page, testCase: TestCase) { } else { // If enterFunnelWithZip is true, add zip code to url if (!!isEnterFunnelWithZip!) { - const currentUrl = page.url(); + const currentUrl = process.env['BASE_URL']!; const zipParam = `&zipCode=${customerDetails?.address.postalCode!}`; if (!currentUrl.includes('zipCode=')) { await page.goto(currentUrl + zipParam);