Skip to content

[Ports]: Backport client side changes for 1.62 #389

Description

@YusukeIwaki

Scope

This review covers the upgrade from Playwright v1.61.1 to v1.62.1.

The two tags are not on a single linear history, so the review uses their merge base (ac05145c...) through v1.62.1. Of the 354 commits in that range, 66 match the path filters used by the former client-side changes workflow:

  • docs/src/api/**
  • packages/playwright-core/src/client/**
  • packages/isomorphic/**
  • packages/playwright/src/matchers/matchers.ts
  • packages/protocol/spec/**/*.yml

That workflow was removed by microsoft/playwright#41310.

Classification

  • Port required: handwritten Ruby implementation and RSpec coverage are needed.
  • Generated only: review/regenerate development/api.json and generated documentation; no handwritten Ruby implementation.
  • No port: JavaScript/Playwright Test-specific, internal TypeScript refactor, or behavior supplied entirely by the driver/browser.
  • Canceled: reverted within the same target release.

Ruby implementation summary

The main Ruby implementation work is:

microsoft/playwright#41882 does not require a Ruby implementation change because empty strings are truthy in Ruby, and the current implementation already preserves an empty override. An RSpec regression test is still recommended.

Upstream PR review, oldest first

# Upstream PR and behavior Ruby porting decision packages/playwright-core/src/client/** Tests
1 #41257 Reapplies AbortSignal support to client-side Waiter methods. No port; JavaScript-specific. Yes. Page, BrowserContext, Worker, WebSocket and other Waiter users reject on signals. Added a file chooser wait test aborted by the user.
2 #41296 Warns about CDP connections to browsers not launched by Playwright. Generated only. No. None.
3 #41345 Removes unused potentiallyClosesScope protocol metadata. No port. No. None.
4 #41321 Splits client channel types from server dispatcher types. No port; TypeScript type/import refactor. Yes. Changes type imports across most client files and relocates channels.d.ts. Existing tests changed for type/import updates; no new behavior.
5 #41215 Includes virtual WebAuthn credentials in storage state and restores them in new/existing contexts. Port required. Add credentials: to storage_state and regenerate API/docs. Yes. BrowserContext storage-state parameters/results and storage-state types. Added opt-in behavior, round-trip, replacement/clearing, and page-created passkey reuse tests.
6 #41342 Shows console-message source in Trace Viewer. No port; Trace Viewer-only. No. Trace Viewer and UI mode tests now verify message source.
7 #41269 Adds busy to getByRole. Canceled by #41795. No. Role selector and locator generator tests added, then reverted.
8 #41380 Adds Locator.waitForFunction(). Port required. Ruby should support expression strings, an optional argument, and timeout. Yes. Locator, Frame, protocol channel types. New tests for attributes, immediate success, ElementHandle arguments, string expressions, promises, rerenders, errors, and strict mode.
9 #41352 Replaces the client platform abstraction with Node module stubs. No port; Node/browser bundle internals. Yes. Broad fs/path/crypto/platform import changes. Adds an in-page browser-client bundle connection test.
10 #41433 Adds scroll: "auto" | "none" to element actions. Port required for Locator, Frame, Page, and ElementHandle actions. Yes, primarily generated channel types; behavior is protocol/server-side. Added tests for out-of-viewport, in-viewport, nested scrollers, and hover.
11 #41450 Omits data: URL payloads from MCP snapshot/network output. No port; MCP-specific. No. Snapshot/network output coverage changed.
12 #41303 Re-enables Chromium RenderDocument. No port; driver/browser behavior. No. JavaScript coverage behavior updated.
13 #41458 Accepts the JavaScript RegExp v flag in locator options. No port; Ruby cannot originate the JS-only flag. No. Added selector option coverage using the v flag.
14 #41471 Treats $$, $&, and similar replacement patterns literally in URL globs. No port; fixes JavaScript String.replace semantics and Ruby is unaffected. No. Added literal replacement-pattern and baseURL tests.
15 #41484 Preserves options passed to the object-form browserType.connect overload. No port; Ruby does not expose that overload. Yes. One-line BrowserType option-spread fix. Added object-form headers/timeout coverage.
16 #41480 Clones pollIntervals so repeated expect calls do not consume them. No port; Playwright Test-specific. No. Added repeated toPass coverage.
17 #41475 Preserves the selector engine when a non-XPath source starts with ... No port; Ruby delegates selector parsing to the driver. No. Added explicit selector-engine coverage.
18 #41470 Resets lastIndex for global/sticky URL RegExp values. No port; Ruby Regexp has no equivalent state issue. No. Added three consecutive interceptions with one global regexp.
19 #41526 Generates shared structs.d.ts for client and server channels. No port; TypeScript generation only. Yes. Generated channels.d.ts. None.
20 #41141 Supports AbortSignal on server-side methods. No port; JavaScript-specific. Yes. Broad channel-call changes passing signals. Existing click, wait-for-function, debugger and related tests gained abort coverage.
21 #41545 Stubs crypto for the browser client build. No port. Yes. Waiter dependency/import changes. None.
22 #41542 Consolidates stack trace utilities. No port. Yes. clientStackTrace.ts utility movement. None.
23 #41294 Adds routeFromHar({ interceptAPIRequests }). Canceled by #41965. Yes. BrowserContext, HarRouter and generated channel types. HAR API-request interception tests added, then reverted.
24 #41557 Makes WebSocket baseURL scheme rewriting case-insensitive. No incremental port because Ruby does not currently implement route_web_socket; this is needed when that API is implemented. No. Added uppercase HTTP:// baseURL WebSocket routing coverage.
25 #41568 Deprecates the ElementHandle.inputValue timeout option. Generated only. No. None.
26 #41566 Supports AbortSignal on web-first assertions. No port; JavaScript/Playwright Test-specific. Yes. Frame, Waiter, and matcher changes. Assertion timeout/signal tests changed.
27 #41547 Adds AbortSignal to additional Locator, APIRequest, and Route methods. No port; JavaScript-specific. Yes. Fetch, Locator, and Network. None in this PR.
28 #41594 Moves codegen and device descriptors into @isomorphic. No port; Ruby receives device descriptors from the driver. Yes. BrowserContext import update. Recorder API test adjusted.
29 #41591 Moves stack trace helpers from isomorphic to utils. No port. Yes. BrowserContext, ChannelOwner, Connection, Waiter and related imports. Tracing/config tests changed mechanically.
30 #41598 Removes __testHookBeforeQuery. No port. Yes. Frame and Locator remove the internal hook. Locator query test adjusted.
31 #41597 Corrects the AbortSignal option's “since” version to v1.62. No port; JavaScript-only docs. No. None.
32 #41581 Removes unused incremental ariaSnapshot track. No required port. Ruby's unused internal _track cleanup is optional. Yes. Page/channel track fields removed. Tracking test/options removed.
33 #41611 Reimplements Locator.waitForFunction using selector retry infrastructure. Port required as the final form of #41380. Do not send a fixed 100ms polling interval. Yes. Locator removes pollingInterval: 100. No new test in this PR; relies on #41380's suite.
34 #41612 Moves protocol runtime into packages/protocol. No port; TypeScript import refactor. Yes. ChannelOwner, Connection, Errors, JSHandle. None.
35 #41655 Rolls Chromium to r1232. No port; supplied by driver upgrade. No. No new tests; Chromium device UAs updated.
36 #41663 Rolls Firefox to r1534. No port; supplied by driver upgrade. No. No new tests; Firefox device UAs updated.
37 #41682 Normalizes literal URL glob components through new URL(). Port required in Ruby UrlMatcher for default ports, percent-encoding, and IDN. No; changes packages/isomorphic/urlMatch.ts. Added default-port, non-default-port, space-encoding, and IDN cases.
38 #41619 Adds Python expect_download usage docs. No port. No. None.
39 #41152 Adds WebP screenshot output. Port required for generated API/docs and .webp path-to-type inference. Explicit type: "webp" can already be forwarded. Yes. Screenshot type inference and generated channel enum. Added valid WebP output, three browser snapshots, MCP/save-as, and screenshot assertion coverage.
40 #41725 Folds recorder frame paths into action selectors. No port; upstream codegen has no Ruby generator. No. Codegen selector expectations changed.
41 #41709 Adds Python usage examples for remaining expect_* methods. No port. No. None.
42 #41727 Converts recorder preconditionSelector into an expect signal. No port. No. Debug-controller and codegen tests changed.
43 #41728 Mints page aliases in language generators. No port; no upstream Ruby generator. No. Codegen page-alias expectations changed.
44 #41740 Rolls Chromium to r1233. No port; supplied by driver upgrade. No. No new tests; device UAs updated.
45 #41712 Moves timeout from individual method params to protocol metadata. Port required; highest priority. Ruby Channel/Connection must move params[:timeout] into metadata.timeout; v1.62 validators removed per-method timeout fields. Yes. Almost every client method, ChannelOwner, Connection, TimeoutSettings, and generated channels. No new tests; the existing protocol suite covers the refactor.
46 #41782 Mentions WebP for toHaveScreenshot. No port; Playwright Test-specific. No. None.
47 #41787 Merges Waiter timeout and signal rejection handling. No port; internal AbortSignal cleanup. Yes. Waiter users across the client. None.
48 #41792 Supports abort signals for screenshot assertions. No port; Playwright Test/JavaScript-specific. Yes. Page screenshot handling. Added screenshot assertion abort coverage.
49 #41790 Preserves the internal _expect call shape. No separate port; Ruby's relevant change is covered by #41712 timeout metadata work. Yes. Frame, Locator, types, and matcher. None.
50 #41795 Reverts getByRole({ busy }). Canceled with #41269. No. Reverts #41269's tests and docs.
51 #41800 Adds APIResponse.timing(). Port required. Build the timing hash from initializer timing/responseEndTiming and use -1 for missing values. Yes. APIResponse in fetch.ts. Added HTTP, HTTPS, and HAR-replay timing tests.
52 #41813 Documents attribute-presence assertions for Python. No port. No. None.
53 #41814 Rejects out-of-range Clock timestamps. No handwritten port; driver behavior plus generated docs. An RSpec regression test is recommended. No. Added an invalid huge pauseAt timestamp test while RAF is active.
54 #41801 Allows JavaScript functions as evaluate arguments via exposeFunctions. No port; docs mark it langs: js. Yes. ChannelOwner, Frame, JSHandle, Locator, Page, serializers. New extensive callback argument/result/error/frame/navigation/handle/locator tests.
55 #41834 Documents recordVideo.showActions.cursor. Generated only. Ruby Screencast actions already accept cursor. No. None.
56 #41831 Rolls Chromium to r1234. No port; supplied by driver upgrade. No. No new tests; device UAs updated.
57 #41856 Clarifies exposeFunctions scope and lifetime. No port; JavaScript-only docs. No. None.
58 #41866 Fixes the CDPSession event example to use method form. Generated docs review only. No. None.
59 #41898 Acknowledges screencast frames after callbacks finish. Port required. Ruby must send screencastFrameAck(frameId:) in an ensure block after invoking the frame callback. Yes. Screencast and generated channel type. Added backpressure coverage proving frames pause while the callback is pending and resume afterward.
60 #41884 Adds expect.fn() mock functions with awaited assertions. Canceled by #41906. Yes. JSHandle and matcher. Added expect-fn and evaluate-callback tests.
61 #41906 Reverts expect.fn(). Canceled with #41884. Yes. Reverts JSHandle/matcher changes. Deletes/reverts the related tests.
62 #41872 Documents BFCache limitations and defaults. Generated docs review only. No. None.
63 #41921 Allows exposed JavaScript functions in addInitScript arguments. No port; langs: js. Yes. BrowserContext, Page, ClientHelper, generated channels. Added callback, navigation, popup, child-frame, dispose, and error propagation tests.
64 #41938 Rolls Firefox to r1538. No port; supplied by driver upgrade. No. Existing worker locale/timezone failures are enabled, and Firefox local-network permission coverage changes.
65 #41882 Keeps an empty request-body override as an empty string instead of null. No implementation change because empty strings are truthy in Ruby. Add an RSpec regression test. Yes. JavaScript changes || to ?? in Request.postData. Added route.continue({ postData: "" }) coverage.
66 #41965 Cherry-picks the revert of routeFromHar({ interceptAPIRequests }). Canceled with #41294. Yes. Reverts BrowserContext, HarRouter, and generated channels. Removes/reverts HAR API interception tests.

Likely Ruby files

  • lib/playwright/channel.rb
  • lib/playwright/connection.rb
  • lib/playwright/channel_owners/browser_context.rb
  • lib/playwright/locator_impl.rb
  • lib/playwright/url_matcher.rb
  • lib/playwright/api_response_impl.rb
  • lib/playwright/screencast.rb
  • Page, Frame, ElementHandle, and Locator action implementations for scroll:
  • Screenshot implementations for WebP type/path inference

Current generation state

At the time of this review, the working tree has a zero-byte development/api.json and deleted generated API documentation files. Before implementing the ports, rerun the v1.62.1 CLI print-api-json command, verify it succeeds, and regenerate the API/docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions