Skip to content

Grow e2e suite to cover masks, scopes, bulk-approve, categories - #81

Merged
stolau merged 1 commit into
mainfrom
grow-e2e-coverage
Jul 27, 2026
Merged

Grow e2e suite to cover masks, scopes, bulk-approve, categories#81
stolau merged 1 commit into
mainfrom
grow-e2e-coverage

Conversation

@stolau

@stolau stolau commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #76. The e2e dogfood suite (examples/demo-app/e2e.test.ts) only exercised
capture → upload → render → approve/fail, despite several recent PR bodies citing
"e2e 2/2" as verification for features it never actually touched through a live
browser + live backend. Adds four new tests, each its own test() block for clear
CI failure attribution, all extending the same shared Flask + browser pipeline
tests 1-2 already spawn (no second Flask subprocess):

  • masks: drag-draw a rect against a real rendered candidate image, save as
    global, confirm it renders, delete it.
  • Branches & Releases: a branch-scoped run (via raw fetchcreateRun()
    has no scope param) approved, then found through the viewer's filtered list.
    Directly the class of bug PR Fix scope-unaware snapshot history endpoints #80 just fixed.
  • bulk approve: two new snapshots, both checkbox-selected, approved in one
    action, both confirmed pass.
  • category management: tag → rename → confirm the cascade landed on the
    snapshot's own Category field, not just the category listing's own bookkeeping.

Two prerequisite surgical fixes to shared test infrastructure, both caught by
architect review before any test code was written:

  • capturePage() gained an optional name param (default unchanged) — three of
    the four new tests need distinctly-named snapshots, and bulk-approve needs two
    in one run, which the helper as it stood couldn't produce.
  • The in-file viewer proxy now forwards request body + Content-Type for any
    method — it previously only worked because the sole pre-existing POST (approve)
    is bodyless; mask creation and category rename both need bodied requests.

Design went through two architect SOLID-gate rounds (round 1 CONCERNS on both
fixes above, round 2 SOUND).

Test plan

  • Both infra fixes independently mutation-tested (reverted → confirmed the
    dependent tests fail — 3 for the name param, 2 for the proxy body —
    restored)
  • npm run test:e2e -w examples/demo-app — 6/6 passing, run twice
    consecutively for stability (~9-11s total, was ~5s)
  • npm run lint --workspaces clean
  • npm test --workspaces — 36 client + 55 viewer, all passing
  • backend ruff check + pytest — 141/141 (unaffected, no backend changes)
  • examples/demo-app/CODEMAP.md updated

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01NrQeh9CXrigN1cvpJuyzy4

…ies (closes #76)

The e2e dogfood suite still only exercised capture -> upload -> render ->
approve/fail, despite several recent PR bodies citing "e2e 2/2" as
verification for features it never actually touched through a live
browser + live backend. Adds four new tests, each its own test() block
for clear CI failure attribution, all extending the same shared Flask +
browser pipeline tests 1-2 already spawn (no second Flask subprocess):

- masks: drag-draw a rect against a real rendered candidate image, save
  as global, confirm it renders, delete it. The one flow most worth live
  coverage -- drag math against real overlay/image dimensions can't be
  proven by a mocked-fetch component test the way a real image can.
- Branches & Releases: a branch-scoped run (via raw fetch -- createRun()
  has no scope param) approved, then found through the viewer's filtered
  list. Directly the class of bug PR #80 just fixed.
- bulk approve: two new snapshots, both checkbox-selected, approved in
  one action, both confirmed pass.
- category management: tag -> rename -> confirm the cascade landed on
  the snapshot's own Category field, not just the category listing's own
  bookkeeping.

Two prerequisite surgical fixes to shared test infrastructure, both
caught by architect review before any test code was written:

- capturePage() hardcoded the literal name "demo-page" with no way to
  override it -- three of the four new tests need distinctly-named
  snapshots to avoid colliding with tests 1-2's own baseline/approval
  state, and bulk-approve needs two in one run, which the helper as it
  stood couldn't produce at all (a second call would silently overwrite
  the first). Added an optional name param, default unchanged.
- The in-file viewer proxy forwarded no request body at all -- it got
  away with this because the only POST the original two tests ever sent
  through it (approve) is bodyless. Mask creation and category rename
  both need a real JSON body reaching the backend through the live
  viewer's own fetch() calls; fixed to forward body + Content-Type for
  any method.

Design went through two architect SOLID-gate rounds (round 1 CONCERNS on
both fixes above, round 2 SOUND). Both fixes were independently mutation
tested against the real running suite -- reverted each, confirmed the
tests that depend on it fail (3 tests for the name param, 2 for the
proxy body), restored, confirmed all 6 pass again, twice in a row for
stability. New suite runtime: ~9s total (was ~4s), nowhere near the
existing 240s per-block timeout.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NrQeh9CXrigN1cvpJuyzy4
@stolau
stolau merged commit fcf8104 into main Jul 27, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Grow examples/demo-app's e2e dogfood test to cover post-wave-1 features

1 participant