Skip to content

Accept fps and showActions in recordVideo, convert adopted context options like New Context - #5347

Merged
aaltat merged 3 commits into
MarketSquare:mainfrom
aaltat:record-video-show-actions
Oct 17, 2026
Merged

aaltat merged 3 commits into
MarketSquare:mainfrom
aaltat:record-video-show-actions

Conversation

@aaltat

@aaltat aaltat commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Summary

RecordVideo gets Playwright 1.64's fps and showActions, so New Context and New Persistent Context accept them. adopted_context_options converts its arguments like New Context, follow-up to #5326.

 RecordVideo
   dir: str
   size: ViewportDimensions
+  fps: int
+  showActions
+    duration: int
+    position: top-left | top | top-right | bottom-left | bottom | bottom-right
+    cursor: pointer | none
+    style: {point, highlight, title}   # CSS declarations
 Browser.adopted_context_options(tracing, recordVideo, recordHar, viewport)
+  Robot Framework conversion, as for the arguments of New Context
   PlaywrightState.adopted_context_options

 AdoptedContextOptions
-  recordVideo: dict[str, Any] | None
-  recordHar: dict[str, Any] | None
+  recordVideo: RecordVideo | None
+  recordHar: RecordHar | None

The deprecated showActions.fontSize is not declared; style.title replaces it. position and cursor are (str, Enum), because StrEnum needs Python 3.11; JSON gets the plain values.

Closes #5346

Evidence

  • Before:
    New Context    recordVideo={'fps': 10, 'showActions': {...}}
    => ValueError: Argument 'recordVideo' got value '{...}' (dictionary) that cannot be converted to RecordVideo or None.
    
    adopted_context_options(recordVideo={"fps": "10"})      => fps == "10"
    adopted_context_options(recordVideo={"showActions": {"fontSize": 20}})  => no error, key passed on
    
    After:
    New Context    recordVideo={'fps': 10, 'showActions': {...}}
    => Playwright gets fps 10 and showActions with style as a dict; the video is recorded
    
    adopted_context_options(recordVideo={"fps": "10"})      => fps == 10
    adopted_context_options(recordVideo={"showActions": {"fontSize": 20}})  => ValueError, as New Context
    
    New tests: test_new_context_sends_frame_rate_and_action_annotations, test_new_persistent_context_sends_action_annotations, test_video_options_are_converted_like_new_context, test_deprecated_font_size_fails_like_new_context, and the acceptance test Create Video With Action Annotations And Frame Rate. inv utest (835 passed), and the Video, Adopt Context and Adopted Context Recording suites pass.

Merge Danger

Door: two-way

adopted_context_options from #5326 is not released yet, so making it strict changes nothing users have.

Blast Radius: small

Libraries built on adopted_context_options, such as the Electron library, now fail on keys RecordVideo does not declare, for example showActions.fontSize. New Context only gains keys.

🤖 Generated with Claude Code

aaltat and others added 3 commits October 17, 2026 14:47
RecordVideo declared only dir and size, so New Context and New
Persistent Context rejected Playwright's fps and showActions options.

Closes MarketSquare#5346

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adopted_context_options passed recordVideo, recordHar and viewport on
as given, so the values were not converted and unknown keys were kept,
unlike New Context. They now go through the same Robot Framework
conversion as the arguments of New Context, and AdoptedContextOptions
types recordVideo and recordHar as RecordVideo and RecordHar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The New Context docstring now points to RecordVideo for the new video
options, and the failure test of adopted_context_options sends the
deprecated showActions.fontSize, which RecordVideo leaves out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aaltat
aaltat force-pushed the record-video-show-actions branch from 57fad3f to 7066ce5 Compare October 17, 2026 11:47
@aaltat
aaltat merged commit b022ac3 into MarketSquare:main Oct 17, 2026
30 checks passed
@aaltat
aaltat deleted the record-video-show-actions branch October 17, 2026 12:23
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.

Support fps and showActions in recordVideo of New Context

1 participant