Files
n8n-enterprise-unlocked/packages/testing/playwright/pages/BasePage.ts
2025-07-01 14:15:31 +01:00

22 lines
551 B
TypeScript

import type { Page } from '@playwright/test';
export abstract class BasePage {
constructor(protected readonly page: Page) {}
protected async clickByTestId(testId: string) {
await this.page.getByTestId(testId).click();
}
protected async fillByTestId(testId: string, value: string) {
await this.page.getByTestId(testId).fill(value);
}
protected async clickByText(text: string) {
await this.page.getByText(text).click();
}
protected async clickButtonByName(name: string) {
await this.page.getByRole('button', { name }).click();
}
}