Change8

v1.60.0

Breaking Changes
📦 playwrightView on GitHub →
4 breaking21 features🐛 2 fixes1 deprecations🔧 36 symbols

Summary

This release introduces significant new APIs for HAR recording, simulated drag-and-drop via locator.drop(), and test abortion via test.abort(). It also removes several long-deprecated APIs and enhances ARIA snapshotting capabilities.

⚠️ Breaking Changes

  • Removed long-deprecated API: `Locator.ariaRef()`. Fix: Use the standard locator.ariaSnapshot() pipeline instead.
  • Removed long-deprecated option: `handle` option on BrowserContext.exposeBinding and Page.exposeBinding.
  • Removed long-deprecated option: `logger` option on BrowserType.connect and BrowserType.connectOverCDP. Fix: Use tracing instead.
  • Removed long-deprecated Context options: `videosPath` / `videoSize`. Fix: Use recordVideo instead.

Migration Steps

  1. If using Locator.ariaRef(), replace usage with the locator.ariaSnapshot() pipeline.
  2. If using the 'handle' option on exposeBinding, update usage.
  3. If using the 'logger' option on BrowserType.connect or BrowserType.connectOverCDP, use tracing instead.
  4. If using context options 'videosPath' or 'videoSize', use recordVideo instead.
  5. Update consoleMessage.location() usage to use 'line'/'column' instead of 'lineNumber'/'columnNumber'.

✨ New Features

  • HAR recording exposed as a first-class tracing API via tracing.startHar() and tracing.stopHar(), supporting content, mode, and urlFilter options.
  • New locator.drop() simulates external drag-and-drop of files or clipboard-like data onto an element, dispatching synthetic drag events.
  • expect(page).toMatchAriaSnapshot() now works on a Page object, equivalent to asserting against page.locator('body').
  • New 'boxes' option on locator.ariaSnapshot() / page.ariaSnapshot() appends bounding box information for AI consumption.
  • New test.abort() allows aborting the currently running test from a fixture, hook, or route handler with an optional message.
  • New browser.on('context') event fired when a new context is created on the browser.
  • BrowserContext now mirrors lifecycle events from its pages: download, frameattached, framedetached, framenavigated, pageclose, pageload.
  • New 'description' option in getByRole methods for matching the accessible description.
  • New 'pseudo' option in expect(locator).toHaveCSS() to read computed styles from ::before or ::after pseudo-elements.
  • New 'style' option in locator.highlight() applies extra inline CSS to the highlight overlay, and page.hideHighlight() clears all highlights.
  • webSocketRoute.protocols() returns the WebSocket subprotocols requested by the page.
  • New 'noDefaults' option in browserType.connectOverCDP() disables Playwright's default context overrides.
  • webError.location() now mirrors consoleMessage.location() information.
  • consoleMessage.location() now exposes 'line' / 'column' properties.
  • New testInfoError.errorContext surfaces additional diagnostic context on matcher failures.
  • reporter.onError() now receives a workerInfo argument for fixture teardown errors.
  • New {testFileBaseName} token available in testProject.snapshotPathTemplate.
  • HTML reporter: npx playwright show-report accepts .zip files directly.
  • HTML reporter: Steps with attachments in nested children show an indicator on the parent step.
  • HTML reporter: repeatEachIndex is shown in the test header when non-zero.
  • Trace Viewer adds a pretty-print toggle for JSON/form request and response bodies in the network details panel.

🐛 Bug Fixes

  • Test runner errors when a config tries to override a non-option fixture.
  • Test runner rejects 'workers: 0' or negative values for workers.

Affected Symbols

⚡ Deprecations

  • `consoleMessage.location()` properties `lineNumber` / `columnNumber` are deprecated; use `line` / `column` instead.