Member Junction
    Preparing search index...

    Browser-execution options for ComponentRunner. Extends LinterOptions (which carries componentSpec, contextUser, entityMetadata, utilities — the fields the static linter reads) with Playwright-specific runtime fields (timeouts, page-ready hooks, screenshot mode). The browser harness happens to run the linter as a prelude, so accepting a superset keeps the call sites tidy without leaking browser concerns into the linter package.

    interface ComponentExecutionOptions {
        asyncErrorWaitTime?: number;
        componentResolver?: (
            name: string,
            namespace?: string,
            registry?: string,
        ) => ComponentSpec | undefined;
        componentSpec: ComponentSpec;
        contextUser: UserInfo;
        debug?: boolean;
        entityMetadata?: SimpleEntityInfo[];
        fullPageScreenshot?: boolean;
        isRootComponent?: boolean;
        onPageReady?: (
            page: any,
            result: ComponentExecutionResult,
        ) => Promise<void>;
        props?: Record<string, any>;
        renderWaitTime?: number;
        savedUserSettings?: Record<string, unknown>;
        setupCode?: string;
        timeout?: number;
        utilities?: ComponentUtilities;
        waitForLoadState?: "load" | "domcontentloaded" | "networkidle";
        waitForSelector?: string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    asyncErrorWaitTime?: number
    componentResolver?: (
        name: string,
        namespace?: string,
        registry?: string,
    ) => ComponentSpec | undefined

    Optional resolver for dependency components referenced by name (+ optional namespace + registry). Lint rules call this when a dep is location: 'registry' and the parent spec didn't denormalize the dep's props/events inline — most commonly to verify props passed to a child component match the child's declared property contract.

    The linter never does I/O itself; it asks this resolver. Callers wire it however suits their side of the wire:

    • server-side: close over ComponentMetadataEngineServer.Instance.FindComponent(...)?.spec
    • client-side: close over a pre-loaded array or a GQL cache

    If absent, rules that rely on registry lookup degrade gracefully (they simply skip the cross-component check).

    componentSpec: ComponentSpec

    Component spec being analyzed (linter walks code, dataRequirements, etc.).

    contextUser: UserInfo

    Auth/context — required by rules that resolve entity metadata.

    debug?: boolean
    entityMetadata?: SimpleEntityInfo[]

    Optional array of entity metadata providing complete field lists per entity. Used by the linter to validate field usage with two-tier severity:

    • Medium: Field exists in entity but not declared in dataRequirements
    • Critical: Field does not exist in entity at all

    If not provided, linter only checks against dataRequirements.fieldMetadata which may cause false-positive critical errors for valid but undeclared fields.

    fullPageScreenshot?: boolean

    When true, the final screenshot captures the entire scrollable page content (Playwright's fullPage: true) instead of only the viewport. Use this when testing tall components (dashboards, long forms) where viewport-only screenshots can cut off content below the fold.

    Defaults to false to preserve existing behavior for other harness users.

    isRootComponent?: boolean
    onPageReady?: (page: any, result: ComponentExecutionResult) => Promise<void>

    Optional callback invoked with the live Playwright page after the component has rendered successfully. The page remains open until this callback resolves, allowing the caller to perform interactions (clicks, form fills, etc.) and inspect the post-interaction state.

    The callback receives the Playwright Page object and the execution result captured so far. Any errors thrown inside the callback are caught and added to the result's error array — they do not prevent the result from being returned.

    const result = await harness.testComponent({
    ...options,
    onPageReady: async (page, result) => {
    const buttons = await page.locator('button').all();
    for (const btn of buttons) {
    await btn.click();
    await page.waitForTimeout(500);
    }
    }
    });
    props?: Record<string, any>
    renderWaitTime?: number
    savedUserSettings?: Record<string, unknown>

    Initial per-user settings to seed the component's savedUserSettings prop with. Mirrors what the production host loads from UserInfoEngine. The component's onSaveUserSettings callback merges each payload into this snapshot in place (null/undefined values remove the key — same semantics as the production host) so tests can inspect persisted preferences after interactions. Defaults to {}.

    setupCode?: string
    timeout?: number
    utilities?: ComponentUtilities

    Runtime utility hub forwarded to rules that need live metadata access (e.g. utilities.md.Entities). Optional — rules guard against absence.

    waitForLoadState?: "load" | "domcontentloaded" | "networkidle"
    waitForSelector?: string