From caf186d728cec0667809c4bd6e4ae7df1d3d562d Mon Sep 17 00:00:00 2001 From: JennyNou Date: Tue, 24 Mar 2026 11:17:48 -0400 Subject: [PATCH] Add service location page back in --- playwright-tests/pages/ServiceLocationPage.ts | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 playwright-tests/pages/ServiceLocationPage.ts diff --git a/playwright-tests/pages/ServiceLocationPage.ts b/playwright-tests/pages/ServiceLocationPage.ts new file mode 100644 index 00000000..12f9de32 --- /dev/null +++ b/playwright-tests/pages/ServiceLocationPage.ts @@ -0,0 +1,42 @@ +import { expect, type Locator, type Page } from '@playwright/test'; +import { BasePage } from './BasePage'; +import { IAppointmentDetails } from '@business-logic/types/CustomerDetails'; +import { ServiceLocation } from '@business-logic/types/Enums'; +import { AddressForm } from './forms/AddressForm'; +import { faker } from '@faker-js/faker'; + +export class ServiceLocationPage extends BasePage { + readonly page: Page; + + readonly addressForm: AddressForm; + + // Initial selection + readonly inShopButton: Locator; + readonly mobileButton: Locator; + readonly dropOffButton: Locator; + readonly RecalWarningMessage1: Locator; + readonly RecalWarningMessage2: Locator; + readonly militaryWarningMessage: Locator; + + constructor(page: Page) { + super(page); + this.page = page; + + this.addressForm = new AddressForm(page); + + // Initial selection + this.inShopButton = this.page.locator('[buttonlabel="In-shop"]'); + this.mobileButton = this.page.locator('[buttonlabel="Mobile"]') + this.dropOffButton = this.page.locator('[buttonlabel="Drop-off"]'); + this.RecalWarningMessage1 = this.page.getByText(/We're not able to provide mobile service/); + this.RecalWarningMessage2 = this.page.getByText(/advanced safety system recalibration needs to be done in our shop./); + this.militaryWarningMessage = this.page.locator('[class*="widget-name-AlertMilitaryBaseZipWidget"]'); + + } + + async validateRecalWarning(){ + await expect(this.RecalWarningMessage1).toBeVisible(); + await expect(this.RecalWarningMessage2).toBeVisible(); + + } +} \ No newline at end of file