← Back to Pull requests

Added Playwright e2e tests and an e2e CI job #10

Open
unknown opened this pull request with 516 lines diff across 6 files
View on GitHub
unknown unknown commented on Oct 31, 2026 13:56 UTC
Author

Summary


  • First end-to-end tests: they cover the whole path browser -> gRPC-Web -> API -> SQLite, including the WatchBoard server stream, which no unit or integration test reached so far.

  • Three user flows: create a board, create a task and drag it to Done (persisted across a reload), and live updates between two independent browser contexts.

  • The e2e run is isolated from the dev setup (own ports and a fresh database), so it can run while the dev servers are up and never touches taskboard.db.

  • New CI job e2e with the Playwright HTML report as an artifact.
  • Changes


    API
  • Program.cs: opt-in Database:MigrateOnStartup (off by default) that applies the EF Core migrations at startup. Only the e2e run turns it on, because it starts from an empty SQLite file. Dev/prod keep using dotnet ef database update; the xUnit tests keep EnsureCreated.
  • Client

  • environment.e2e.ts (API on :5180) and the e2e build/serve configuration in angular.json.

  • @playwright/test 1.64.1, npm run e2e.
  • Tests (client/taskboard-web/e2e/)

  • start-api.mjs: deletes e2e.db and runs the API in Release on :5180 with CORS for :4300. It uses Release because a running dev API locks bin/Debug on Windows.

  • playwright.config.ts: two webServers (API + ng serve --configuration e2e --port 4300), Chromium only, 1 retry with trace in CI.

  • support.ts: unique names (the tests share one DB and run in parallel), REST setup through JSON transcoding, openBoard (waits for the "Live" status), dragCard.

  • boards.spec.ts, tasks.spec.ts, live-updates.spec.ts.
  • Tooling

  • ci.yml: e2e job (Playwright browser install, Release build, npx playwright test, report artifact uploaded even when tests fail).

  • .mcp.json: Playwright MCP server (cmd /c npx, so it works on Windows only).

  • .gitignore: Playwright output and .playwright-mcp/.

  • CLAUDE.md, client README.md: e2e commands, ports, pitfalls.
  • How to test


    cd client/taskboard-web
    npx playwright install chromium   # once per machine
    npm run e2e                       # 3 tests, ~35 s including server startup
    npx playwright show-report
    

  • Run it while the dev servers (API :5063, npm start :4200) are running: still green, and taskboard.db is unchanged.

  • CI: the e2e job is green and the playwright-report artifact opens.
  • AI assistance


  • Plan mode (Opus 5.5): checked the tooling first (hooks dry-run with sample input, agents, skills, missing MCP config), then wrote the plan; the author chose the isolation strategy, Playwright MCP and the subagent.

  • Playwright MCP: used to probe the real UI before writing the tests. It confirmed the selectors (roles, labels, regions). A plain Playwright script then showed that locator.dragTo does not trigger CDK drag-drop, so dragCard uses manual mouse steps.

  • Lesson: in the MCP browser the status stayed on "Connecting…" forever. I diagnosed that as a production bug and implemented a contract change (BoardEvent.subscribed), which the author approved. An independent check in plain Playwright Chromium showed the old code going "Live" in ~280 ms: the MCP browser buffers streaming responses. The change was reverted completely, and the pitfall is documented in CLAUDE.md.

  • Subagent test-engineer wrote the specs from a detailed brief. It found a real race on its own: the optimistic move had already re-rendered the card while UpdateTaskItem was still in flight, and page.reload() aborted it. The test now waits for the response.

  • Hooks: proto-codegen regenerated the TS clients automatically during the (later reverted) proto change.

  • Verified by running (automated, not by hand):

  • - npx playwright test: 3/3, twice, each run on a fresh DB.
    - --repeat-each=5: 15/15.
    - Red check: with the watchBoard call disabled, live-updates.spec.ts fails.
    - Karma: 61/61 (it does not pick up e2e/).
    - dotnet test: 107/107 with the MigrateOnStartup change.
    - A full run while the dev servers were up left taskboard.db untouched.

    🤖 Generated with Claude Code

    Diff: 516 lines (+387 / -129) across 6 files Reviewer: claude[bot] Review duration: 18m
    All Vouch review confidence checks passed
    Residual risk 0.25 = Change Risk (0.48) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.48 · 516 lines diff across 6 files
    0.48
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.374
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #10"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 47.7% (MEDIUM) · Higher = larger blast radius
    47.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 25.4% · Safe to merge
    25.4%