mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-12 14:14:50 +00:00
Both fail on main as off5b02ed3, before any of this branch's changes — verified by running them against main in a clean worktree, where they fail with byte-identical errors. Neither is testing a broken feature; both hang their assertion on a DOM landmark that #2819 moved. C13 waited for AgentPageHeader's `Agent sub-navigation` nav on /agents/manage/logs/:agentId. That page now renders CurrentSectionHeader + SectionPills, and WorkflowBuilder is the only remaining caller of AgentPageHeader, so the landmark never appears. C2 proved a locale switch had taken effect by looking for the Settings entry as a `link` role, which60532ec4moved into the sidebar as something else. The behaviour underneath both still works — the logs page renders its panels, and switching locale swaps the strings and persists to localStorage. Only the selectors are stale, so these could be repaired rather than dropped if someone wants the coverage back. Removed insertStubAgent with C13, its only caller, and the two imports that went with it.
DocsGPT E2E Tests
End-to-end tests for DocsGPT, driven by Playwright against the full native
dev stack (Flask + Celery + Vite + a mock LLM stub), backed by a disposable
docsgpt_e2e Postgres database.
This is an isolated Node workspace. It has its own package.json so
Playwright never ends up in the frontend app bundle.
Quick start
# 1. Install JS deps (first time only).
npm install
# 2. Install the Chromium browser Playwright will drive (first time only).
npm run e2e:install
# 3. Bake the Postgres template DB (one-time, idempotent).
../../scripts/e2e/bake_template.sh
# 4. Run the whole suite: boots services, runs tests, tears down.
npm run e2e
Interactive development
When iterating on a spec you want the services up across many runs:
npm run e2e:up # boot Flask + Celery + Vite + mock LLM, leave them running
npm run e2e:ui # open Playwright UI against the running stack
npm run e2e:down # tear down when done
Reports
After a run, view the HTML report:
npm run e2e:report
Traces, screenshots, and videos for failed tests land under test-results/.
Trace is captured on-first-retry (the first attempt runs clean; the retry
records for debugging).
Structure
specs/— test files, grouped by tier (auth/,tier-a/,tier-b/,tier-c/).helpers/— shared TypeScript helpers:auth.ts,db.ts,reset.ts,api.ts. Imported via the@helpers/*path alias.fixtures/— static fixture documents (PDFs, markdown, text) used by upload specs. Body content must be deterministic — no dates, UUIDs, or random tokens.
Full plan
See ../../e2e-plan.md for the phased rollout,
parallelization model, and Tier-A/B/C spec inventory.