Hello guys,
Is it recommended or mandatory to not set a default export on POM classes?
I've never seen any example with a default export
import type { Page, Locator } from '@playwright/test';
export default class CookieBanner {
readonly banner: Locator;
readonly acceptButton: Locator;
readonly rejectButton: Locator;
readonly closeButton: Locator;
constructor(public readonly page: Page) {
this.page = page;
this.banner = page.locator('#banner');
this.acceptButton = page.locator('#accept');
this.rejectButton = page.locator('#decline');
this.closeButton = page.locator('#close');
}
async accept() {
await this.acceptButton.click();
}
async reject() {
await this.rejectButton.click();
}
async close() {
await this.closeButton.click();
}
}
This thread is trying to answer question "Is it recommended or mandatory to not set a default export on POM classes in Playwright tests?"
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].