Module: testRunner

Thin orchestrator for Playwright test execution with parallel worker support.

Owns the browser lifecycle, per-test loop (sequential or parallel), trace management, and final status transition. Delegates heavy sub-tasks to focused modules:

Module Responsibility
runner/config.js Env constants, artifact dir setup
runner/codeParsing.js extractTestBody (hasCode check)
runner/executeTest.js Single-test execution
runner/feedbackIntegration.js Post-run AI feedback loop

Parallel execution

When parallelWorkers > 1, tests run in concurrent browser contexts within a single Chromium instance. Each worker picks the next queued test, executes it in its own isolated BrowserContext, and reports back. The shared browser process keeps memory usage lower than launching N separate browsers.

Concurrency is controlled by:

  1. PARALLEL_WORKERS env var (default for all runs)
  2. Per-run override via options.parallelWorkers (from Test Dials / API)

Exports

  • runTests — Execute an array of approved tests against a project.
Source:

Methods

(static) runTests(project, tests, run, optionsopt) → {Promise.<void>}

Execute an array of approved tests against a project using Playwright. Launches Chromium, runs each test with self-healing (optionally in parallel), collects results, saves traces/videos, runs the AI feedback loop, and finalises the run.

Parameters:
Name Type Attributes Description
project Object

The project { id, name, url }.

tests Array.<Object>

Array of test objects to execute.

run Object

The run record (mutated in place).

options Object <optional>
Properties
Name Type Attributes Description
parallelWorkers number <optional>

Concurrent browser contexts (1–10). Overrides env default.

browser string <optional>

"chromium" | "firefox" | "webkit" (DIF-002). Defaults to chromium.

device string <optional>

Playwright device preset name (DIF-003).

locale string <optional>

BCP 47 locale (AUTO-007).

timezoneId string <optional>

IANA timezone (AUTO-007).

geolocation Object <optional>

{ latitude, longitude } (AUTO-007).

signal AbortSignal <optional>

Abort signal for cancellation.

Source:
Returns:
Type
Promise.<void>