Skip to content

Conversation

@pyup-bot
Copy link
Collaborator

This PR pins playwright to the latest release 1.58.0.

Changelog

1.58.0

📣 Playwright CLI+SKILLs 📣 

We are adding a new token-efficient CLI mode of operation to Playwright with the skills located at [playwright-cli](https://github.com/microsoft/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](https://playwright.dev/docs/test-sharding#merging-reports-from-multiple-environments), the HTML report Speedboard tab now shows the Timeline:

![Timeline chart in the HTML report](https://github.com/microsoft/playwright/blob/main/docs/src/images/timeline.png?raw=true)

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](https://github.com/cpAdm) for contributing these improvements!

Miscellaneous

[browserType.connectOverCDP()](https://playwright.dev/docs/api/class-browsertype#browser-type-connect-over-cdp) 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](https://playwright.dev/docs/locators) for alternatives.
- Removed `:light` selector engine suffix. Use standard CSS selectors instead.
- Option `devtools` from [browserType.launch()](https://playwright.dev/docs/api/class-browsertype#browser-type-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:
- Google Chrome 144
- Microsoft Edge 144

1.57.0

Speedboard

In HTML reporter, there's a new tab we call "Speedboard":

<img width="600" alt="speedboard" src="https://github.com/user-attachments/assets/4ba117ea-ea94-4b6a-82b2-8bbd00dfe81c" />

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](https://developer.chrome.com/blog/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.

<img width="500" alt="new and old logo" src="https://github.com/user-attachments/assets/e9a5c4f2-9f35-4c27-9382-0f5eda377097" />

If you still see an unexpected behaviour change, please [file an issue](https://github.com/microsoft/playwright/issues/new).

On Arm64 Linux, Playwright continues to use Chromium.

Waiting for webserver output

[testConfig.webServer](https://playwright.dev/docs/api/class-testconfig#test-config-web-server) added a `wait` field. Pass a regular expression, and Playwright will wait until the webserver logs match it.

js
import { defineConfig } from 'playwright/test';

export default defineConfig({
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:

js
import { test, expect } from 'playwright/test';

test.use({ baseUrl: `http://localhost:${process.env.MY_SERVER_PORT ?? 3000}` });

test('homepage', async ({ page }) => {
await page.goto('/');
});


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 `Pageaccessibility` from our API. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for integration with Axe.

New APIs
- New property [testConfig.tag](https://playwright.dev/docs/api/class-testconfig#test-config-tag) adds a tag to all tests in this run. This is useful when using [merge-reports](https://playwright.dev/docs/test-sharding#merging-reports-from-multiple-shards).
- [worker.on('console')](https://playwright.dev/docs/api/class-worker#worker-event-console) event is emitted when JavaScript within the worker calls one of console API methods, e.g. console.log or console.dir. [worker.waitForEvent()](https://playwright.dev/docs/api/class-worker#worker-wait-for-event) can be used to wait for it.
- [locator.description()](https://playwright.dev/docs/api/class-locator#locator-description) returns locator description previously set with [locator.describe()](https://playwright.dev/docs/api/class-locator#locator-describe), and `Locator.toString()` now uses the description when available.
- New option [`steps`](https://playwright.dev/docs/api/class-locator#locator-click-option-steps) in [locator.click()](https://playwright.dev/docs/api/class-locator#locator-click) and [locator.dragTo()](https://playwright.dev/docs/api/class-locator#locator-drag-to) that configures the number of `mousemove` events emitted while moving the mouse pointer to the target element.
- Network requests issued by [Service Workers](https://playwright.dev/docs/service-workers#network-events-and-routing) are now reported and can be routed through the [BrowserContext](https://playwright.dev/docs/api/class-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')](https://playwright.dev/docs/api/class-worker#worker-event-console). You can opt out of this using the `PLAYWRIGHT_DISABLE_SERVICE_WORKER_CONSOLE` environment variable.

Browser Versions
- Chromium 143.0.7499.4
- Mozilla Firefox 144.0.2
- WebKit 26.0

1.56.1

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
- Chromium 141.0.7390.37
- Mozilla Firefox 142.0.1
- WebKit 26.0

1.56.0

Playwright Agents

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:

bash
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!


[Learn more about Playwright Agents](https://playwright.dev/docs/test-agents)

New APIs
- New methods [page.consoleMessages()](https://playwright.dev/docs/api/class-page#page-console-messages) and [page.pageErrors()](https://playwright.dev/docs/api/class-page#page-page-errors) for retrieving the most recent console messages from the page
- New method [page.requests()](https://playwright.dev/docs/api/class-page#page-requests) for retrieving the most recent network requests from the page
- Added [`--test-list` and `--test-list-invert`](https://playwright.dev/docs/test-cli#test-list) to allow manual specification of specific tests from a file

UI Mode and HTML Reporter
- Added option to `'html'` reporter to disable the "Copy prompt" button
- Added option to `'html'` reporter and UI Mode to merge files, collapsing test and describe blocks into a single unified list
- Added option to UI Mode mirroring the `--update-snapshots` options
- Added option to UI Mode to run only a single worker at a time

Breaking Changes
- Event [browserContext.on('backgroundpage')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-background-page) has been deprecated and will not be emitted. Method [browserContext.backgroundPages()](https://playwright.dev/docs/api/class-browsercontext#browser-context-background-pages) will return an empty list

Miscellaneous
- Aria snapshots render and compare `input` `placeholder`
- Added environment variable `PLAYWRIGHT_TEST` to Playwright worker processes to allow discriminating on testing status

Browser Versions
- Chromium 141.0.7390.37
- Mozilla Firefox 142.0.1
- WebKit 26.0

1.55.1

Highlights

https://github.com/microsoft/playwright/issues/37479 - [Bug]: Upgrade Chromium to 140.0.7339.186.
https://github.com/microsoft/playwright/issues/37147 - [Regression]: Internal error: step id not found.
https://github.com/microsoft/playwright/issues/37146 - [Regression]: HTML reporter displays a broken chip link when there are no projects.
https://github.com/microsoft/playwright/pull/37137 - Revert "fix(a11y): track inert elements as hidden".
https://github.com/microsoft/playwright/pull/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:
- Google Chrome 139
- Microsoft Edge 139

1.55.0

New APIs
- New Property [testStepInfo.titlePath](https://playwright.dev/docs/api/class-teststepinfo#test-step-info-title-path) 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:
- Google Chrome 139
- Microsoft Edge 139

1.54.2

Highlights

https://github.com/microsoft/playwright/issues/36714 - [Regression]: Codegen is not able to launch in Administrator Terminal on Windows (ProtocolError: Protocol error)
https://github.com/microsoft/playwright/issues/36828 - [Regression]: Playwright Codegen keeps spamming with selected option
https://github.com/microsoft/playwright/issues/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:
- Google Chrome 140
- Microsoft Edge 140

1.54.1

Highlights

https://github.com/microsoft/playwright/issues/36650 - [Regression]: 1.54.0 breaks downloading browsers when an HTTP(S) proxy is used

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:
- Google Chrome 140
- Microsoft Edge 140

1.54.0

Highlights
- New cookie property `partitionKey` in [browserContext.cookies()](https://playwright.dev/docs/api/class-browsercontext#browser-context-cookies) and [browserContext.addCookies()](https://playwright.dev/docs/api/class-browsercontext#browser-context-add-cookies). This property allows to save and restore partitioned cookies. See [CHIPS MDN article](https://developer.mozilla.org/en-US/docs/Web/Privacy/Guides/Privacy_sandbox/Partitioned_cookies) 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.

js
import { defineConfig } from 'playwright/test';

export default defineConfig({
 reporter: [['html', { noSnippets: true }]]
});


- New property `location` in test annotations, for example in [testResult.annotations](https://playwright.dev/docs/api/class-testresult#test-result-annotations) and [testInfo.annotations](https://playwright.dev/docs/api/class-testinfo#test-info-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.

bash
npx playwright codegen --user-data-dir=./user-data


- Option `-gv` has been removed from the `npx playwright test` command. Use `--grep-invert` instead.
- `npx playwright open` does not open the test recorder anymore. Use `npx playwright codegen` instead.

Miscellaneous
- Support for Node.js 16 has been removed.
- Support for Node.js 18 has been deprecated, and will be removed in the future.

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:
- Google Chrome 140
- Microsoft Edge 140

1.53.2

Highlights

https://github.com/microsoft/playwright/issues/36317 - [Regression]: Merging pre-1.53 blob reports loses attachments
https://github.com/microsoft/playwright/pull/36357 - [Regression (Chromium)]: CDP missing trailing slash
https://github.com/microsoft/playwright/issues/36292 - [Bug (MSEdge)]: Edge fails to launch when using `msRelaunchNoCompatLayer`

Browser Versions

- Chromium 138.0.7204.23
- Mozilla Firefox 139.0
- WebKit 18.5

This version was also tested against the following stable channels:
- Google Chrome 137
- Microsoft Edge 137

1.53.1

Highlights

https://github.com/microsoft/playwright/issues/36339 - [Regression]: Click can fail when scrolling required
https://github.com/microsoft/playwright/issues/36307 - [Regression (Chromium)]: Under some scenarios filling a `textarea` doesn't fill
https://github.com/microsoft/playwright/issues/36294 - [Regression (Firefox)]: `setViewportSize` times out
https://github.com/microsoft/playwright/pull/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:
- Google Chrome 137
- Microsoft Edge 137

1.53.0

Trace Viewer and HTML Reporter Updates

- New Steps in Trace Viewer and HTML reporter: 
<img src="https://github.com/user-attachments/assets/1963ff7d-4070-41be-a79b-4333176921a2" alt="New Trace Viewer Steps"  height="500">
- New option in `'html'` reporter to set the title of a specific test run:

js
import { defineConfig } from 'playwright/test';

export default defineConfig({
 reporter: [['html', { title: 'Custom test run 1028' }]]
});


Miscellaneous
- New option [`kind`](https://playwright.dev/docs/api/class-testinfo#test-info-snapshot-path-option-kind) in [testInfo.snapshotPath()](https://playwright.dev/docs/api/class-testinfo#test-info-snapshot-path) controls which snapshot path template is used.
- New method [locator.describe()](https://playwright.dev/docs/api/class-locator#locator-describe) to describe a locator. Used for trace viewer and reports.

js
const button = page.getByTestId('btn-sub').describe('Subscribe button');
await button.click();


- `npx playwright install --list` will now list all installed browsers, versions and locations.

Browser Versions
- Chromium 138.0.7204.4
- Mozilla Firefox 139.0
- WebKit 18.5

This version was also tested against the following stable channels:
- Google Chrome 137
- Microsoft Edge 137

1.52.0

Highlights
- New method [expect(locator).toContainClass()](https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-contain-class) to ergonomically assert individual class names on the element.

ts
await expect(page.getByRole('listitem', { name: 'Ship v1.52' })).toContainClass('done');


- [Aria Snapshots](https://playwright.dev/docs/aria-snapshots) got two new properties: [`/children`](https://playwright.dev/docs/aria-snapshots#strict-matching) for strict matching and `/url` for links.

ts
await expect(locator).toMatchAriaSnapshot(`
 - list
   - /children: equal
   - listitem: Feature A
   - listitem:
     - link "Feature B":
       - /url: "https://playwright.dev"
`);


Test Runner
- New property [testProject.workers](https://playwright.dev/docs/api/class-testproject#test-project-workers) allows to specify the number of concurrent worker processes to use for a test project. The global limit of property [testConfig.workers](https://playwright.dev/docs/api/class-testconfig#test-config-workers) still applies.
- New [testConfig.failOnFlakyTests](https://playwright.dev/docs/api/class-testconfig#test-config-fail-on-flaky-tests) 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.
- New property [testResult.annotations](https://playwright.dev/docs/api/class-testresult#test-result-annotations) contains annotations for each test retry.

Miscellaneous
- New option [`maxRedirects`](https://playwright.dev/docs/api/class-apirequest#api-request-new-context-option-max-redirects) in [apiRequest.newContext()](https://playwright.dev/docs/api/class-apirequest#api-request-new-context) to control the maximum number of redirects.
- 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()](https://playwright.dev/docs/api/class-page#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()](https://playwright.dev/docs/api/class-route#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()](https://playwright.dev/docs/api/class-browsercontext#browser-context-add-cookies).
- 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:
- Google Chrome 135
- Microsoft Edge 135

1.51.1

Highlights

https://github.com/microsoft/playwright/issues/35093 - [Regression]: TimeoutOverflowWarning: 2149630296.634 does not fit into a 32-bit signed integer
https://github.com/microsoft/playwright/issues/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:

* Google Chrome 133
* Microsoft Edge 133

1.51.0

StorageState for indexedDB
* New option [`indexedDB`](https://playwright.dev/docs/api/class-browsercontext#browser-context-storage-state-option-indexed-db) for [browserContext.storageState()](https://playwright.dev/docs/api/class-browsercontext#browser-context-storage-state) allows to save and restore IndexedDB contents. Useful when your application uses [IndexedDB API](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API) to store authentication tokens, like Firebase Authentication.

Here is an example following the [authentication guide](https://playwright.dev/docs/auth#basic-shared-account-in-all-tests):

js
// tests/auth.setup.ts
import { test as setup, expect } from 'playwright/test';
import path from 'path';

const authFile = path.join(__dirname, '../playwright/.auth/user.json');

setup('authenticate', async ({ page }) => {
 await page.goto('/');
 // ... perform authentication steps ...

 // make sure to save indexedDB
 await page.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.

![Copy prompt](https://github.com/user-attachments/assets/f3654407-dd6d-4240-9845-0d96df2bf30a)

Filter visible elements

New option [`visible`](https://playwright.dev/docs/api/class-locator#locator-filter-option-visible) for [locator.filter()](https://playwright.dev/docs/api/class-locator#locator-filter) allows matching only visible elements.

js
// example.spec.ts
test('some test', async ({ page }) => {
// Ignore invisible todo items.
const todoItems = page.getByTestId('todo-item').filter({ visible: true });
// Check there are exactly 3 visible ones.
await expect(todoItems).toHaveCount(3);
});


Git information in HTML report

Set option [testConfig.captureGitInfo](https://playwright.dev/docs/api/class-testconfig#test-config-capture-git-info) to capture git information into [testConfig.metadata](https://playwright.dev/docs/api/class-testconfig#test-config-metadata).

js
// playwright.config.ts
import { defineConfig } from 'playwright/test';

export default defineConfig({
captureGitInfo: { commit: true, diff: true }
});


HTML report will show this information when available:

![Git information in the report](https://github.com/user-attachments/assets/f5b3f6f4-aa08-4a24-816c-7edf33ef0c37)

Test Step improvements

A new [TestStepInfo](https://playwright.dev/docs/api/class-teststepinfo) object is now available in test steps. You can add step attachments or skip the step under some conditions.

js
test('some test', async ({ page, isMobile }) => {
// Note the new "step" argument:
await test.step('here is my step', async step => {
 step.skip(isMobile, 'not relevant on mobile layouts');

 // ...
 await step.attach('my attachment', { body: 'some text' });
 // ...
});
});


Miscellaneous
* New option `contrast` for methods [page.emulateMedia()](https://playwright.dev/docs/api/class-page#page-emulate-media) and [browser.newContext()](https://playwright.dev/docs/api/class-browser#browser-new-context) allows to emulate the `prefers-contrast` media feature.
* New option [`failOnStatusCode`](https://playwright.dev/docs/api/class-apirequest#api-request-new-context-option-fail-on-status-code) makes all fetch requests made through the [APIRequestContext](https://playwright.dev/docs/api/class-apirequestcontext) throw on response codes other than 2xx and 3xx.
* Assertion [expect(page).toHaveURL()](https://playwright.dev/docs/api/class-pageassertions#page-assertions-to-have-url) now supports a predicate.

Browser Versions
* Chromium 134.0.6998.35
* Mozilla Firefox 135.0
* WebKit 18.4

This version was also tested against the following stable channels:
* Google Chrome 133
* Microsoft Edge 133

1.50.1

Highlights

https://github.com/microsoft/playwright/issues/34483 - [Feature]: single aria snapshot for different engines/browsers
https://github.com/microsoft/playwright/issues/34497 - [Bug]: Firefox not handling keepalive: true fetch requests
https://github.com/microsoft/playwright/issues/34504 - [Bug]: update snapshots not creating good diffs
https://github.com/microsoft/playwright/issues/34507 - [Bug]: snapshotPathTemplate doesnt work when multiple projects
https://github.com/microsoft/playwright/issues/34462 - [Bug]: updateSnapshots "changed" throws an error

Browser Versions

* Chromium 133.0.6943.16
* Mozilla Firefox 134.0
* WebKit 18.2

This version was also tested against the following stable channels:
* Google Chrome 132
* Microsoft Edge 132

1.50.0

Test runner
* New option [`timeout`](https://playwright.dev/docs/api/class-test#test-step-option-timeout) allows specifying a maximum run time for an individual test step. A timed-out step will fail the execution of the test.

js
test('some test', async ({ page }) => {
 await test.step('a step', async () => {
   // This step can time out separately from the test
 }, { timeout: 1000 });
});


* New method [test.step.skip()](https://playwright.dev/docs/api/class-test#test-step-skip) to disable execution of a test step.

js
test('some test', async ({ page }) => {
 await test.step('before running step', async () => {
   // Normal step
 });

 await test.step.skip('not yet ready', async () => {
   // This step is skipped
 });

 await test.step('after running step', async () => {
   // This step still runs even though the previous one was skipped
 });
});


* Expanded [expect(locator).toMatchAriaSnapshot()](https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-match-aria-snapshot-2) to allow storing of aria snapshots in separate YAML files.
* Added method [expect(locator).toHaveAccessibleErrorMessage()](https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-have-accessible-error-message) to assert the Locator points to an element with a given [aria errormessage](https://w3c.github.io/aria/#aria-errormessage).
* Option [testConfig.updateSnapshots](https://playwright.dev/docs/api/class-testconfig#test-config-update-snapshots) added the configuration enum `changed`. `changed` updates only the snapshots that have changed, whereas `all` now updates all snapshots, regardless of whether there are any differences.
* New option [testConfig.updateSourceMethod](https://playwright.dev/docs/api/class-testconfig#test-config-update-source-method) defines the way source code is updated when [testConfig.updateSnapshots](https://playwright.dev/docs/api/class-testconfig#test-config-update-snapshots) is configured. Added `overwrite` and `3-way` modes that write the changes into source code, on top of existing `patch` mode that creates a patch file.

bash
npx playwright test --update-snapshots=changed --update-source-method=3way


* Option [testConfig.webServer](https://playwright.dev/docs/api/class-testconfig#test-config-web-server) added a `gracefulShutdown` field for specifying a process kill signal other than the default `SIGKILL`.
* Exposed [testStep.attachments](https://playwright.dev/docs/api/class-teststep#test-step-attachments) from the reporter API to allow retrieval of all attachments created by that step.
* New option `pathTemplate` for `toHaveScreenshot` and `toMatchAriaSnapshot` assertions in the [testConfig.expect](https://playwright.dev/docs/api/class-testconfig#test-config-expect) configuration.

UI updates
* Updated default HTML reporter to improve display of attachments.
* New button for picking elements to produce aria snapshots.
* Additional details (such as keys pressed) are now displayed alongside action API calls in traces.
* Display of `canvas` content in traces is error-prone. Display is now disabled by default, and can be enabled via the `Display canvas content` UI setting.
* `Call` and `Network` panels now display additional time information.

Breaking
* [expect(locator).toBeEditable()](https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-be-editable) and [locator.isEditable()](https://playwright.dev/docs/api/class-locator#locator-is-editable) now throw if the target element is not `<input>`, `<select>`, or a number of other editable elements.
* Option [testConfig.updateSnapshots](https://playwright.dev/docs/api/class-testconfig#test-config-update-snapshots) now updates all snapshots when set to `all`, rather than only the failed/changed snapshots. Use the new enum `changed` to keep the old functionality of only updating the changed snapshots.

Browser Versions
* Chromium 133.0.6943.16
* Mozilla Firefox 134.0
* WebKit 18.2

This version was also tested against the following stable channels:
* Google Chrome 132
* Microsoft Edge 132

1.49.1

Highlights

https://github.com/microsoft/playwright/issues/33802 - [Bug]: Codegen's Clear button doesn't work if not recording
https://github.com/microsoft/playwright/issues/33806 - [Bug]: playwright hangs while waiting for pending navigations
https://github.com/microsoft/playwright/issues/33787 - [Bug]: VSC extension isn't capturing all entered text
https://github.com/microsoft/playwright/issues/33788 - [Regression]: Double clicking the steps in trace viewer doesn't filter actions
https://github.com/microsoft/playwright/issues/33772 - [Bug]: aria_snapshot generates invalid yaml when combined with an aria-label attribut
https://github.com/microsoft/playwright/issues/33791 - [Bug]: text input with number value raises "container is not iterable" with to_match_aria_snapshot
https://github.com/microsoft/playwright/issues/33644 - [Bug]: getByRole can't find element with the accessible name from label element when aria-labelledby is not valid
https://github.com/microsoft/playwright/issues/33660 - [Regression]: Unable to open Playwright UI in Dark Mode


Browser Versions
- Chromium 131.0.6778.33
- Mozilla Firefox 132.0
- WebKit 18.2

This version was also tested against the following stable channels:
- Google Chrome 130
- Microsoft Edge 130

1.49.0

Aria snapshots

New assertion [expect(locator).toMatchAriaSnapshot()](https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-match-aria-snapshot) verifies page structure by comparing to an expected accessibility tree, represented as YAML.

js
await page.goto('https://playwright.dev');
await expect(page.locator('body')).toMatchAriaSnapshot(`
- banner:
 - heading /Playwright enables reliable/ [level=1]
 - link "Get started"
 - link "Star microsoft/playwright on GitHub"
- main:
 - img "Browsers (Chromium, Firefox, WebKit)"
 - heading "Any browser • Any platform • One API"
`);


You can generate this assertion with [Test Generator](https://playwright.dev/docs/codegen) and update the expected snapshot with `--update-snapshots` command line flag.

Learn more in the [aria snapshots guide](https://playwright.dev/docs/aria-snapshots).

Test runner
- New option [testConfig.tsconfig](https://playwright.dev/docs/api/class-testconfig#test-config-tsconfig) allows to specify a single `tsconfig` to be used for all tests.
- New method [test.fail.only()](https://playwright.dev/docs/api/class-test#test-fail-only) to focus on a failing test.
- Options [testConfig.globalSetup](https://playwright.dev/docs/api/class-testconfig#test-config-global-setup) and [testConfig.globalTeardown](https://playwright.dev/docs/api/class-testconfig#test-config-global-teardown) now support multiple setups/teardowns.
- New value `'on-first-failure'` for [testOptions.screenshot](https://playwright.dev/docs/api/class-testoptions#test-options-screenshot).
- Added "previous" and "next" buttons to the HTML report to quickly switch between test cases.
- New properties [testInfoError.cause](https://playwright.dev/docs/api/class-testinfoerror#test-info-error-cause) and [testError.cause](https://playwright.dev/docs/api/class-testerror#test-error-cause) mirroring [`Error.cause`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause).

Breaking: channels `chrome`, `msedge` and similar switch to new headless

This change affects you if you're using one of the following channels in your `playwright.config.ts`:
- `chrome`, `chrome-dev`, `chrome-beta`, or `chrome-canary`
- `msedge`, `msedge-dev`, `msedge-beta`, or `msedge-canary`

What do I need to do?

After updating to Playwright v1.49, run your test suite. If it still passes, you're good to go. If not, you will probably need to update your snapshots, and adapt some of your test code around PDF viewers and extensions. See [issue 33566](https://github.com/microsoft/playwright/issues/33566) for more details.

Other breaking changes
- There will be no more updates for WebKit on Ubuntu 20.04 and Debian 11. We recommend updating your OS to a later version.
- Package `playwright/experimental-ct-vue2` will no longer be updated.
- Package `playwright/experimental-ct-solid` will no longer be updated.

Try new Chromium headless

You can opt into the new headless mode by using `'chromium'` channel. As [official Chrome documentation puts it](https://developer.chrome.com/blog/chrome-headless-shell):

> New Headless on the other hand is the real Chrome browser, and is thus more authentic, reliable, and offers more features. This makes it more suitable for high-accuracy end-to-end web app testing or browser extension testing.

See [issue 33566](https://github.com/microsoft/playwright/issues/33566) for the list of possible breakages you could encounter and more details on Chromium headless. Please file an issue if you see any problems after opting in.

js
import { defineConfig, devices } from 'playwright/test';

export default defineConfig({
projects: [
 {
   name: 'chromium',
   use: { ...devices['Desktop Chrome'], channel: 'chromium' },
 },
],
});


Miscellaneous
- `<canvas>` elements inside a snapshot now draw a preview.
- New method [tracing.group()](https://playwright.dev/docs/api/class-tracing#tracing-group) to visually group actions in the trace.
- Playwright docker images switched from Node.js v20 to Node.js v22 LTS.

Browser Versions
- Chromium 131.0.6778.33
- Mozilla Firefox 132.0
- WebKit 18.2

This version was also tested against the following stable channels:
- Google Chrome 130
- Microsoft Edge 130

1.48.2

Highlights

https://github.com/microsoft/playwright/issues/33141 - [Bug]: UI Mode crashed
https://github.com/microsoft/playwright/issues/33219 - [BUG] Trace Viewer PWA crashes with "Aw, Snap!"
https://github.com/microsoft/playwright/issues/33086 - [Bug]: UI Mode Memory problem
https://github.com/microsoft/playwright/issues/33000 - [Regression]: Inspector and Browser doesn't close on CTRL+C
https://github.com/microsoft/playwright/issues/33204 - [Bug]: Chrome tab and inspector not closing after terminating session in terminal

Browser Versions
- Chromium 130.0.6723.19
- Mozilla Firefox 130.0
- WebKit 18.0

This version was also tested against the following stable channels:
- Google Chrome 129
- Microsoft Edge 129

1.48.1

Highlights

https://github.com/microsoft/playwright/issues/33023 - [Bug]: command line flag --headed has no effect in ui mode

1.48.0

WebSocket routing

New methods [page.routeWebSocket()](https://playwright.dev/docs/api/class-page#page-route-web-socket) and [browserContext.routeWebSocket()](https://playwright.dev/docs/api/class-browsercontext#browser-context-route-web-socket) allow to intercept, modify and mock WebSocket connections initiated in the page. Below is a simple example that mocks WebSocket communication by responding to a `"request"` with a `"response"`.

js
await page.routeWebSocket('/ws', ws => {
ws.onMessage(message => {
 if (message === 'request')
   ws.send('response');
});
});


See [WebSocketRoute](https://playwright.dev/docs/api/class-websocketroute) for more details.

UI updates
- New "copy" buttons for annotations and test location in the HTML report.
- Route method calls like [route.fulfill()](https://playwright.dev/docs/api/class-route#route-fulfill) are not shown in the report and trace viewer anymore. You can see which network requests were routed in the network tab instead.
- New "Copy as cURL" and "Copy as fetch" buttons for requests in the network tab.

Miscellaneous
- Option [`form`](https://playwright.dev/docs/api/class-apirequestcontext#api-request-context-fetch-option-form) and similar ones now accept [FormData](https://playwright.dev/docs/api/class-formdata).
- New method [page.requestGC()](https://playwright.dev/docs/api/class-page#page-request-gc) may help detect memory leaks.
- New option [`location`](https://playwright.dev/docs/api/class-test#test-step-option-location) to pass custom step location.
- Requests made by [APIRequestContext](https://playwright.dev/docs/api/class-apirequestcontext) now record detailed timing and security information in the HAR.

Browser Versions
- Chromium 130.0.6723.19
- Mozilla Firefox 130.0
- WebKit 18.0

This version was also tested against the following stable channels:
- Google Chrome 129
- Microsoft Edge 129

1.47.2

Highlights

https://github.com/microsoft/playwright/pull/32699- [REGRESSION]: fix(codegen): use content_frame property in python/.NET

1.47.1

Highlights

1.47

https://github.com/microsoft/playwright/issues/32552 - [REGRESSION]: broken UI in Trace Viewer while showing network response body

Browser Versions
- Chromium 129.0.6668.29
- Mozilla Firefox 130.0
- WebKit 18.0

This version was also tested against the following stable channels:
- Google Chrome 128
- Microsoft Edge 128

1.47.0

Network Tab improvements

The Network tab in the UI mode and trace viewer has several nice improvements:

- filtering by asset type and URL
- better display of query string parameters
- preview of font assets

![Network tab now has filters](https://github.com/user-attachments/assets/4bd1b67d-90bd-438b-a227-00b9e86872e2)

Credit to kubajanik for these wonderful improvements!

`--tsconfig` CLI option

By default, Playwright will look up the closest tsconfig for each imported file using a heuristic. You can now specify a single tsconfig file in the command line, and Playwright will use it for all imported files, not only test files:

sh
Pass a specific tsconfig
npx playwright test --tsconfig tsconfig.test.json


[APIRequestContext](https://playwright.dev/docs/api/class-apirequestcontext) now accepts [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) and `string` as query parameters

You can now pass [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) and `string` as query parameters to [APIRequestContext](https://playwright.dev/docs/api/class-apirequestcontext):

ts
test('query params', async ({ request }) => {
const searchParams = new URLSearchParams();
searchParams.set('userId', 1);
const response = await request.get(
   'https://jsonplaceholder.typicode.com/posts',
   {
     params: searchParams // or as a string: 'userId=1'
   }
);
// ...
});


Miscellaneous
- The `mcr.microsoft.com/playwright:v1.47.0` now serves a Playwright image based on Ubuntu 24.04 Noble.
To use the 22.04 jammy-based image, please use `mcr.microsoft.com/playwright:v1.47.0-jammy` instead.
- The `:latest`/`:focal`/`:jammy` tag for Playwright Docker images is no longer being published. Pin to a specific version for better stability and reproducibility.
- New option `behavior` in [page.removeAllListeners()](https://playwright.dev/docs/api/class-page#page-remove-all-listeners), [browser.removeAllListeners()](https://playwright.dev/docs/api/class-browser#browser-remove-all-listeners) and [browserContext.removeAllListeners()](https://playwright.dev/docs/api/class-browsercontext#browser-context-remove-all-listeners) to wait for ongoing listeners to complete.
- TLS client certificates can now be passed from memory by passing `cert` and `key` as buffers instead of file paths.
- Attachments with a `text/html` content type can now be opened in a new tab in the HTML report. This is useful for including third-party reports or other HTML content in the Playwright test report and distributing it to your team.
- `noWaitAfter` in [locator.selectOption()](https://playwright.dev/docs/api/class-locator#locator-select-option) was deprecated.
- We've seen reports of WebGL in Webkit misbehaving on GitHub Actions `macos-13`. We recommend upgrading GitHub Actions to `macos-14`.

Browser Versions
- Chromium 129.0.6668.29
- Mozilla Firefox 130.0
- WebKit 18.0

This version was also tested against the following stable channels:
- Google Chrome 128
- Microsoft Edge 128

1.46.1

Highlights

https://github.com/microsoft/playwright/issues/32004 - [REGRESSION]: Client Certificates don't work with Microsoft IIS
https://github.com/microsoft/playwright/issues/32004 - [REGRESSION]: Websites stall on TLS handshake errors when using Client Certificates
https://github.com/microsoft/playwright/issues/32146 - [BUG]: Credential scanners warn about internal socks-proxy TLS certificates
https://github.com/microsoft/playwright/issues/32056 - [REGRESSION]: 1.46.0 (TypeScript) - custom fixtures extend no longer chainable
https://github.com/microsoft/playwright/issues/32070 - [Bug]: --only-changed flag and project dependencies
https://github.com/microsoft/playwright/issues/32188 - [Bug]: --only-changed with shallow clone throws "unknown revision" error

Browser Versions
- Chromium 128.0.6613.18
- Mozilla Firefox 128.0
- WebKit 18.0

This version was also tested against the following stable channels:
- Google Chrome 127
- Microsoft Edge 127

1.46.0

TLS Client Certificates

Playwright now allows to supply client-side certificates, so that server can verify them, as specified by TLS Client Authentication.

When client certificates are specified, all browser traffic is routed through a proxy that establishes the secure TLS connection, provides client certificates to the server and validates server certificates.

The following snippet sets up a client certificate for `https://example.com`:

ts
import { defineConfig } from 'playwright/test';

export default defineConfig({
// ...
use: {
 clientCertificates: [{
   origin: 'https://example.com',
   certPath: './cert.pem',
   keyPath: './key.pem',
   passphrase: 'mysecretpassword',
 }],
},
// ...
});


You can also provide client certificates to a particular [test project](https://playwright.dev/docs/api/class-testproject#test-project-use) or as a parameter of [browser.newContext()](https://playwright.dev/docs/api/class-browser#browser-new-context) and [apiRequest.newContext()](https://playwright.dev/docs/api/class-apirequest#api-request-new-context).

`--only-changed` cli option

New CLI option `--only-changed` allows to only run test files that have been changed since the last git commit or from a specific git "ref".

sh
Only run test files with uncommitted changes
npx playwright test --only-changed

Only run test files changed relative to the "main" branch
npx playwright test --only-changed=main


Component Testing: New `router` fixture

This release introduces an experimental `router` fixture to intercept and handle network requests in component testing.
There are two ways to use the router fixture:
- Call `router.route(url, handler)` that behaves similarly to [page.route()](https://playwright.dev/docs/api/class-page#page-route).
- Call `router.use(handlers)` and pass [MSW library](https://mswjs.io) request handlers to it.

Here is an example of reusing your existing MSW handlers in the test.

ts
import { handlers } from 'src/mocks/handlers';

test.beforeEach(async ({ router }) => {
// install common handlers before each test
await router.use(...handlers);
});

test('example test', async ({ mount }) => {
// test as usual, your handlers are active
// ...
});


This fixture is only available in [component tests](https://playwright.dev/docs/test-components#handling-network-requests).

UI Mode / Trace Viewer Updates
- Test annotations are now shown in UI mode.
- Content of text attachments is now rendered inline in the attachments pane.
- New setting to show/hide routing actions like [route.continue()](https://playwright.dev/docs/api/class-route#route-continue).
- Request method and status are shown in the network details tab.
- New button to copy source file location to clipboard.
- Metadata pane now displays the `baseURL`.

Miscellaneous
- New `maxRetries` option in [apiRequestContext.fetch()](https://playwright.dev/docs/api/class-apirequestcontext#api-request-context-fetch) which retries on the `ECONNRESET` network error.
- New option to [box a fixture](https://playwright.dev/docs/test-fixtures#box-fixtures) to minimize the fixture exposure in test reports and error messages.
- New option to provide a [custom fixture title](https://playwright.dev/docs/test-fixtures#custom-fixture-title) to be used in test reports and error messages.

Possibly breaking change

Fixture values that are array of objects, when specified in the `test.use()` block, may require being wrapped into a fixture tuple. This is best seen on the example:

ts
import { test as base } from 'playwright/test';

// Define an option fixture that has an "array of objects" value
type User = { name: string, password: string };
const test = base.extend<{ users: User[] }>({
users: [ [], { option: true } ],
}); 

// Specify option value in the test.use block.
test.use({
// WRONG: this syntax may not work for you
users: [
 { name: 'John Doe', password: 'secret' },
 { name: 'John Smith', password: 's3cr3t' },
],
// CORRECT: this syntax will work. Note extra [] around the value, and the "scope" property.
users: [[
 { name: 'John Doe', password: 'secret' },
 { name: 'John Smith', password: 's3cr3t' },
], { scope: 'test' }],
});

test('example test', async () => {
// ...
});


Browser Versions
- Chromium 128.0.6613.18
- Mozilla Firefox 128.0
- WebKit 18.0

This version was also tested against the following stable channels:
- Google Chrome 127
- Microsoft Edge 127

1.45.3

Highlights

https://github.com/microsoft/playwright/issues/31764 - [Bug]: some actions do not appear in the trace file
https://github.com/microsoft/playwright-java/issues/1617 - [Bug]: Traceviewer not reporting all actions

Browser Versions

* Chromium 127.0.6533.5
* Mozilla Firefox 127.0
* WebKit 17.4

This version was also tested against the following stable channels:
* Google Chrome 126
* Microsoft Edge 126

1.45.2

Highlights

https://github.com/microsoft/playwright/issues/31613 - [REGRESSION]: Trace is not showing any screenshots nor test name
https://github.com/microsoft/playwright/issues/31601 - [REGRESSION]: missing trace for 2nd browser
https://github.com/microsoft/playwright/issues/31541 - [REGRESSION]: Failing tests have a trace with no images and with steps missing

Browser Versions

* Chromium 127.0.6533.5
* Mozilla Firefox 127.0
* WebKit 17.4

This version was also tested against the following stable channels:
* Google Chrome 126
* Microsoft Edge 126

1.45.1

Highlights

https://github.com/microsoft/playwright/issues/31473 - [REGRESSION]: Playwright raises an error ENOENT: no such file or directory, open 'test-results/.playwright-artifacts-0/hash.zip' with Electron
https://github.com/microsoft/playwright/issues/31442 - [REGRESSION]: Locators of elements changing from/to hidden have operations hanging when using `--disable-web-security`
https://github.com/microsoft/playwright/issues/31431 - [REGRESSION]: NewTab doesn't work properly with Chrome with `--disable-web-security`
https://github.com/microsoft/playwright/issues/31425 - [REGRESSION]: beforeEach hooks are not skipped when describe condition depends on fixtures
https://github.com/microsoft/playwright/issues/31491 - [REGRESSION]: `playwright/experimental-ct-react` doesn't work with VSCode extension and PNPM

Browser Versions

* Chromium 127.0.6533.5
* Mozilla Firefox 127.0
* WebKit 17.4

This version was also tested against the following stable channels:
* Google Chrome 126
* Microsoft Edge 126

1.45.0

Clock

Utilizing the new [Clock](https://playwright.dev/docs/api/class-clock) API allows to manipulate and control time within tests to verify time-related behavior. This API covers many common scenarios, including:
* testing with predefined time;
* keeping consistent time and timers;
* monitoring inactivity;
* ticking through time manually.

js
// Initialize clock and let the page load naturally.
await page.clock.install({ time: new Date('2024-02-02T08:00:00') });
await page.goto('http://localhost:3333');

// Pretend that the user closed the laptop lid and opened it again at 10am,
// Pause the time once reached that point.
await page.clock.pauseAt(new Date('2024-02-02T10:00:00'));

// Assert the page state.
await expect(page.getByTestId('current-time')).toHaveText('2/2/2024, 10:00:00 AM');

// Close the laptop lid again and open it at 10:30am.
await page.clock.fastForward('30:00');
await expect(page.getByTestId('current-time')).toHaveText('2/2/2024, 10:30:00 AM');


See [the clock guide](https://playwright.dev/docs/clock) for more details.

Test runner
- New CLI option `--fail-on-flaky-tests` that sets exit code to `1` upon any flaky tests. Note that by default, the test runner exits with code `0` when all failed tests recovered upon a retry. With this option, the test run will fail in such case.
- New enviroment variable `PLAYWRIGHT_FORCE_TTY` controls whether built-in `list`, `line` and `dot` reporters assume a live terminal. For example, this could be useful to disable tty behavior when your CI environment does not handle ANSI control sequences well. Alternatively, you can enable tty behavior even when to live terminal is present, if you plan to post-process the output and handle control sequences.

sh
Avoid TTY features that output ANSI control sequences
PLAYWRIGHT_FORCE_TTY=0 npx playwright test

Enable TTY features, assuming a terminal width 80
PLAYWRIGHT_FORCE_TTY=80 npx playwright test


- New options [testConfig.respectGitIgnore](https://playwright.dev/docs/api/class-testconfig#test-config-respect-git-ignore) and [testProject.respectGitIgnore](https://playwright.dev/docs/api/class-testproject#test-project-respect-git-ignore) control whether files matching `.gitignore` patterns are excluded when searching for tests.
- New property `timeout` is now available for custom expect matchers. This property takes into account `playwright.config.ts` and `expect.configure()`.

ts
import { expect as baseExpect } from 'playwright/test';

export const expect = baseExpect.extend({
 async toHaveAmount(locator: Locator, expected: number, options?: { timeout?: number }) {
   // When no timeout option is specified, use the config timeout.
   const timeout = options?.timeout ?? this.timeout;
   // ... implement the assertion ...
 },
});


Miscellaneous
- Method [locator.setInputFiles()](https://playwright.dev/docs/api/class-locator#locator-set-input-files) now supports uploading a directory for `<input type=file webkitdirectory>` elements.

ts
await page.getByLabel('Upload directory').setInputFiles(path.join(__dirname, 'mydir'));


- Multiple methods like [locator.click()](https://playwright.dev/docs/api/class-locator#locator-click) or [locator.press()](https://playwright.dev/docs/api/class-locator#locator-press) now support a `ControlOrMeta` modifier key. This key maps to `Meta` on macOS and maps to `Control` on Windows and Linux.

ts
// Press the common keyboard shortcut Control+S or Meta+S to trigger a "Save" operation.
await page.keyboard.press('ControlOrMeta+S');


- New property `httpCredentials.send` in [apiRequest.newContext()](https://playwright.dev/docs/api/class-apirequest#api-request-new-context) that allows to either always send the `Authorization` header or only send it in response to `401 Unauthorized`.
- New option `reason` in [apiRequestContext.dispose()](https://playwright.dev/docs/api/class-apirequestcontext#api-request-context-dispose) that will be included in the error message of ongoing operations interrupted by the context disposal.
- New option `host` in [browserType.launchServer()](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-server) allows to accept websocket connections on a specific address instead of unspecified `0.0.0.0`.
- Playwright now supports Chromium, Firefox and WebKit on Ubuntu 24.04.
- v1.45 is the last release to receive WebKit update for macOS 12 Monterey. Please update macOS to keep using the latest WebKit.

Browser Versions
* Chromium 127.0.6533.5
* Mozilla Firefox 127.0
* WebKit 17.4

This version was also tested against the following stable channels:
* Google Chrome 126
* Microsoft Edge 126

1.44.1

Highlights

https://github.com/microsoft/playwright/issues/30779 - [REGRESSION]: When using `video: 'on'` with VSCode extension the browser got closed
https://github.com/microsoft/playwright/issues/30755 - [REGRESSION]: Electron launch with spaces inside executablePath didn't work 
https://github.com/microsoft/playwright/issues/30770 - [REGRESSION]: Mask elements outside of viewport when creating fullscreen screenshots didn't work 
https://github.com/microsoft/playwright/issues/30858 - [REGRESSION]: ipv6 got shown instead of localhost in show-trace/show-report

Browser Versions

* Chromium 125.0.6422.14
* Mozilla Firefox 125.0.1
* WebKit 17.4

This version was also tested against the following stable channels:
* Google Chrome 124
* Microsoft Edge 124

1.44.0

New APIs

**Accessibility assertions**
- [expect(locator).toHaveAccessibleName()](https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-have-accessible-name) checks if the element has the specified accessible name:

js
const locator = page.getByRole('button');
await expect(locator).toHaveAccessibleName('Submit');


- [expect(locator).toHaveAccessibleDescription()](https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-have-accessible-description) checks if the element has the specified accessible description:

js
const locator = page.getByRole('button');
await expect(locator).toHaveAccessibleDescription('Upload a photo');


- [expect(locator).toHaveRole()](https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-have-role) checks if the element has the specified ARIA role:

js
const locator = page.getByTestId('save-button');
await expect(locator).toHaveRole('button');


**Locator handler**
- After executing the handler added with [page.addLocatorHandler()](https://playwright.dev/docs/api/class-page#page-add-locator-handler), Playwright will now wait until the overlay that triggered the handler is not visible anymore. You can opt-out of this behavior with the new `noWaitAfter` option.
- You can use new `times` option in [page.addLocatorHandler()](https://playwright.dev/docs/api/class-page#page-add-locator-handler) to specify maximum number of times the handler should be run.
- The handler in [page.addLocatorHandler()](https://playwright.dev/docs/api/class-page#page-add-locator-handler) now accepts the locator as argument.
- New [page.removeLocatorHandler()](https://playwright.dev/docs/api/class-page#page-remove-locator-handler) method for removing previously added locator handlers.

js
const locator = page.getByText('This interstitial covers the button');
await page.addLocatorHandler(locator, async overlay => {
await overlay.locator('close').click();
}, { times: 3, noWaitAfter: true });
// Run your tests that can be interrupted by the overlay.
// ...
await page.removeLocatorHandler(locator);


**Miscellaneous options**
- [`multipart`](https://playwright.dev/docs/api/class-apirequestcontext#api-request-context-fetch-option-multipart) option in `apiRequestContext.fetch()` now accepts [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) and supports repeating fields with the same name.

js
const formData = new FormData();
formData.append('file', new File(['let x = 2024;'], 'f1.js', { type: 'text/javascript' }));
formData.append('file', new File(['hello'], 'f2.txt', { type: 'text/plain' }));
context.request.post('https://example.com/uploadFiles', {
 multipart: formData
});


- `expect(callback).toPass({ intervals })` can now be configured by `expect.toPass.inervals` option globally in [testConfig.expect](https://playwright.dev/docs/api/class-testconfig#test-config-expect) or per project in [testProject.expect](https://playwright.dev/docs/api/class-testproject#test-project-expect).
- `expect(page).toHaveURL(url)` now supports `ignoreCase` [option](https://playwright.dev/docs/api/class-pageassertions#page-assertions-to-have-url-option-ignore-case).
- [testProject.ignoreSnapshots](https://playwright.dev/docs/api/class-testproject#test-project-ignore-snapshots) allows to configure  per project whether to skip screenshot expectations.

**Reporter API**
- New method [suite.entries()](https://playwright.dev/docs/api/class-suite#suite-entries) returns child test suites and test cases in their declaration order. [suite.type](https://playwright.dev/docs/api/class-suite#suite-type) and [testCase.type](https://playwright.dev/docs/api/class-testcase#test-case-type) can be used to tell apart test cases and suites in the list.
- [Blob](https://playwright.dev/docs/test-reporters#blob-reporter) reporter now allows overriding report file path with a single option `outputFile`. The same option can also be specified as `PLAYWRIGHT_BLOB_OUTPUT_FILE` environment variable that might be more convenient on CI/CD.
- [JUnit](https://playwright.dev/docs/test-reporters#junit-reporter) reporter now supports `includeProjectInTestName` option.

**Command line**
- `--last-failed` CLI option for running only tests that failed in the previous run.

First run all tests:

sh
$ npx playwright test

Running 103 tests using 5 workers
...
2 failed
 [chromium] › my-test.spec.ts:8:5 › two ─────────────────────────────────────────────────────────
 [chromium] › my-test.spec.ts:13:5 › three ──────────────────────────────────────────────────────
101 passed (30.0s)


Now fix the failing tests and run Playwright again with `--last-failed` option:

sh
$ npx playwright test --last-failed

Running 2 tests using 2 workers
 2 passed (1.2s)


Browser Versions
* Chromium 125.0.6422.14
* Mozilla Firefox 125.0.1
* WebKit 17.4

This version was also tested against the following stable channels:
* Google Chrome 124
* Microsoft Edge 124

1.43.1

Highlights

https://github.com/microsoft/playwright/issues/30300 - [REGRESSION]: UI mode restarts if keep storage state
https://github.com/microsoft/playwright/issues/30339 - [REGRESSION]: Brand new install of playwright, unable to run chromium with show browser using vscode

Browser Versions
* Chromium 124.0.6367.29
* Mozilla Firefox 124.0
* WebKit 17.4

This version was also tested against the following stable channels:
* Google Chrome 123
* Microsoft Edge 123

1.43.0

New APIs
- Method [browserContext.clearCookies()](https://playwright.dev/docs/api/class-browsercontext#browser-context-clear-cookies) now supports filters to remove only some cookies.

js
// Clear all cookies.
await context.clearCookies();
// New: clear cookies with a particular name.
await context.clearCookies({ name: 'session-id' });
// New: clear cookies for a particular domain.
await context.clearCookies({ domain: 'my-origin.com' });


- New mode `retain-on-first-failure` for [testOptions.trace](https://playwright.dev/docs/api/class-testoptions#test-options-trace). In this mode, trace is recorded for the first run of each test, but not for retires. When test run fails, the trace file is retained, otherwise it is removed.

js title=playwright.config.ts
import { defineConfig } from 'playwright/test';

export default defineConfig({
 use: {
   trace: 'retain-on-first-failure',
 },
});


- New property [testInfo.tags](https://playwright.dev/docs/api/class-testinfo#test-info-tags) exposes test tags during test execution.

js
test('example', async ({ page }) => {
 console.log(test.info().tags);
});


- New method [locator.contentFrame()](https://playwright.dev/docs/api/class-locator#locator-content-frame) converts a `Locator` object to a `FrameLocator`. This can be useful when you have a `Locator` object obtained somewhere, and later on would like to interact with the content inside the frame.

js
const locator = page.locator('iframe[name="embedded"]');
// ...
const frameLocator = locator.contentFrame();
await frameLocator.getByRole('button').click();


- New method [frameLocator.owner()](https://playwright.dev/docs/api/class-framelocator#frame-locator-owner) converts a `FrameLocator` object to a `Locator`. This can be useful when you have a `FrameLocator` object obtained somewhere, and later on would like to interact with the `iframe` element.

js
const frameLocator = page.frameLocator('iframe[name="embedded"]');
// ...
const locator = frameLocator.owner();
await expect(locator).toBeVisible();


UI Mode Updates

![Playwright UI Mode](https://github.com/microsoft/playwright/assets/9881434/61ca7cfc-eb7a-4305-8b62-b6c9f098f300)
* See tags in the test list.
* Filter by tags by typing `fast` or clicking on the tag itself.
* New shortcuts:
- <kbd>F5</kbd> to run tests.
- <kbd>Shift</kbd> <kbd>F5</kbd> to stop running tests.
- <kbd>Ctrl</kbd> <kbd>`</kbd> to toggle test output.

Browser Versions
* Chromium 124.0.6367.29
* Mozilla Firefox 124.0
* WebKit 17.4

This version was also tested against the following stable channels:
* Google Chrome 123
* Microsoft Edge 123

1.42.1

Highlights

1.42

Browser Versions
* Chromium 123.0.6312.4
* Mozilla Firefox 123.0
* WebKit 17.4

This version was also tested against the following stable channels:
* Google Chrome 122
* Microsoft Edge 123

1.42.0

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