Skip to content

Roll to Playwright v1.60.0#1

Open
nczz wants to merge 14 commits into
mainfrom
roll/v1.60.0
Open

Roll to Playwright v1.60.0#1
nczz wants to merge 14 commits into
mainfrom
roll/v1.60.0

Conversation

@nczz

@nczz nczz commented May 14, 2026

Copy link
Copy Markdown
Owner

Roll playwright-go to Playwright v1.60.0.

Runtime alignment

  • Align HAR export with Playwright 1.60 protocol behavior by handling artifact vs entries results and local .zip export compression.
  • Align recordHarOptions serialization with the v1.60 protocol field name.
  • Align WebSocketRoute close/connect forwarding behavior with upstream Playwright client semantics.
  • Avoid route handler shared-error races in iframe route helpers.

Test alignment and stabilization

  • Update TestMouseWheel to move the mouse before wheel input, matching upstream Playwright 1.60 page/wheel.spec.ts.
  • Keep WebKit macOS popup skips scoped to popup tests only. These are documented as a GitHub macOS WebKit browser-close cascade and are not treated as a runtime fix.
  • Keep existing Chromium local-network launch compatibility for CI.

Verification

Local verification run before the latest push:

  • BROWSER=webkit go test -run '^(TestBrowserContextWindowOpenshouldUseParentTabContext|TestPageEventShouldHaveURL|TestBrowserContextEventsRequest|TestBrowserContextEventsResponse|TestDialogEventShouldWorkInImmdiatelyClosedPopup|TestDialogShouldWorkInPopup|TestPageExpectPopup|TestPageOpener|TestPageClockPopup|TestMouseWheel)$' -count=1 -race -timeout 120s -v ./tests
  • BROWSER=webkit go test -timeout 15m -v -coverprofile=covprofile -coverpkg="github.com/playwright-community/playwright-go" --race ./...
  • go test -count=1 -timeout 15m -v -coverprofile=covprofile -coverpkg="github.com/playwright-community/playwright-go" --race ./...

Known limitation

WebKit on GitHub macOS currently closes the browser while opening several popup cases, which can cascade into unrelated failures. The PR isolates only those popup tests behind isWebKit && runtime.GOOS == "darwin"; non-WebKit and non-macOS coverage still runs.

nczz and others added 14 commits May 11, 2026 13:47
- Update Playwright driver to v1.59.1
- Chromium 147.0.7727.15, Firefox 148.0.2, WebKit 26.4
- Add Browser.Bind/Unbind (startServer/stopServer protocol)
- Add BrowserContext.Debugger, IsClosed, SetStorageState
- Add Page.AriaSnapshot, Screencast, ClearConsoleMessages, ClearPageErrors, PageErrors
- Add CDPSession.OnClose, ConsoleMessage.Timestamp, Response.HttpVersion
- Add Request.ExistingResponse, Locator.Normalize, Locator.Description
- Add Debugger class (event-based PausedDetails)
- Add Screencast class (client-side wrapper for screencast commands)
- Add Disposable to objectFactory (driver sends but Go doesn't expose)
- Fix Connect protocol: wsEndpoint -> endpoint
- Fix video: artifact from page initializer (no longer event-based)
- Fix skipFieldSerialization: handle nil Func types
- Patch fixes: add Go to route.url, unroute.url, routeWebSocket.url,
  waitForURL, pageErrors, Description langs
- Generator fixes: Disposable->void, Promise->void in func returns,
  FilePayload union->any, void event handler

BREAKING CHANGE: RecordVideo.Dir changed from string to *string
(generated from protocol, dir is now optional in PW 1.59)
The BrowserContext channel does not emit pageclose/frameattached/
framedetached/framenavigated/pageload/weberror/download events, so the
handlers registered on bt.channel for those names never fired and the
new OnDownload/OnPageClose/OnPageLoad/OnFrameAttached/OnFrameDetached/
OnFrameNavigated accessors were dead (verified: context.OnDownload never
fired while page.OnDownload did).

Mirror the upstream Playwright client, which derives these context-level
events from the owning Page/Frame, and forward them to the context from
page.go/frame.go. weberror is already emitted by the existing pageError
handler (which also avoids the unguarded *pageImpl assertion panic on a
nil page), so the duplicate weberror channel handler is removed.

Align OnPageLoad with the upstream 'pageload' event name.

Add ported tests from upstream browsercontext-events.spec.ts covering
pageload, framenavigated, pageclose, frameattached, framedetached and
download context events.
The previous implementation called the non-existent protocol methods
Tracing.tracingStartHar / Tracing.tracingStopHar, which failed at runtime
with 'Unknown scheme for Params: Tracing.tracingStartHar'.

Reimplement to mirror the upstream client's _recordIntoHAR/_exportHAR:
StartHar sends harStart (with embed/attach defaults based on the .zip
extension) and records the harId; StopHar exports via harExport, zipping
locally or saving+unzipping the artifact for remote connections, matching
the existing BrowserContext HAR export logic.

Add ported tests from upstream har.spec.ts (HAR with minimal mode +
urlFilter, zipped HAR, and the not-started guard).

Also switch the new context-event tests off deprecated page.Click /
page.WaitForSelector to satisfy the staticcheck lint gate.
…t.ExistingResponse

Three runtime bugs in newly-added v1.60 APIs, each verified with a test:

- Locator.Drop sent raw 'files'/'data' fields. The protocol expects
  files converted to payloads/localPaths/streams (via convertInputFiles)
  and data as an array of {mimeType, value} entries, plus a required
  timeout. Without this the call failed with 'data: expected array, got
  object' / 'timeout: expected float, got undefined'.

- PageAssertions.ToMatchAriaSnapshot used the expect expression
  'to.match.aria.snapshot'; the server expects 'to.match.aria' (matching
  the existing Locator variant). Every assertion failed regardless of
  input.

- Request.ExistingResponse relied on a 'hasResponse' initializer field
  that the protocol never sends, so it always returned nil. Mirror
  upstream by caching the Response on its Request when the Response is
  constructed.

Add ported/targeted tests: TestLocatorDrop, TestPageAssertionsToMatchAriaSnapshot,
TestRequestExistingResponse.
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.

2 participants