Skip to content

Upgrade to Playwright 1.61.1#381

Open
kruppel wants to merge 4 commits into
YusukeIwaki:mainfrom
kruppel:kurt/playwright-1.61.1
Open

Upgrade to Playwright 1.61.1#381
kruppel wants to merge 4 commits into
YusukeIwaki:mainfrom
kruppel:kurt/playwright-1.61.1

Conversation

@kruppel

@kruppel kruppel commented Jun 26, 2026

Copy link
Copy Markdown

Summary

Upgrade playwright-ruby to Playwright 1.61.1.

Client Changes

  • Page#local_storage / #session_storage: WebStorage API
  • BrowserContext#credentials: WebAuthn virtual authenticator
  • APIResponse#security_details / #server_addr: TLS cert details and resolved IP/port

Driver Changes

  • Frame#expect error handling: Refactored to handle Playwright 1.61+ behavior
    • The expect command now resolves on successful match and rejects with FrameExpectErrorDetails on mismatch/timeout
    • Changed from parsing result['received'] to catching ::Playwright::Error exceptions
    • Returns { 'matches' => !is_not } on success, extracts error details on failure
    • Properly handles both isNot flag and error details from server

kruppel added 4 commits June 25, 2026 19:40
Ports Frame#expect to the 1.61 expect protocol: the command now resolves
on a successful match and rejects with FrameExpectErrorDetails on
mismatch/timeout (upstream microsoft/playwright#40801). Carry
errorDetails on Playwright::Error and translate it back into the
assertion result hash.
Adds the 1.61 WebStorage API: page.local_storage / page.session_storage
expose the current origin's localStorage / sessionStorage via items,
get_item, set_item, remove_item and clear, backed by the page channel's
webStorage* commands.

Registers WebStorage with the API generator and ports the upstream
page-localstorage spec.
Adds the 1.61 WebAuthn API: browser_context.credentials exposes a virtual
authenticator scoped to the context, with install, create, get and delete
backed by the context channel's credentials* commands. Lets tests seed
passkeys and answer navigator.credentials ceremonies without real hardware.

Registers Credentials with the API generator, maps the class doc examples,
and ports the upstream browsercontext-webauthn spec.
Exposes the 1.61 APIResponse fields: security_details returns the TLS
certificate details for HTTPS responses (nil for plain HTTP) and
server_addr returns the resolved IP address and port, both read from the
fetch response initializer.

Ports the upstream global-fetch specs covering these methods.
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

@kruppel is attempting to deploy a commit to the Yusuke Iwaki's projects Team on Vercel.

A member of the Team first needs to authorize it.

Comment thread lib/playwright/errors.rb

def log=(log)
return unless log
@raw_log = log

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not well captured in the release notes, but this upstream PR #40801 "chore: throw on Frame.expect / Page.expectScreenshot failure" motivated the Error changes.

Here's the difference in the expect protocol across the two versions:

Playwright 1.60.0 — the command returns the result:

export type FrameExpectResult = {
  matches: boolean,
  received?: { value?: SerializedValue, ariaSnapshot?: string },
  timedOut?: boolean,
  errorMessage?: string,
  log?: string[],
};
// (no FrameExpectErrorDetails type exists)

Playwright 1.61.1 — the result is gone; failure info moved to a reject-path type:

export type FrameExpectResult = void;            // ← resolves with NOTHING on a match

export type FrameExpectErrorDetails = {          // ← NEW; sent on the error/reject path
  received?: { value?: SerializedValue, ariaSnapshot?: string },
  timedOut?: boolean,
  customErrorMessage?: string,
};

In 1.60, the Ruby client read result['matches'] / ['received'] / ['log'] off the return value. In 1.61, since the command returns void, assertions break as the expect call comes back as {"id":7} (no result), and raises undefined method 'key?' for nil at frame.rb:738.

To resolve the failing test:

  • details carries the new FrameExpectErrorDetails (received / timedOut / customErrorMessage), which now only exists on the error path.
  • raw_log replaces the old FrameExpectResult.log field (the call-log array), which likewise moved off the result and onto the error's wire log.

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