WIP; WIP 2 web: Flesh out fixtures, test IDs. web: Flesh out provider tests. web: Flesh out LDAP test. web: Fix typo. web: Allow base URL to be updated. web: Clean up. web: Tidy types. web: Update ARIA attributes for better test targeting. web: Clean up message labeling. web: Clean up ARIA labels. web: Flesh out table ARIA labels. web: Flesh out series. web: Fix linter. web: Clean up test reporting, timing issues. Add RADIUS test.
30 lines
735 B
TypeScript
30 lines
735 B
TypeScript
import { ConsoleLogger, FixtureLogger } from "#logger/node";
|
|
import { Page } from "@playwright/test";
|
|
|
|
export interface PageFixtureOptions {
|
|
page: Page;
|
|
testName: string;
|
|
}
|
|
|
|
export abstract class PageFixture {
|
|
/**
|
|
* The name of the fixture.
|
|
*
|
|
* Used for logging.
|
|
*/
|
|
static fixtureName: string;
|
|
|
|
protected readonly logger: FixtureLogger;
|
|
protected readonly page: Page;
|
|
protected readonly testName: string;
|
|
|
|
constructor({ page, testName }: PageFixtureOptions) {
|
|
this.page = page;
|
|
this.testName = testName;
|
|
|
|
const Constructor = this.constructor as typeof PageFixture;
|
|
|
|
this.logger = ConsoleLogger.fixture(Constructor.fixtureName, this.testName);
|
|
}
|
|
}
|