17 lines
438 B
TypeScript
17 lines
438 B
TypeScript
import type { Page } from '@playwright/test';
|
|
|
|
/**
|
|
* Shared base for all page objects. Subclasses extend this and expose
|
|
* domain-specific locators + actions — never raw selectors leaking into tests.
|
|
*/
|
|
export abstract class BasePage {
|
|
protected constructor(protected readonly page: Page) {}
|
|
|
|
/**
|
|
* Navigate to a path relative to baseURL.
|
|
*/
|
|
async goto(path = '/') {
|
|
await this.page.goto(path);
|
|
}
|
|
}
|