Skip to content

Test-AI — Watch a test live

In Live mode, the test's browser runs on a virtual display that the student watches live in the Live tab: every click, every keystroke, with the current action shown on top. The student can mark a moment during the test; the markers come back afterwards on the video timeline. The view is read-only: nobody drives the test's browser.

What this page describes

Test-AI 0.24.0, as the shipped code behaves (test-ai/src/routes/live.js, test-ai/src/lib/liveWsProxy.js, test-ai/public/js/runner-live.js, runner-marks.js, the perfshop-playwright:live image). Sister pages: AI-driven tests (headless mode, the default), Deliverables, Configure the language model.

Run a test live

  1. Open ⚙ Execution settings (header) and pick Execution mode: Live (with viewer). The choice is remembered on this device.
  2. Ask the agent for a test, then Confirm its proposal — or Run a test under an answer (see AI-driven tests).
  3. The Live tab appears in the conversation's Run sub-tab. As soon as the test's browser is ready, the interface switches to it by itself; you can also open it beforehand.

Agentic mode always stays headless: it restarts the browser many times, while the live view shows a single test. When it is ticked, the Live choice is unavailable.

Each live test takes one virtual display. The platform ships 5 of them, as many as the cap on simultaneous tests (5, live or not). Without a free display, the start is refused: "No virtual display available — too many simultaneous live runs."; a display is freed when a test ends.

What the Live tab shows

  • The browser view: the test's virtual display, live, labelled "View only — control disabled." Keyboard and mouse have no effect: read-only is enforced by the display server itself, not only by the page.
  • The action banner, top right: the Playwright step in progress ("→ action"), or "Waiting for Playwright action…" between two steps; an animated green dot signals activity (still when the system asks for reduced motion). The screen reader announces it politely.
  • Mark this moment: see below.

When the test ends: "Run finished — live viewer stopped (see the Video tab)."

Mark a moment

While the live view runs, the student can drop a marker:

  1. type, if they wish, a comment (500 characters at most) — "the cart empties", "button disabled";
  2. click Mark this moment. The confirmation shows: "Marker added — it will show on the timeline of the Video tab."

The field and the button are active only during the live view: off before the browser is ready, and after the test ends.

After the test: video, markers, report

The test's Video tab gathers:

  • the video of the whole test;
  • the marker timeline, under the video: one tick per marker, placed at its moment since the start of the test. A click — or Enter and Space on the keyboard — jumps the video to that moment; Tab walks the markers in time order; each tick reads its time and its comment. Without markers: "No marker recorded during this run.";
  • the failure screenshots, when the test failed: one thumbnail per screenshot, to open full size;
  • the report: Download report (Markdown) or (PDF).

The report exists for every test, live or not. It gives the date, the duration, the iterations, the mode, the request, the status (Succeeded, Failed, Error — no verdict —, Cancelled), the generated script, the last 50 log lines, the artifacts and the anomaly created. Its headings are in the platform's language; the PDF keeps accents, and a character outside the Windows-1252 set (an emoji, for instance) becomes "?" in it.

Installation

The installation (./build.sh) builds the perfshop-playwright:live image from the official Playwright image (Chromium), with a virtual display server (Xvfb), a read-only VNC server (x11vnc), a WebSocket bridge (websockify, noVNC) and ffmpeg for recording. Nothing else to do: the perfshop-playwright container starts with the platform, and Test-AI drives it through the Docker relay.

.env settings:

Key Default Effect
TEST_AI_DISPLAY_COUNT 5 Number of virtual displays. Raise it with PLAYWRIGHT_MAX_CONCURRENT (simultaneous tests, live or not), then rebuild the image.
PLAYWRIGHT_MAX_CONCURRENT 5 Cap on simultaneous tests.
TEST_AI_LIVE_RESOLUTION 1280x800 Size of the virtual display and of the video capture; another size requires rebuilding the image.
TEST_AI_RECORDING_QUALITY 30 Video quality (VP9, from 0 = best to 63 = lightest), 15 frames per second.

Measured on 2026-10-22, development stack (Docker Desktop): at rest, perfshop-playwright uses 255 MiB with 5 displays, 437 MiB with 8.

Observability. GET /api/metrics exposes, in the Prometheus format, the displays (test_ai_pool_total, test_ai_pool_allocated) and the active tests (test_ai_runs_active). Prometheus already scrapes them (job perfshop-test-ai), and Grafana ships the "PerfShop — Test AI" dashboard in the "Élèves" folder.

Security

  • Read-only enforced by the server: x11vnc runs with -viewonly (keyboard and mouse ignored, whatever the client) and listens on the container's loopback only (-localhost). The ports of these displays are not published on the host machine.
  • From the browser, a single door to a display: Test-AI's WebSocket passage (GET /api/runs/:id/live-ws), which checks the session before opening the tunnel, and exists only while the display is assigned to the test.
  • No owner check: the interface shows each person only the tests of their own conversations, but a valid Test-AI session that knows the identifier of a live test can open its display.
  • websockify also answers the other containers of the stack network, read-only; it is listed in the hardening inventory.

Troubleshooting

Symptom Cause and remedy
"No virtual display available…" at start 5 live tests are already running: wait for one to end, or raise TEST_AI_DISPLAY_COUNT and PLAYWRIGHT_MAX_CONCURRENT (image rebuilt).
The Live tab stays on "Connecting to viewer…" The test's browser is starting; if it never comes, look at the Logs tab (a model or container error ends the test).
The Live choice is greyed out Agentic mode is ticked: it always runs headless.
"Mark this moment" is greyed out The live view is not (or no longer) active.
A "?" in the PDF report A character outside the Windows-1252 set; the Markdown report keeps everything.

For integrators

Route Role
GET /api/runs/:id/live-ws (WebSocket) View of the test's display (101, or 400, 401, 404, 502).
POST /api/runs/:id/mark {comment} Drops a marker (201); comment of 500 characters at most, cleaned.
GET /api/runs/:id/marks The markers, with the test's origin (run.started_at_iso).
GET /api/runs/:id/report?format=md\|pdf The report (Markdown by default).
GET /api/runs/pool/health State of the displays: total, allocated, free.
GET /api/metrics Prometheus metrics (no session).

Every route except /api/metrics needs a Test-AI session.