What’s New

Playwright v1.61.0

v1.61.0
Added
  • Add Credentials virtual authenticator API via browserContext.credentials for registering passkeys and handling navigator.credentials ceremonies without hardware keys
  • Add WebStorage API via page.localStorage and page.sessionStorage for reading and writing page storage
  • Add apiResponse.securityDetails() and apiResponse.serverAddr() methods to mirror browser-side response methods
  • Add artifactsDir option in browserType.connectOverCDP() to control where artifacts are stored when attached to an existing browser
  • Add cursor option in screencast.showActions() to control cursor decoration for pointer actions
  • Add timestamp parameter to onFrame callback in screencast.start() indicating when the frame was presented by the browser
  • Add 'on-all-retries', 'retain-on-first-failure', and 'retain-on-failure-and-retries' modes to testOptions.video option
  • Add support for expect.soft.poll()
  • Add fullConfig.argv providing a snapshot of process.argv from the runner process
  • Add fullConfig.failOnFlakyTests to mirror the config option for reporters
  • Add -G command line shorthand for --grep-invert
  • Add support for Ubuntu 26.04
Changed
  • testInfo.errors now lists each sub-error of an AggregateError as a separate entry
  • HAR and trace recordings now include WebSocket requests
🔑 WebAuthn passkeys

New Credentials virtual authenticator, available via browserContext.credentials, lets tests register passkeys and answer navigator.credentials.create() / navigator.credentials.get() ceremonies in the page — no real hardware key required, works in all browsers:

const context = await browser.newContext();

// Seed a passkey your backend provisioned for a test user.
await context.credentials.create('example.com', {
  id: credentialId,
  userHandle,
  privateKey,
  publicKey,
});
await context.credentials.install();

const page = await context.newPage();
await page.goto('https://example.com/login');
// The page's navigator.credentials.get() is answered with the seeded passkey.

You can also let the app register a passkey once in a setup test, read it back with credentials.get(), and seed it into later tests — see Credentials for details.

🗃️ Web Storage

New WebStorage API, available via page.localStorage and page.sessionStorage, reads and writes the page's storage for the current origin:

await page.localStorage.setItem('token', 'abc');
const token = await page.localStorage.getItem('token');
const items = await page.sessionStorage.items();
New APIs
Network
Browser and Screencast
  • New option artifactsDir in browserType.connectOverCDP() controls where artifacts such as traces and downloads are stored when attached to an existing browser.
  • New option cursor in screencast.showActions() controls the cursor decoration rendered for pointer actions.
  • The onFrame callback in screencast.start() now receives a timestamp of when the frame was presented by the browser.
Test runner
  • The testOptions.video option now supports the same set of modes as trace: new 'on-all-retries', 'retain-on-first-failure' and 'retain-on-failure-and-retries' values. See the video modes table for which runs are recorded and kept in each mode.
  • Supported expect.soft.poll(...).
  • New fullConfig.argv — a snapshot of process.argv from the runner process, handy for reading custom arguments passed after the -- separator.
  • New fullConfig.failOnFlakyTests mirrors the config option, so reporters can explain why a flaky run failed.
  • testInfo.errors now lists each sub-error of an AggregateError as a separate entry.
  • New -G command line shorthand for --grep-invert.
🛠️ Other improvements
  • Playwright now supports Ubuntu 26.04.
  • HAR and trace recordings now include WebSocket requests.
Browser Versions
  • Chromium 149.0.7827.55
  • Mozilla Firefox 151.0
  • WebKit 26.5

This version was also tested against the following stable channels:

  • Google Chrome 149
  • Microsoft Edge 149
View original