banira
    Preparing search index...

    Interface BrowserMountContext

    Handle returned by TestHelper.mountInBrowser: the Playwright page and browser, plus a close() to tear them down. Typed loosely because Playwright is an optional peer dependency.

    interface BrowserMountContext {
        browser: { close: () => Promise<void>; [key: string]: unknown };
        checkAccessibility: (options?: A11yOptions) => Promise<A11yResult>;
        close: () => Promise<void>;
        matchScreenshot: (
            name: string,
            options?: MatchScreenshotOptions,
        ) => Promise<ScreenshotResult>;
        page: {
            waitForFunction: (fn: string, arg?: unknown) => Promise<unknown>;
            [key: string]: unknown;
        };
        screenshot: (
            options?: ScreenshotOptions,
        ) => Promise<Buffer<ArrayBufferLike>>;
    }
    Index

    Properties

    browser: { close: () => Promise<void>; [key: string]: unknown }
    checkAccessibility: (options?: A11yOptions) => Promise<A11yResult>

    Runs axe-core against the mounted component and returns its violations (#14). axe-core is an optional dependency (npm i -D axe-core). It can only traverse open shadow roots, so components under a11y test must use attachShadow({ mode: 'open' }).

    close: () => Promise<void>
    matchScreenshot: (
        name: string,
        options?: MatchScreenshotOptions,
    ) => Promise<ScreenshotResult>

    Visual-snapshot assertion (#15): compares a screenshot of the mounted element against an on-disk baseline, creating the baseline on first run. For perceptual/tolerant diffing, use Playwright's own toHaveScreenshot on the exposed BrowserMountContext.page.

    page: {
        waitForFunction: (fn: string, arg?: unknown) => Promise<unknown>;
        [key: string]: unknown;
    }
    screenshot: (options?: ScreenshotOptions) => Promise<Buffer<ArrayBufferLike>>

    Captures a PNG screenshot of the mounted element (or the full page) and returns the buffer (#15).