Member Junction
    Preparing search index...

    Test driver for Computer Use browser automation tests.

    Orchestrates:

    1. Parsing test configuration → MJRunComputerUseParams
    2. Executing MJComputerUseEngine.Run() with timeout
    3. Running oracles (built-in + global registry)
    4. Calculating score and status
    5. Returning DriverExecutionResult

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _provider: IMetadataProvider | null

    Metadata provider used by the driver for entity access. Set explicitly via the Provider setter; falls back to the global Metadata.Provider when not set. The engine (or test harness) should set this to thread a transaction-scoped provider.

    Accessors

    • get _metadata(): Metadata

      Returns Metadata

      Use _provider (IMetadataProvider) instead. Retained for backward compatibility with subclasses that referenced the previous _metadata: Metadata field directly. Returns the same underlying provider cast to the legacy Metadata shape.

    • get Provider(): IMetadataProvider

      The metadata provider this driver uses. Falls back to the global Metadata.Provider when the engine hasn't injected an explicit provider — multi-tenant servers should always set this so each driver run binds to the right database connection.

      Returns IMetadataProvider

    • set Provider(value: IMetadataProvider | null): void

      Parameters

      Returns void

    Methods

    • Protected

      Calculate overall score from oracle results.

      If weights are provided, calculates weighted average. Otherwise, calculates simple average.

      Parameters

      • oracleResults: OracleResult[]

        Results from oracle evaluations

      • Optionalweights: ScoringWeights

        Optional scoring weights by oracle type

      Returns number

      Overall score from 0.0 to 1.0

    • Protected

      Create a log message for the test execution log.

      Parameters

      • level: "info" | "warn" | "error" | "debug"

        Log level

      • message: string

        Log message

      • Optionalmetadata: Record<string, unknown>

        Optional metadata

      Returns TestLogMessage

      TestLogMessage object

    • Protected

      Determine overall test status from oracle results.

      Test passes only if ALL oracles pass.

      Parameters

      • oracleResults: OracleResult[]

        Results from oracle evaluations

      Returns "Failed" | "Passed"

      'Passed' if all oracles passed, 'Failed' otherwise

    • Protected

      Get the effective timeout for a test.

      Priority (highest to lowest):

      1. Configuration JSON maxExecutionTime field (backward compatibility)
      2. Test.MaxExecutionTimeMS column
      3. DEFAULT_TEST_TIMEOUT_MS constant (5 minutes)

      Parameters

      • test: MJTestEntity

        The test entity

      • Optionalconfig: { maxExecutionTime?: number }

        Parsed configuration object (optional)

      Returns number

      Timeout in milliseconds

    • Protected

      Log execution progress.

      Parameters

      • message: string

        Log message

      • OptionalverboseOnly: boolean

        Whether to only log in verbose mode (default: false)

      Returns void

    • Protected

      Log errors.

      Parameters

      • message: string

        Error message

      • Optionalerror: Error

        Optional error object

      Returns void

    • Protected

      Log a message to both the console (if verbose) and accumulate for test run log.

      Parameters

      • context: DriverExecutionContext

        Driver execution context

      • level: "info" | "warn" | "error" | "debug"

        Log level

      • message: string

        Log message

      • Optionalmetadata: Record<string, unknown>

        Optional metadata

      Returns void

    • Protected

      Parse and validate Configuration JSON.

      Helper method for drivers to parse their configuration with type safety. Throws if configuration is invalid.

      Type Parameters

      • T

        The configuration type

      Parameters

      Returns T

      Parsed configuration

      Error if configuration is missing or invalid

    • Protected

      Parse and validate ExpectedOutcomes JSON.

      Type Parameters

      • T

        The expected outcomes type

      Parameters

      • test: MJTestEntity

        The test containing the expected outcomes

      Returns T

      Parsed expected outcomes

      Error if expected outcomes is missing or invalid

    • Protected

      Parse and validate InputDefinition JSON.

      Type Parameters

      • T

        The input definition type

      Parameters

      Returns T

      Parsed input definition

      Error if input definition is missing or invalid

    • Suite-scoped setup. Runs ONCE after the suite run is created and before the first test's Execute, when the test runs inside a suite (mj test suite). Provision suite-shared fixtures here — discover/create users, create Query/Category rows, refresh engine caches — and stash them on context.Data / context.CreatedRecords so every Execute of the suite (which receives this same context via DriverExecutionContext.fixtures) can read them, and TeardownSuite can clean them up.

      Default is a no-op, so existing drivers (AgentEval, Computer Use) are unaffected. Does NOT fire for the standalone mj test run path (no suite).

      Parameters

      Returns Promise<void>

    • Suite-scoped teardown. GUARANTEED by TestEngine.RunSuite via a finally, so it runs on pass, fail, a thrown Execute, and after a 'Timeout' result. MUST be best-effort: never throw (the engine logs and ignores any throw), only clean up. Delete what SetupSuite created (the context.CreatedRecords list and any driver-specific payload under context.Data).

      Default is a no-op. Does NOT fire for the standalone mj test run path.

      Parameters

      Returns Promise<void>