Skip to content

tests(visual-react): commit Playwright baselines + wire to CI #770

@EmersonBraun

Description

@EmersonBraun

Context

PR #765 closed #253 (P0.42) on the Ink side with 21 ANSI snapshots. The React side shipped only the harness scaffold — `apps/visual-react/` (Vite + Playwright config + 14 deterministic case routes + spec iterating `CASE_IDS`). Baseline PNGs are intentionally not committed because they require a Chromium binary install on a stable machine.

What to ship

  1. Run `pnpm --filter @agentskit/visual-react test:visual:install` then `test:visual:update` on a clean Linux x86_64 environment (so baselines match the CI runner).
  2. Commit the resulting `apps/visual-react/tests/visual.spec.ts-snapshots/*.png` files.
  3. Add a CI workflow (`.github/workflows/visual.yml`) that:
    • Caches `~/.cache/ms-playwright`
    • Runs `pnpm --filter @agentskit/visual-react build` + `test:visual`
    • Uploads diffs on failure
  4. Decide policy on flaky drift — `maxDiffPixelRatio: 0.001` is currently the bar; consider per-OS browser pinning if drift becomes an issue.

Acceptance

  • Baselines committed for all 14 cases
  • CI job green on `main`, fails on intentional component visual regression (verify with a one-off color tweak in a probe PR)
  • README updated with the actual update workflow once CI is the source of truth

See `apps/visual-react/README.md` for current setup steps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions