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.
21 lines
No EOL
544 B
TypeScript
21 lines
No EOL
544 B
TypeScript
import { Page, Locator } from '@playwright/test';
|
|
import { BasePage } from './BasePage';
|
|
|
|
export abstract class BaseHomePage extends BasePage {
|
|
readonly page: Page;
|
|
readonly url: string;
|
|
|
|
constructor(page: Page) {
|
|
super(page);
|
|
this.page = page;
|
|
}
|
|
|
|
abstract letsGetStarted(zip?: string): Promise<void>;
|
|
|
|
// Method to check if this is the correct homepage variant
|
|
abstract isCurrentVariant(): Promise<boolean>;
|
|
|
|
async goto() {
|
|
await this.page.goto(process.env['BASE_URL']!);
|
|
}
|
|
} |