DigitalConsumer.FixMyGlass/playwright-tests/pages/DuplicateCheckPage.ts
maguire-arman 458e552d6b 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.
2025-07-14 16:13:56 -04:00

26 lines
No EOL
851 B
TypeScript

import { expect, type Locator, type Page } from '@playwright/test';
import { InsuranceBasePage } from './InsuranceBasePage';
import { ITestData } from 'framework/TestData';
import { step } from 'framework/localTypes/Step';
export class DuplicateCheckPage extends InsuranceBasePage {
readonly page: Page;
readonly newClaimButton: Locator;
constructor(page: Page) {
super(page);
this.page = page;
this.newClaimButton = page.locator('a').filter({ hasText: 'Start a new claim Start a new' });
}
async startNewClaim(){
await this.newClaimButton.click();
await this.page.waitForLoadState();
}
@step("DuplicateCheckPage >> Start a new claim: ")
async handleDuplicateCheckPage(testCase: Partial<ITestData>) {
await this.startNewClaim();
await this.nextPage();
}
}