You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
constcontext=awaitbrowser.newContext();// Seed a passkey your backend provisioned for a test user.awaitcontext.credentials.create('example.com',{id: credentialId,
userHandle,
privateKey,
publicKey,});awaitcontext.credentials.install();constpage=awaitcontext.newPage();awaitpage.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.
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.
tracing.startHar() / tracing.stopHar() expose HAR recording as a first-class tracing API, with the same content, mode and urlFilter options as recordHar. The returned Disposable makes it easy to scope a recording with await using:
awaitusinghar=awaitcontext.tracing.startHar('trace.har');constpage=awaitcontext.newPage();awaitpage.goto('https://playwright.dev');// HAR is finalized when `har` goes out of scope.
🪝 Drop API
New locator.drop() simulates an external drag-and-drop of files or clipboard-like data onto an element. Playwright dispatches dragenter, dragover, and drop with a synthetic [DataTransfer] in the page context — works cross-browser and is great for testing upload zones:
New test.abort() aborts the currently running test from a fixture, hook, or route handler with an optional message. Use it when you have detected an unrecoverable misuse and want to fail the test right away:
test('does not publish to the shared page',async({ page })=>{awaitpage.route('**/publish',route=>{test.abort('Tests must not publish to the shared page. Use the `clone` option.');returnroute.abort();});// ...});
New option noDefaults in browserType.connectOverCDP() disables Playwright's default overrides on the default context (download behavior, focus emulation, media emulation), so attaching to a user's daily-driver browser doesn't disturb its state.
consoleMessage.location() now exposes line / column properties (lineNumber / columnNumber are deprecated).
New testInfoError.errorContext surfaces additional diagnostic context, such as the aria snapshot of the receiver at the time of an expect(...) matcher failure.
reporter.onError() now receives a workerInfo argument with details about the worker for fixture teardown errors.
[Windows] Reverted hiding console window when spawning browser processes, which caused regressions including broken codegen, --ui and show commands (#39990)
screencast.showActions() accepts position ('top-left', 'top', 'top-right', 'bottom-left', 'bottom', 'bottom-right'), duration (ms per annotation), and fontSize (px). Returns a disposable to stop showing actions.
Action annotations can also be enabled in test fixtures via the video option:
Visual overlays — add chapter titles and custom HTML overlays on top of the page for richer narration:
awaitpage.screencast.showChapter('Adding TODOs',{description: 'Type and press enter for each TODO',duration: 1000,});awaitpage.screencast.showOverlay('<div style="color: red">Recording</div>');
Real-time frame capture — stream JPEG-encoded frames for custom processing like thumbnails, live previews, AI vision, and more:
awaitpage.screencast.start({onFrame: ({ data })=>sendToVisionModel(data),size: {width: 800,height: 600},});
Agentic video receipts — coding agents can produce video evidence of their work. After completing a task, an agent can record a walkthrough video with rich annotations for human review:
awaitpage.screencast.start({path: 'receipt.webm'});awaitpage.screencast.showActions({position: 'top-right'});awaitpage.screencast.showChapter('Verifying checkout flow',{description: 'Added coupon code support per ticket #​1234',});// Agent performs the verification steps...awaitpage.locator('#coupon').fill('SAVE20');awaitpage.locator('#apply-coupon').click();awaitexpect(page.locator('.discount')).toContainText('20%');awaitpage.screencast.showChapter('Done',{description: 'Coupon applied, discount reflected in total',});awaitpage.screencast.stop();
The resulting video serves as a receipt: chapter titles provide context, action annotations highlight each interaction, and the visual walkthrough is faster to review than text logs.
🔗 Interoperability
New browser.bind() API makes a launched browser available for playwright-cli, @playwright/mcp, and other clients to connect to.
Bind a browser — start a browser and bind it so others can connect:
Run playwright-cli show to open the Dashboard that lists all the bound browsers, their statuses, and allows interacting with them:
See what your agent is doing on the background browsers
Click into the sessions for manual interventions
Open DevTools to inspect pages from the background browsers.
- `playwright-cli` binds all of its browsers automatically, so you can see what your agents are doing.
- Pass `PLAYWRIGHT_DASHBOARD=1` env variable to see all `@playwright/test` browsers in the dashboard.
🐛 CLI debugger for agents
Coding agents can now run npx playwright test --debug=cli to attach and debug tests over playwright-cli — perfect for automatically fixing tests in agentic workflows:
$ npx playwright test --debug=cli
### Debugging Instructions
- Run "playwright-cli attach tw-87b59e" to attach to this test
$ playwright-cli attach tw-87b59e
### Session `tw-87b59e` created, attached to `tw-87b59e`.
Run commands with: playwright-cli --session=tw-87b59e <command>### Paused
- Navigate to "/" at output/tests/example.spec.ts:4
$ playwright-cli --session tw-87b59e step-over
### Page
- Page URL: https://playwright.dev/
- Page Title: Fast and reliable end-to-end testing for modern web apps | Playwright
### Paused
- Expect "toHaveTitle" at output/tests/example.spec.ts:7
📋 CLI trace analysis for agents
Coding agents can run npx playwright trace to explore Playwright Trace and understand failing or flaky tests from the command line:
$ npx playwright trace open test-results/example-has-title-chromium/trace.zip
Title: example.spec.ts:3 › has title
$ npx playwright trace actions --grep="expect"# Time Action Duration
──── ───────── ─────────────────────────────────────────────────────── ────────
9. 0:00.859 Expect "toHaveTitle" 5.1s ✗
$ npx playwright trace action 9
Expect "toHaveTitle"
Error: expect(page).toHaveTitle(expected) failed
Expected pattern: /Wrong Title/
Received string: "Fast and reliable end-to-end testing for modern web apps | Playwright"
Timeout: 5000ms
Snapshots
available: before, after
usage: npx playwright trace snapshot 9 --name <before|after>
$ npx playwright trace snapshot 9 --name after
### Page
- Page Title: Fast and reliable end-to-end testing for modern web apps | Playwright
$ npx playwright trace close
♻️ await using
Many APIs now return async disposables, enabling the await using syntax for automatic cleanup:
awaitusingpage=awaitcontext.newPage();{awaitusingroute=awaitpage.route('**/*',route=>route.continue());awaitusingscript=awaitpage.addInitScript('console.log("init script here")');awaitpage.goto('https://playwright.dev');// do something}// route and init script have been removed at this point
🔍 Snapshots and Locators
Method page.ariaSnapshot() to capture the aria snapshot of the page — equivalent to page.locator('body').ariaSnapshot().
Method locator.normalize() converts a locator to follow best practices like test ids and aria roles.
Method page.pickLocator() enters an interactive mode where hovering over elements highlights them and shows the corresponding locator. Click an element to get its Locator back. Use page.cancelPickLocator() to cancel.
New APIs
Screencast
page.screencast provides video recording, real-time frame streaming, and overlay management.
Method browserContext.setStorageState() clears existing cookies, local storage, and IndexedDB for all origins and sets a new storage state — no need to create a new context.
Option artifactsDir in browserType.launch() to configure the artifacts directory.
🛠️ Other improvements
UI Mode has an option to only show tests affected by source changes.
UI Mode and Trace Viewer have improved action filtering.
HTML Reporter shows the list of runs from the same worker.
HTML Reporter allows filtering test steps for quick search.
New trace mode 'retain-on-failure-and-retries' records a trace for each test run and retains all traces when an attempt fails — great for comparing a passing trace with a failing one from a flaky test.
Known Issues ⚠️⚠️
navigator.platform emulation can cause Ctrl or Meta dispatching errors (#40009). Pass PLAYWRIGHT_NO_UA_PLATFORM = '1' environment variable while we are issuing a patch release. Let us know in the issue how it affected you.
Breaking Changes ⚠️
Removed macOS 14 support for WebKit. We recommend upgrading your macOS version, or keeping an older Playwright version.
We are adding a new token-efficient CLI mode of operation to Playwright with the skills located at playwright-cli. This brings the long-awaited official SKILL-focused CLI mode to our story and makes it more coding agent-friendly.
It is the first snapshot with the essential command set (which is already larger than the original MCP!), but we expect it to grow rapidly. Unlike the token use, that one we expect to go down since snapshots are no longer forced into the LLM!
Timeline
If you're using merged reports, the HTML report Speedboard tab now shows the Timeline:
UI Mode and Trace Viewer Improvements
New 'system' theme option follows your OS dark/light mode preference
Search functionality (Cmd/Ctrl+F) is now available in code editors
Network details panel has been reorganized for better usability
JSON responses are now automatically formatted for readability
Thanks to @cpAdm for contributing these improvements!
Miscellaneous
browserType.connectOverCDP() now accepts an isLocal option. When set to true, it tells Playwright that it runs on the same host as the CDP server, enabling file system optimizations.
Breaking Changes ⚠️
Removed _react and _vue selectors. See locators guide for alternatives.
Removed :light selector engine suffix. Use standard CSS selectors instead.
Option devtools from browserType.launch() has been removed. Use args: ['--auto-open-devtools-for-tabs'] instead.
Removed macOS 13 support for WebKit. We recommend to upgrade your macOS version, or keep using an older Playwright version.
Browser Versions
Chromium 145.0.7632.6
Mozilla Firefox 146.0.1
WebKit 26.0
This version was also tested against the following stable channels:
In HTML reporter, there's a new tab we call "Speedboard":
It shows you all your executed tests sorted by slowness,
and can help you understand where your test suite is taking longer than expected.
Take a look at yours - maybe you'll find some tests that are spending a longer time waiting than they should!
Chrome for Testing
Starting with this release, Playwright switches from Chromium, to using Chrome for Testing builds. Both headed and headless browsers are subject to this. Your tests should still be passing after upgrading to Playwright 1.57.
We're expecting no functional changes to come from this switch. The biggest change is the new icon and title in your toolbar.
If you still see an unexpected behaviour change, please file an issue.
On Arm64 Linux, Playwright continues to use Chromium.
Waiting for webserver output
testConfig.webServer added a wait field. Pass a regular expression, and Playwright will wait until the webserver logs match it.
import{defineConfig}from'@​playwright/test';exportdefaultdefineConfig({webServer: {command: 'npm run start',wait: {stdout: '/Listening on port (?<my_server_port>\\d+)/'},},});
If you include a named capture group into the expression, then Playwright will provide the capture group contents via environment variables:
This is not just useful for capturing varying ports of dev servers. You can also use it to wait for readiness of a service that doesn't expose an HTTP readiness check, but instead prints a readiness message to stdout or stderr.
Breaking Change
After 3 years of being deprecated, we removed Page#accessibility from our API. Please use other libraries such as Axe if you need to test page accessibility. See our Node.js guide for integration with Axe.
worker.on('console') event is emitted when JavaScript within the worker calls one of console API methods, e.g. console.log or console.dir. worker.waitForEvent() can be used to wait for it.
New option steps in locator.click() and locator.dragTo() that configures the number of mousemove events emitted while moving the mouse pointer to the target element.
Network requests issued by Service Workers are now reported and can be routed through the BrowserContext, only in Chromium. You can opt out using the PLAYWRIGHT_DISABLE_SERVICE_WORKER_NETWORK environment variable.
Console messages from Service Workers are dispatched through worker.on('console'). You can opt out of this using the PLAYWRIGHT_DISABLE_SERVICE_WORKER_CONSOLE environment variable.
#37871 chore: allow local-network-access permission in chromium #37891 fix(agents): remove workspaceFolder ref from vscode mcp #37759 chore: rename agents to test agents #37757 chore(mcp): fallback to cwd when resolving test config
Introducing Playwright Agents, three custom agent definitions designed to guide LLMs through the core process of building a Playwright test:
🎭 planner explores the app and produces a Markdown test plan
🎭 generator transforms the Markdown plan into the Playwright Test files
🎭 healer executes the test suite and automatically repairs failing tests
Run npx playwright init-agents with your client of choice to generate the latest agent definitions:
# Generate agent files for each agentic loop# Visual Studio Code
npx playwright init-agents --loop=vscode
# Claude Code
npx playwright init-agents --loop=claude
# opencode
npx playwright init-agents --loop=opencode
[!NOTE]
VS Code v1.105 (currently on the VS Code Insiders channel) is needed for the agentic experience in VS Code. It will become stable shortly, we are a bit ahead of times with this functionality!
#37479 - [Bug]: Upgrade Chromium to 140.0.7339.186. #37147 - [Regression]: Internal error: step id not found. #37146 - [Regression]: HTML reporter displays a broken chip link when there are no projects. #37137 - Revert "fix(a11y): track inert elements as hidden". #37532 - chore: do not use -k option
Browser Versions
Chromium 140.0.7339.186
Mozilla Firefox 141.0
WebKit 26.0
This version was also tested against the following stable channels:
New Property testStepInfo.titlePath Returns the full title path starting from the test file, including test and step titles.
Codegen
Automatic toBeVisible() assertions: Codegen can now generate automatic toBeVisible() assertions for common UI interactions. This feature can be enabled in the Codegen settings UI.
Breaking Changes
⚠️ Dropped support for Chromium extension manifest v2.
Miscellaneous
Added support for Debian 13 "Trixie".
Browser Versions
Chromium 140.0.7339.16
Mozilla Firefox 141.0
WebKit 26.0
This version was also tested against the following stable channels:
#36714 - [Regression]: Codegen is not able to launch in Administrator Terminal on Windows (ProtocolError: Protocol error) #36828 - [Regression]: Playwright Codegen keeps spamming with selected option #36810 - [Regression]: Starting Codegen with target language doesn't work anymore
Browser Versions
Chromium 139.0.7258.5
Mozilla Firefox 140.0.2
WebKit 26.0
This version was also tested against the following stable channels:
New cookie property partitionKey in browserContext.cookies() and browserContext.addCookies(). This property allows to save and restore partitioned cookies. See CHIPS MDN article for more information. Note that browsers have different support and defaults for cookie partitioning.
New option noSnippets to disable code snippets in the html report.
New property location in test annotations, for example in testResult.annotations and testInfo.annotations. It shows where the annotation like test.skip or test.fixme was added.
Command Line
New option --user-data-dir in multiple commands. You can specify the same user data dir to reuse browsing state, like authentication, between sessions.
#36339 - [Regression]: Click can fail when scrolling required #36307 - [Regression (Chromium)]: Under some scenarios filling a textarea doesn't fill #36294 - [Regression (Firefox)]: setViewportSize times out #36350 - [Fix]: Display HTTP method for fetch trace entries
Browser Versions
Chromium 138.0.7204.23
Mozilla Firefox 139.0
WebKit 18.5
This version was also tested against the following stable channels:
awaitexpect(locator).toMatchAriaSnapshot(` - list - /children: equal - listitem: Feature A - listitem: - link "Feature B": - /url: "https://playwright.dev"`);
Test Runner
New property testProject.workers allows to specify the number of concurrent worker processes to use for a test project. The global limit of property testConfig.workers still applies.
New testConfig.failOnFlakyTests option to fail the test run if any flaky tests are detected, similarly to --fail-on-flaky-tests. This is useful for CI/CD environments where you want to ensure that all tests are stable before deploying.
HTML reporter now supports NOT filtering via !@​my-tag or !my-file.spec.ts or !p:my-project.
Breaking Changes
Changes to glob URL patterns in methods like page.route():
? wildcard is not supported any more, it will always match question mark ? character.
Ranges/sets [] are not supported anymore. We recommend using regular expressions instead.
Method route.continue() does not allow to override the Cookie header anymore. If a Cookie header is provided, it will be ignored, and the cookie will be loaded from the browser's cookie store. To set custom cookies, use browserContext.addCookies().
macOS 13 is now deprecated and will no longer receive WebKit updates. Please upgrade to a more recent macOS version to continue benefiting from the latest WebKit improvements.
Browser Versions
Chromium 136.0.7103.25
Mozilla Firefox 137.0
WebKit 18.4
This version was also tested against the following stable channels:
#35093 - [Regression]: TimeoutOverflowWarning: 2149630.634 does not fit into a 32-bit signed integer #35138 - [Regression]: TypeError: Cannot read properties of undefined (reading 'expectInfo')
Browser Versions
Chromium 134.0.6998.35
Mozilla Firefox 135.0
WebKit 18.4
This version was also tested against the following stable channels:
New option indexedDB for browserContext.storageState() allows to save and restore IndexedDB contents. Useful when your application uses IndexedDB API to store authentication tokens, like Firebase Authentication.
// tests/auth.setup.tsimport{testassetup,expect}from'@​playwright/test';importpathfrom'path';constauthFile=path.join(__dirname,'../playwright/.auth/user.json');setup('authenticate',async({ page })=>{awaitpage.goto('/');// ... perform authentication steps ...// make sure to save indexedDBawaitpage.context().storageState({path: authFile,indexedDB: true});});
Copy prompt
New "Copy prompt" button on errors in the HTML report, trace viewer and UI mode. Click to copy a pre-filled LLM prompt that contains the error message and useful context for fixing the error.
HTML report will show this information when available:
Test Step improvements
A new TestStepInfo object is now available in test steps. You can add step attachments or skip the step under some conditions.
test('some test',async({ page, isMobile })=>{// Note the new "step" argument:awaittest.step('here is my step',asyncstep=>{step.skip(isMobile,'not relevant on mobile layouts');// ...awaitstep.attach('my attachment',{body: 'some text'});// ...});});
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.41.2→1.61.1Release Notes
microsoft/playwright (playwright)
v1.61.1Compare Source
v1.61.0Compare Source
🔑 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: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:
New APIs
Network
Browser and Screencast
artifactsDirin browserType.connectOverCDP() controls where artifacts such as traces and downloads are stored when attached to an existing browser.cursorin screencast.showActions() controls the cursor decoration rendered for pointer actions.onFramecallback in screencast.start() now receives atimestampof when the frame was presented by the browser.Test runner
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.expect.soft.poll(...).process.argvfrom the runner process, handy for reading custom arguments passed after the--separator.AggregateErroras a separate entry.-Gcommand line shorthand for--grep-invert.🛠️ Other improvements
Browser Versions
This version was also tested against the following stable channels:
v1.60.0Compare Source
🌐 HAR recording on Tracing
tracing.startHar() / tracing.stopHar() expose HAR recording as a first-class tracing API, with the same
content,modeandurlFilteroptions asrecordHar. The returned Disposable makes it easy to scope a recording withawait using:🪝 Drop API
New locator.drop() simulates an external drag-and-drop of files or clipboard-like data onto an element. Playwright dispatches
dragenter,dragover, anddropwith a synthetic [DataTransfer] in the page context — works cross-browser and is great for testing upload zones:🎯 Aria snapshots
page.locator('body').boxesoption on locator.ariaSnapshot() / page.ariaSnapshot() appends each element's bounding box as[box=x,y,width,height], useful for AI consumption.🛑 test.abort()
New test.abort() aborts the currently running test from a fixture, hook, or route handler with an optional message. Use it when you have detected an unrecoverable misuse and want to fail the test right away:
New APIs
Browser, Context and Page
Locators and Assertions
descriptionin page.getByRole() / locator.getByRole() / frame.getByRole() / frameLocator.getByRole() for matching the accessible description.pseudoin expect(locator).toHaveCSS() reads computed styles from::beforeor::after.stylein locator.highlight() applies extra inline CSS to the highlight overlay, plus new page.hideHighlight() to clear all highlights.Network
noDefaultsin browserType.connectOverCDP() disables Playwright's default overrides on the default context (download behavior, focus emulation, media emulation), so attaching to a user's daily-driver browser doesn't disturb its state.Errors and Reporting
line/columnproperties (lineNumber/columnNumberare deprecated).expect(...)matcher failure.workerInfoargument with details about the worker for fixture teardown errors.Test runner
{testFileBaseName}token in testProject.snapshotPathTemplate — file name without extension.workers: 0or negative values.🛠️ Other improvements
npx playwright show-reportaccepts.zipfiles directly — no need to unzip first.repeatEachIndexis shown in the test header when non-zero.Breaking Changes⚠️
Locator.ariaRef()— use the standard locator.ariaSnapshot() pipeline.handleoption onBrowserContext.exposeBindingandPage.exposeBinding.loggeroption onBrowserType.connectandBrowserType.connectOverCDP— use tracing instead.videosPath/videoSize— userecordVideoinstead.Browser Versions
This version was also tested against the following stable channels:
v1.59.1Compare Source
Bug Fixes
codegen,--uiandshowcommands (#39990)v1.59.0Compare Source
🎬 Screencast
New page.screencast API provides a unified interface for capturing page content with:
Screencast recording — record video with precise start/stop control, as an alternative to the
recordVideooption:Action annotations — enable built-in visual annotations that highlight interacted elements and display action titles during recording:
screencast.showActions() accepts
position('top-left','top','top-right','bottom-left','bottom','bottom-right'),duration(ms per annotation), andfontSize(px). Returns a disposable to stop showing actions.Action annotations can also be enabled in test fixtures via the
videooption:Visual overlays — add chapter titles and custom HTML overlays on top of the page for richer narration:
Real-time frame capture — stream JPEG-encoded frames for custom processing like thumbnails, live previews, AI vision, and more:
Agentic video receipts — coding agents can produce video evidence of their work. After completing a task, an agent can record a walkthrough video with rich annotations for human review:
The resulting video serves as a receipt: chapter titles provide context, action annotations highlight each interaction, and the visual walkthrough is faster to review than text logs.
🔗 Interoperability
New browser.bind() API makes a launched browser available for
playwright-cli,@playwright/mcp, and other clients to connect to.Bind a browser — start a browser and bind it so others can connect:
Connect from playwright-cli — connect to the running browser from your favorite coding agent.
Connect from @playwright/mcp — or point your MCP server to the running browser.
Connect from a Playwright client — use API to connect to the browser. Multiple clients at a time are supported!
Pass
hostandportoptions to bind over WebSocket instead of a named pipe:Call browser.unbind() to stop accepting new connections.
📊 Observability
Run
playwright-cli showto open the Dashboard that lists all the bound browsers, their statuses, and allows interacting with them:🐛 CLI debugger for agents
Coding agents can now run
npx playwright test --debug=clito attach and debug tests overplaywright-cli— perfect for automatically fixing tests in agentic workflows:📋 CLI trace analysis for agents
Coding agents can run
npx playwright traceto explore Playwright Trace and understand failing or flaky tests from the command line:♻️
await usingMany APIs now return async disposables, enabling the
await usingsyntax for automatic cleanup:🔍 Snapshots and Locators
page.locator('body').ariaSnapshot().depthandmodein locator.ariaSnapshot().New APIs
Screencast
Storage, Console and Errors
filterin page.consoleMessages() and page.pageErrors() controls which messages are returned.Miscellaneous
livein tracing.start() for real-time trace updates.artifactsDirin browserType.launch() to configure the artifacts directory.🛠️ Other improvements
'retain-on-failure-and-retries'records a trace for each test run and retains all traces when an attempt fails — great for comparing a passing trace with a failing one from a flaky test.Known Issues⚠️ ⚠️
navigator.platformemulation can cause Ctrl or Meta dispatching errors (#40009). PassPLAYWRIGHT_NO_UA_PLATFORM = '1'environment variable while we are issuing a patch release. Let us know in the issue how it affected you.Breaking Changes⚠️
@playwright/experimental-ct-sveltepackage.junittest reporter now differentiates between types of errors, so some of the previous<failure>s are now reported as<error>s.Browser Versions
This version was also tested against the following stable channels:
v1.58.2Compare Source
Highlights
#39121 fix(trace viewer): make paths via stdin work
#39129 fix: do not force swiftshader on chromium mac
Browser Versions
v1.58.1Compare Source
Highlights
#39036 fix(msedge): fix local network permissions
#39037 chore: update cft download location
#38995 chore(webkit): disable frame sessions on fronzen builds
Browser Versions
v1.58.0Compare Source
📣 Playwright CLI+SKILLs 📣
We are adding a new token-efficient CLI mode of operation to Playwright with the skills located at playwright-cli. This brings the long-awaited official SKILL-focused CLI mode to our story and makes it more coding agent-friendly.
Timeline
If you're using merged reports, the HTML report Speedboard tab now shows the Timeline:
UI Mode and Trace Viewer Improvements
Thanks to @cpAdm for contributing these improvements!
Miscellaneous
browserType.connectOverCDP() now accepts an
isLocaloption. When set totrue, it tells Playwright that it runs on the same host as the CDP server, enabling file system optimizations.Breaking Changes⚠️
_reactand_vueselectors. See locators guide for alternatives.:lightselector engine suffix. Use standard CSS selectors instead.devtoolsfrom browserType.launch() has been removed. Useargs: ['--auto-open-devtools-for-tabs']instead.Browser Versions
This version was also tested against the following stable channels:
v1.57.0Compare Source
Speedboard
In HTML reporter, there's a new tab we call "Speedboard":
It shows you all your executed tests sorted by slowness,
and can help you understand where your test suite is taking longer than expected.
Take a look at yours - maybe you'll find some tests that are spending a longer time waiting than they should!
Chrome for Testing
Starting with this release, Playwright switches from Chromium, to using Chrome for Testing builds. Both headed and headless browsers are subject to this. Your tests should still be passing after upgrading to Playwright 1.57.
We're expecting no functional changes to come from this switch. The biggest change is the new icon and title in your toolbar.
If you still see an unexpected behaviour change, please file an issue.
On Arm64 Linux, Playwright continues to use Chromium.
Waiting for webserver output
testConfig.webServer added a
waitfield. Pass a regular expression, and Playwright will wait until the webserver logs match it.If you include a named capture group into the expression, then Playwright will provide the capture group contents via environment variables:
This is not just useful for capturing varying ports of dev servers. You can also use it to wait for readiness of a service that doesn't expose an HTTP readiness check, but instead prints a readiness message to stdout or stderr.
Breaking Change
After 3 years of being deprecated, we removed
Page#accessibilityfrom our API. Please use other libraries such as Axe if you need to test page accessibility. See our Node.js guide for integration with Axe.New APIs
Locator.toString()now uses the description when available.stepsin locator.click() and locator.dragTo() that configures the number ofmousemoveevents emitted while moving the mouse pointer to the target element.PLAYWRIGHT_DISABLE_SERVICE_WORKER_NETWORKenvironment variable.PLAYWRIGHT_DISABLE_SERVICE_WORKER_CONSOLEenvironment variable.Browser Versions
v1.56.1Compare Source
Highlights
#37871 chore: allow local-network-access permission in chromium
#37891 fix(agents): remove workspaceFolder ref from vscode mcp
#37759 chore: rename agents to test agents
#37757 chore(mcp): fallback to cwd when resolving test config
Browser Versions
v1.56.0Compare Source
Playwright Agents
Introducing Playwright Agents, three custom agent definitions designed to guide LLMs through the core process of building a Playwright test:
Run
npx playwright init-agentswith your client of choice to generate the latest agent definitions:Learn more about Playwright Agents
New APIs
--test-listand--test-list-invertto allow manual specification of specific tests from a fileUI Mode and HTML Reporter
'html'reporter to disable the "Copy prompt" button'html'reporter and UI Mode to merge files, collapsing test and describe blocks into a single unified list--update-snapshotsoptionsBreaking Changes
Miscellaneous
inputplaceholderPLAYWRIGHT_TESTto Playwright worker processes to allow discriminating on testing statusBrowser Versions
v1.55.1Compare Source
Highlights
#37479 - [Bug]: Upgrade Chromium to 140.0.7339.186.
#37147 - [Regression]: Internal error: step id not found.
#37146 - [Regression]: HTML reporter displays a broken chip link when there are no projects.
#37137 - Revert "fix(a11y): track inert elements as hidden".
#37532 - chore: do not use -k option
Browser Versions
This version was also tested against the following stable channels:
v1.55.0Compare Source
New APIs
Codegen
toBeVisible()assertions: Codegen can now generate automatictoBeVisible()assertions for common UI interactions. This feature can be enabled in the Codegen settings UI.Breaking Changes
Miscellaneous
Browser Versions
This version was also tested against the following stable channels:
v1.54.2Compare Source
Highlights
#36714 - [Regression]: Codegen is not able to launch in Administrator Terminal on Windows (ProtocolError: Protocol error)
#36828 - [Regression]: Playwright Codegen keeps spamming with selected option
#36810 - [Regression]: Starting Codegen with target language doesn't work anymore
Browser Versions
This version was also tested against the following stable channels:
v1.54.1Compare Source
Highlights
#36650 - [Regression]: 1.54.0 breaks downloading browsers when an HTTP(S) proxy is used
Browser Versions
This version was also tested against the following stable channels:
v1.54.0Compare Source
Highlights
New cookie property
partitionKeyin browserContext.cookies() and browserContext.addCookies(). This property allows to save and restore partitioned cookies. See CHIPS MDN article for more information. Note that browsers have different support and defaults for cookie partitioning.New option
noSnippetsto disable code snippets in the html report.New property
locationin test annotations, for example in testResult.annotations and testInfo.annotations. It shows where the annotation liketest.skiportest.fixmewas added.Command Line
New option
--user-data-dirin multiple commands. You can specify the same user data dir to reuse browsing state, like authentication, between sessions.Option
-gvhas been removed from thenpx playwright testcommand. Use--grep-invertinstead.npx playwright opendoes not open the test recorder anymore. Usenpx playwright codegeninstead.Miscellaneous
Browser Versions
This version was also tested against the following stable channels:
v1.53.2Compare Source
Highlights
#36317 - [Regression]: Merging pre-1.53 blob reports loses attachments
#36357 - [Regression (Chromium)]: CDP missing trailing slash
#36292 - [Bug (MSEdge)]: Edge fails to launch when using
msRelaunchNoCompatLayerBrowser Versions
This version was also tested against the following stable channels:
v1.53.1Compare Source
Highlights
#36339 - [Regression]: Click can fail when scrolling required
#36307 - [Regression (Chromium)]: Under some scenarios filling a
textareadoesn't fill#36294 - [Regression (Firefox)]:
setViewportSizetimes out#36350 - [Fix]: Display HTTP method for fetch trace entries
Browser Versions
This version was also tested against the following stable channels:
v1.53.0Compare Source
Trace Viewer and HTML Reporter Updates
New Steps in Trace Viewer and HTML reporter:
New option in
'html'reporter to set the title of a specific test run:Miscellaneous
New option
kindin testInfo.snapshotPath() controls which snapshot path template is used.New method locator.describe() to describe a locator. Used for trace viewer and reports.
npx playwright install --listwill now list all installed browsers, versions and locations.Browser Versions
This version was also tested against the following stable channels:
v1.52.0Compare Source
Highlights
New method expect(locator).toContainClass() to ergonomically assert individual class names on the element.
Aria Snapshots got two new properties:
/childrenfor strict matching and/urlfor links.Test Runner
--fail-on-flaky-tests. This is useful for CI/CD environments where you want to ensure that all tests are stable before deploying.Miscellaneous
maxRedirectsin apiRequest.newContext() to control the maximum number of redirects.!@​my-tagor!my-file.spec.tsor!p:my-project.Breaking Changes
?wildcard is not supported any more, it will always match question mark?character.[]are not supported anymore. We recommend using regular expressions instead.Cookieheader anymore. If aCookieheader is provided, it will be ignored, and the cookie will be loaded from the browser's cookie store. To set custom cookies, use browserContext.addCookies().Browser Versions
This version was also tested against the following stable channels:
v1.51.1Compare Source
Highlights
#35093 - [Regression]: TimeoutOverflowWarning:
2149630.634 does not fit into a 32-bit signed integer#35138 - [Regression]: TypeError: Cannot read properties of undefined (reading 'expectInfo')
Browser Versions
This version was also tested against the following stable channels:
v1.51.0Compare Source
StorageState for indexedDB
New option
indexedDBfor browserContext.storageState() allows to save and restore IndexedDB contents. Useful when your application uses IndexedDB API to store authentication tokens, like Firebase Authentication.Here is an example following the authentication guide:
Copy prompt
New "Copy prompt" button on errors in the HTML report, trace viewer and UI mode. Click to copy a pre-filled LLM prompt that contains the error message and useful context for fixing the error.
Filter visible elements
New option
visiblefor locator.filter() allows matching only visible elements.Git information in HTML report
Set option testConfig.captureGitInfo to capture git information into testConfig.metadata.
HTML report will show this information when available:
Test Step improvements
A new TestStepInfo object is now available in test steps. You can add step attachments or skip the step under some conditions.
Miscellaneous
contrastfor methods page.emulateMedia() and browser.newContext() allows to emulate theprefers-contrastmedia feature.failOnStatusCodemakes all fetch requests made through the APIRequestContext throw on response codes other than 2xx and 3xx.Browser Versions
This version was also tested against the following stable channels:
v1.50.1Compare Source
Highlights
#34483 - [Feature]: single aria snapshot for different engines/browsers
#34497 - [Bug]: Firefox not handling keepalive: true fetch requests
#34504 - [Bug]: update snapshots not creating good diffs
#34507 - [Bug]: snapshotPathTemplate doesnt work when multiple projects
#34462 - [Bug]: updateSnapshots "change
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.