Skip to content

test: guard the adopted context options and video sizes before unifying them - #5358

Merged
aaltat merged 4 commits into
MarketSquare:mainfrom
aaltat:adopted-context-tests
Oct 17, 2026
Merged

aaltat merged 4 commits into
MarketSquare:mainfrom
aaltat:adopted-context-tests

Conversation

@aaltat

@aaltat aaltat commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Tests only, no production code. Follow-up to #5326 and #5356.

utest/test_adopted_context.py
  browser fixture                       replaces 28 hand-written library(tmpdir, monkeypatch)
  + New Context recordVideo={}          -> Browser's video folder, default size
  + adopted options == New Context      recordVideo, recordHar, trace file for the same arguments
  + cached video size, per route        New Context / New Persistent Context / register_adopted_context
                                        x viewport 800x600 (no size) / explicit size 640x480
  ~ embedded <video>                    asserts the HTML, at 800x600
atest/
  test/01_Browser_Management/tracing_groups.py -> library/tracing_groups.py

The next PR unifies how the three routes work out the video size (_video_size at three call sites). The old tests all used 1280x720, which is also the fallback without a viewport or size, so they could not catch a call site that dropped either.

Evidence

  • Before: replacing any one _video_size(...) call site with _video_size(None, None) leaves every test green.
    After: it fails that route's ..._caches_its_video_size[viewport] and [size] (and the embed test for register_adopted_context). Bypassing _record_video or _record_har on the New Context route fails the comparison test.
  • utest/test_adopted_context.py: 37 passed; inv utest: 850 passed. inv atest --suite "Tracing Groups" and "Adopted Context Recording": passed with the moved helper.

Merge Danger

Door: two-way

Blast Radius: none

Tests and an acceptance-test helper only.

🤖 Generated with Claude Code

aaltat and others added 4 commits October 17, 2026 20:35
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Compare adopted_context_options with the recordVideo, recordHar and
trace file that New Context sends for the same arguments, so the two
cannot drift apart. New Context with an empty recordVideo records into
the video folder, and a registered adopted context embeds its video in
the log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
get_trace_group_titles and its siblings are used by suites in two
folders, so they belong with the other shared Python keywords. Their
annotations now say that get_file_line can return None.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The video tests used the 1280x720 default, which is also what the size
falls back to without a viewport or size, so dropping either at any
call site went unnoticed. New Context, New Persistent Context and a
registered adopted context now each show they cache the size of their
viewport, or the size given, and the embedded video uses it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aaltat
aaltat force-pushed the adopted-context-tests branch from f5dab48 to a0253b3 Compare October 17, 2026 17:35
@aaltat
aaltat marked this pull request as ready for review October 17, 2026 17:35
@aaltat
aaltat merged commit 133daa5 into MarketSquare:main Oct 17, 2026
59 of 60 checks passed
@aaltat
aaltat deleted the adopted-context-tests branch October 17, 2026 18:15
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.

1 participant