Imported from robstokes857/vibe-rails (
UITests/AGENTS.md). Install upstream withnpx skills add robstokes857/vibe-rails --skill UITests. Copyright stays with the author.
UI Testing Suite
This directory contains the Playwright end-to-end testing suite for the VibeRails frontend, plus a small set of Node-native unit tests.
Prerequisites
- Node.js installed on your system.
Setup
Before running tests for the first time, install the dependencies:
# Install npm packages
npm install
# Install browser binaries (with OS deps)
npx playwright install --with-deps chromium
Running Tests
All Tests
Run both the Node-native and Playwright suites (matches npm test):
npm test
Node-Native Unit Tests Only
Pure-Node tests (no browser) run via the built-in test runner:
npm run test:node
This runs tests/xterm-scrollback.spec.js plus every pure frontend module regression under
../Tests/wwwroot/js/*.test.mjs using node --test.
Playwright E2E Only
Run all E2E tests in headless mode (console output):
npm run test:e2e
# or
npx playwright test
UI Mode (Recommended for Debugging)
Open the interactive Playwright UI to see tests running step-by-step:
npx playwright test --ui
Focused Quality UX Tests (No Backend Required)
npx playwright test --config playwright.quality.config.js
This starts a temporary local static server and runs code-quality-ux.spec.js against the real
frontend, combined code report viewer and shared agent picker, with mocked API responses and launch dispatch.
It needs no database or installed LLM CLI and does not change the standard suite's configuration.
The tests cover compact actions, file-to-map selection, visible domain links and large overviews,
saved metrics, radar keyboard access, themes/reduced motion, independent scrolling, narrow layouts,
failure/empty states, request cancellation and cleanup, exclusion/restore flow, and agent choice.
Focused Board UX Tests (No Backend Required)
npx playwright test --config playwright.board.config.js
Uses the real frontend with mocked board APIs to verify the Settings-style heading, description image rendering/editing/upload, save/reopen, running-agent controls, and desktop/narrow layouts. It starts a temporary static server and never touches the machine's board database.
Focused Automation terminal menu tests (No Backend Required)
npx playwright test --config playwright.terminal-automations.config.js
Uses real terminal UI/xterm with intercepted API and WebSocket fixtures. Covers a long robot menu, lazy live attachment, finished-run replay, launch events/remount, independent close/undo, and narrow-window keyboard access. Does not launch a CLI or touch application state.
View Report
If a test fails, you can view the detailed HTML report:
npx playwright show-report
Configuration
- Backend:
global-setup.jsspawns the real VibeRails backend (dotnet run --project ../VibeRails -c Debug -- --vs-code-v1), consumes the one-time bootstrap URL to persist the auth cookie viastorageState(the tab token lives insessionStorage, whichstorageStatedoes not persist, so it is captured separately forfixtures.jsto re-inject), and writes the dynamicbaseURLto.playwright-runtime.json.global-teardown.jskills the backend by PID. - Fake CLI:
VIBERAILS_TEST_FAKE_CLI=1(set by global-setup) makesCommandService.PrepareSessionAsyncshort-circuit to a portable echo+sleep so PTY+WS+xterm are exercised without a real LLM CLI. - Custom backend: Set
VIBERAILS_E2E_BACKEND_DLLto point the suite at an already-built isolated DLL instead ofdotnet run. - Workers: 1 (one backend instance per run, shared via saved
storageState). - Tests: Playwright specs live in
./tests;xterm-scrollback.spec.jsis excluded from Playwright and runs vianpm run test:nodewithnode --test+@xterm/headless. That command also runs every../Tests/wwwroot/js/*.test.mjsfrontend module regression from the repository root.
Adding New Tests
When adding features to app.js or index.html, add a corresponding spec file in ./tests/*.spec.js to ensure the UI interactions remain functional.
Last checked: 2026-08-06T17:22:10Z by opencode (glm-5.2)
