- index.ts: CLI entry point (--full, --spec, --watch, --agent flags) - runner.ts: programmatic WDIO launcher with result streaming - dashboard.ts: ANSI terminal UI (pass/fail/skip/running icons, summary) - agent-bridge.ts: NDJSON stdin/stdout for Agent SDK queries (status, rerun, failures, reset-cache) - Standalone package at tests/e2e/daemon/
3.2 KiB
E2E Test Daemon
Terminal dashboard for running and monitoring Agent Orchestrator E2E tests. Supports smart caching, file watching, and agent SDK integration.
Prerequisites
- Built Tauri debug binary (
npm run tauri build -- --debug --no-bundle) tauri-driverinstalled (cargo install tauri-driver)- Node.js 20+
Install
cd tests/e2e/daemon
npm install
The daemon reuses WDIO deps from the root node_modules. Its own package.json lists @wdio/cli and @wdio/local-runner for clarity, but they resolve from the workspace root.
Usage
# Run all specs (with smart cache — skips recently-passed specs)
npm start
# Full run — reset cache, run everything
npm run start:full
# Filter by spec name pattern
npx tsx index.ts --spec phase-a
# Watch mode — re-run on spec file changes
npm run start:watch
# Agent mode — accept NDJSON queries on stdin, respond on stderr
npm run start:agent
# Combine flags
npx tsx index.ts --full --watch --agent
Dashboard
The terminal UI shows:
Agent Orchestrator — E2E Test Daemon RUNNING 12.3s
────────────────────────────────────────────
✓ smoke 1.2s
✓ workspace 0.8s
⟳ settings
· phase-a-structure
· phase-a-agent
⏭ phase-b-grid
────────────────────────────────────────────
2 passed │ 0 failed │ 1 skipped │ 1 running │ 2 pending │ 2.0s
Status icons:
✓green — passed✗red — failed (error message shown below)⏭gray — skipped (cached)⟳yellow — running·white — pending
Smart Cache
The daemon reads from the shared test-results/results.json (managed by results-db.ts). Specs that passed in any of the last 5 runs are skipped unless --full is used.
Agent Bridge Protocol
When started with --agent, the daemon accepts NDJSON queries on stdin and responds on stderr (stdout is used by the dashboard).
Queries
Status — get current test state:
{"type": "status"}
Response:
{"type": "status", "running": false, "passed": 15, "failed": 2, "skipped": 1, "pending": 0, "total": 18, "failures": [{"name": "phase-b-grid", "error": "WDIO exited with code 1"}]}
Rerun — trigger a new test run:
{"type": "rerun", "pattern": "phase-a"}
Response:
{"type": "rerun", "specsQueued": 1}
Failures — get detailed failure list:
{"type": "failures"}
Response:
{"type": "failures", "failures": [{"name": "phase-b-grid", "specFile": "phase-b-grid.test.ts", "error": "WDIO exited with code 1"}]}
Reset cache — clear smart cache:
{"type": "reset-cache"}
Response:
{"type": "reset-cache", "ok": true}
Architecture
index.ts CLI entry point, arg parsing, main loop
runner.ts WDIO Launcher wrapper, spec discovery, smart cache
dashboard.ts ANSI terminal UI (no external deps)
agent-bridge.ts NDJSON stdio interface for agent integration
The daemon reuses the project's existing wdio.conf.js and infra/results-db.ts.