Grow e2e suite to cover masks, scopes, bulk-approve, categories - #81
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #76. The e2e dogfood suite (
examples/demo-app/e2e.test.ts) only exercisedcapture → 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 clearCI failure attribution, all extending the same shared Flask + browser pipeline
tests 1-2 already spawn (no second Flask subprocess):
global, confirm it renders, delete it.
fetch—createRun()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.
action, both confirmed pass.
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 optionalnameparam (default unchanged) — three ofthe four new tests need distinctly-named snapshots, and bulk-approve needs two
in one run, which the helper as it stood couldn't produce.
Content-Typefor anymethod — 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
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 twiceconsecutively for stability (~9-11s total, was ~5s)
npm run lint --workspacescleannpm test --workspaces— 36 client + 55 viewer, all passingruff check+pytest— 141/141 (unaffected, no backend changes)examples/demo-app/CODEMAP.mdupdatedCo-Authored-By: Claude Sonnet 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01NrQeh9CXrigN1cvpJuyzy4