Skip to content

Pin playwright to latest version 1.60.0#834

Open
pyup-bot wants to merge 1 commit into
mainfrom
pyup-pin-playwright-1.60.0
Open

Pin playwright to latest version 1.60.0#834
pyup-bot wants to merge 1 commit into
mainfrom
pyup-pin-playwright-1.60.0

Conversation

@pyup-bot
Copy link
Copy Markdown
Collaborator

This PR pins playwright to the latest release 1.60.0.

Changelog

1.60.0

🐍 Python improvements

- New [FormData](https://playwright.dev/python/docs/api/class-formdata) class for building multipart/form-data request bodies — pass to [api_request_context.post(form=…)](https://playwright.dev/python/docs/api/class-apirequestcontext#api-request-context-post) etc.
- [expect.soft(...)](https://playwright.dev/python/docs/test-assertions#soft-assertions) soft assertions collect multiple failures in a test instead of stopping at the first one. Requires up-to-date pytest integration to work.
- All `timeout` parameters now accept `datetime.timedelta` — applies wherever a timeout is taken, e.g. [page.goto()](https://playwright.dev/python/docs/api/class-page#page-goto), [locator.click()](https://playwright.dev/python/docs/api/class-locator#locator-click), [expect(...).to_be_visible()](https://playwright.dev/python/docs/api/class-locatorassertions#locator-assertions-to-be-visible).
- Async context manager support across more APIs — `async with` now works for objects returned from [screencast.show_actions()](https://playwright.dev/python/docs/api/class-screencast#screencast-show-actions), [screencast.show_overlays()](https://playwright.dev/python/docs/api/class-screencast#screencast-show-overlays), etc.
- [page.expect_request(...)](https://playwright.dev/python/docs/api/class-page#page-wait-for-request) and [page.expect_response(...)](https://playwright.dev/python/docs/api/class-page#page-wait-for-response) now accept async predicates.
- Typed overloads for [expect_event](https://playwright.dev/python/docs/api/class-page#page-wait-for-event) / [wait_for_event](https://playwright.dev/python/docs/api/class-page#page-wait-for-event-2) so the event payload type is inferred per event name.


🌐 HAR recording on Tracing

[tracing.start_har()](https://playwright.dev/python/docs/api/class-tracing#tracing-start-har) / [tracing.stop_har()](https://playwright.dev/python/docs/api/class-tracing#tracing-stop-har) expose HAR recording as a first-class tracing API, with the same `content`, `mode` and `url_filter` options as `record_har`:

python
context.tracing.start_har("trace.har")
page = context.new_page()
page.goto("https://playwright.dev")
context.tracing.stop_har()


🪝 Drop API

New [locator.drop()](https://playwright.dev/python/docs/api/class-locator#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:

python
page.locator("dropzone").drop(
 files={"name": "note.txt", "mime_type": "text/plain", "buffer": b"hello"},
)

page.locator("dropzone").drop(
 data={
     "text/plain": "hello world",
     "text/uri-list": "https://example.com",
 },
)


🎯 Aria snapshots
- [expect(page).to_match_aria_snapshot()](https://playwright.dev/python/docs/api/class-pageassertions#page-assertions-to-match-aria-snapshot) now works on a [Page](https://playwright.dev/python/docs/api/class-page), in addition to a [Locator](https://playwright.dev/python/docs/api/class-locator) — equivalent to asserting against `page.locator("body")`.
- New `boxes` option on [locator.aria_snapshot()](https://playwright.dev/python/docs/api/class-locator#locator-aria-snapshot) / [page.aria_snapshot()](https://playwright.dev/python/docs/api/class-page#page-aria-snapshot) appends each element's bounding box as `[box=x,y,width,height]`, useful for AI consumption.

New APIs

Browser, Context and Page
- Event [browser.on("context")](https://playwright.dev/python/docs/api/class-browser#browser-event-context) — fired when a new context is created on the browser.
- [BrowserContext](https://playwright.dev/python/docs/api/class-browsercontext) now mirrors lifecycle events from its pages: [browser_context.on("download")](https://playwright.dev/python/docs/api/class-browsercontext#browser-context-event-download), [browser_context.on("frameattached")](https://playwright.dev/python/docs/api/class-browsercontext#browser-context-event-frame-attached), [browser_context.on("framedetached")](https://playwright.dev/python/docs/api/class-browsercontext#browser-context-event-frame-detached), [browser_context.on("framenavigated")](https://playwright.dev/python/docs/api/class-browsercontext#browser-context-event-frame-navigated), [browser_context.on("pageclose")](https://playwright.dev/python/docs/api/class-browsercontext#browser-context-event-page-close), [browser_context.on("pageload")](https://playwright.dev/python/docs/api/class-browsercontext#browser-context-event-page-load).

Locators and Assertions
- New option `description` in [page.get_by_role()](https://playwright.dev/python/docs/api/class-page#page-get-by-role) / [locator.get_by_role()](https://playwright.dev/python/docs/api/class-locator#locator-get-by-role) / [frame.get_by_role()](https://playwright.dev/python/docs/api/class-frame#frame-get-by-role) / [frame_locator.get_by_role()](https://playwright.dev/python/docs/api/class-framelocator#frame-locator-get-by-role) for matching the [accessible description](https://www.w3.org/TR/wai-aria-1.2/#dfn-accessible-description).
- New option `pseudo` in [expect(locator).to_have_css()](https://playwright.dev/python/docs/api/class-locatorassertions#locator-assertions-to-have-css) reads computed styles from `::before` or `::after`.
- New option `style` in [locator.highlight()](https://playwright.dev/python/docs/api/class-locator#locator-highlight) applies extra inline CSS to the highlight overlay, plus new [page.hide_highlight()](https://playwright.dev/python/docs/api/class-page#page-hide-highlight) to clear all highlights.

Network
- [web_socket_route.protocols()](https://playwright.dev/python/docs/api/class-websocketroute#web-socket-route-protocols) returns the WebSocket subprotocols requested by the page.
- New option `no_defaults` in [browser_type.connect_over_cdp()](https://playwright.dev/python/docs/api/class-browsertype#browser-type-connect-over-cdp) 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
- New [web_error.location()](https://playwright.dev/python/docs/api/class-weberror#web-error-location) mirrors [console_message.location()](https://playwright.dev/python/docs/api/class-consolemessage#console-message-location).
- [console_message.location()](https://playwright.dev/python/docs/api/class-consolemessage#console-message-location) now exposes `line` / `column` properties (`line_number` / `column_number` are deprecated).

🛠️ Other improvements
- Trace Viewer adds a pretty-print toggle for JSON / form request and response bodies in the network details panel.

Breaking Changes ⚠️
- Removed long-deprecated `handle` option on `browser_context.expose_binding()` and `page.expose_binding()`.

Browser Versions
- Chromium 148.0.7778.96
- Mozilla Firefox 150.0.2
- WebKit 26.4

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

1.59.1

Bug Fixes

- **[Windows]** Reverted hiding console window when spawning browser processes, which caused regressions including broken `codegen`, `--ui` and `show` commands ([39990](https://github.com/microsoft/playwright/issues/39990))

1.59.0

🎬 Screencast

New [page.screencast](https://playwright.dev/python/docs/api/class-page#page-screencast) API provides a unified interface for capturing page content with:
- Screencast recordings
- Action annotations
- Visual overlays
- Real-time frame capture
- Agentic video receipts

<center>

<img src="https://raw.githubusercontent.com/microsoft/playwright/main/docs/src/images/release-notes-1.59-screencast-demo.gif" alt="Demo" width="500" height="313" />

</center>

**Screencast recording** — record video with precise start/stop control, as an alternative to the [`recordVideoDir`](https://playwright.dev/python/docs/api/class-browser#browser-new-context-option-record-video-dir) option:

python
page.screencast.start(path="video.webm")
... perform actions ...
page.screencast.stop()


**Action annotations** — enable built-in visual annotations that highlight interacted elements and display action titles during recording:

python
page.screencast.show_actions(position="top-right")


[screencast.show_actions()](https://playwright.dev/python/docs/api/class-screencast#screencast-show-actions) accepts `position` (`'top-left'`, `'top'`, `'top-right'`, `'bottom-left'`, `'bottom'`, `'bottom-right'`), `duration` (ms per annotation), and `font_size` (px). Returns a disposable to stop showing actions.

**Visual overlays** — add chapter titles and custom HTML overlays on top of the page for richer narration:

python
page.screencast.show_chapter("Adding TODOs",
 description="Type and press enter for each TODO",
 duration=1000,
)

page.screencast.show_overlay('<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:

python
page.screencast.start(
 on_frame=lambda frame: send_to_vision_model(frame["data"]),
)


**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:

python
page.screencast.start(path="receipt.webm")
page.screencast.show_actions(position="top-right")

page.screencast.show_chapter("Verifying checkout flow",
 description="Added coupon code support per ticket 1234",
)

Agent performs the verification steps...
page.locator("coupon").fill("SAVE20")
page.locator("apply-coupon").click()
expect(page.locator(".discount")).to_contain_text("20%")

page.screencast.show_chapter("Done",
 description="Coupon applied, discount reflected in total",
)

page.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.

🔍 Snapshots and Locators
- Method [page.aria_snapshot()](https://playwright.dev/python/docs/api/class-page#page-aria-snapshot) to capture the aria snapshot of the page — equivalent to `page.locator('body').aria_snapshot()`.
- Options `depth` and `mode` in [locator.aria_snapshot()](https://playwright.dev/python/docs/api/class-locator#locator-aria-snapshot).
- Method [locator.normalize()](https://playwright.dev/python/docs/api/class-locator#locator-normalize) converts a locator to follow best practices like test ids and aria roles.
- Method [page.pick_locator()](https://playwright.dev/python/docs/api/class-page#page-pick-locator) enters an interactive mode where hovering over elements highlights them and shows the corresponding locator. Click an element to get its [Locator](https://playwright.dev/python/docs/api/class-locator) back. Use [page.cancel_pick_locator()](https://playwright.dev/python/docs/api/class-page#page-cancel-pick-locator) to cancel.

New APIs

Screencast
- [page.screencast](https://playwright.dev/python/docs/api/class-page#page-screencast) provides video recording, real-time frame streaming, and overlay management.
- Methods [screencast.start()](https://playwright.dev/python/docs/api/class-screencast#screencast-start) and [screencast.stop()](https://playwright.dev/python/docs/api/class-screencast#screencast-stop) for recording and frame capture.
- Methods [screencast.show_actions()](https://playwright.dev/python/docs/api/class-screencast#screencast-show-actions) and [screencast.hide_actions()](https://playwright.dev/python/docs/api/class-screencast#screencast-hide-actions) for action annotations.
- Methods [screencast.show_chapter()](https://playwright.dev/python/docs/api/class-screencast#screencast-show-chapter) and [screencast.show_overlay()](https://playwright.dev/python/docs/api/class-screencast#screencast-show-overlay) for visual overlays.
- Methods [screencast.show_overlays()](https://playwright.dev/python/docs/api/class-screencast#screencast-show-overlays) and [screencast.hide_overlays()](https://playwright.dev/python/docs/api/class-screencast#screencast-hide-overlays) for overlay visibility control.

Storage, Console and Errors
- Method [browser_context.set_storage_state()](https://playwright.dev/python/docs/api/class-browsercontext#browser-context-set-storage-state) clears existing cookies, local storage, and IndexedDB for all origins and sets a new storage state — no need to create a new context.
- Methods [page.clear_console_messages()](https://playwright.dev/python/docs/api/class-page#page-clear-console-messages) and [page.clear_page_errors()](https://playwright.dev/python/docs/api/class-page#page-clear-page-errors) to clear stored messages and errors.
- Option `filter` in [page.console_messages()](https://playwright.dev/python/docs/api/class-page#page-console-messages) and [page.page_errors()](https://playwright.dev/python/docs/api/class-page#page-page-errors) controls which messages are returned.
- Method [console_message.timestamp()](https://playwright.dev/python/docs/api/class-consolemessage#console-message-timestamp).

Miscellaneous
- [browser_context.debugger](https://playwright.dev/python/docs/api/class-browsercontext#browser-context-debugger) provides programmatic control over the Playwright debugger.
- Method [browser_context.is_closed()](https://playwright.dev/python/docs/api/class-browsercontext#browser-context-is-closed).
- Method [request.existing_response()](https://playwright.dev/python/docs/api/class-request#request-existing-response) returns the response without waiting.
- Method [response.http_version()](https://playwright.dev/python/docs/api/class-response#response-http-version) returns the HTTP version used by the response.
- Option `live` in [tracing.start()](https://playwright.dev/python/docs/api/class-tracing#tracing-start) for real-time trace updates.
- Option `artifacts_dir` in [browser_type.launch()](https://playwright.dev/python/docs/api/class-browsertype#browser-type-launch) to configure the artifacts directory.

🔗 Interoperability

New [browser.bind()](https://playwright.dev/python/docs/api/class-browser#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:

python
server_info = await browser.bind("my-session",
 workspace_dir="/my/project",
)


**Connect from playwright-cli** — connect to the running browser from your favorite coding agent.

bash
playwright-cli attach my-session
playwright-cli -s my-session snapshot


**Connect from playwright/mcp** — or point your MCP server to the running browser.

bash
playwright/mcp --endpoint=my-session


**Connect from a Playwright client** — use API to connect to the browser. Multiple clients at a time are supported!

python
browser = await chromium.connect(server_info["endpoint"])


Pass `host` and `port` options to bind over WebSocket instead of a named pipe:

python
server_info = await browser.bind("my-session",
 host="localhost",
 port=0,
)
server_info["endpoint"] is a ws:// URL


Call [browser.unbind()](https://playwright.dev/python/docs/api/class-browser#browser-unbind) to stop accepting new connections.

📊 Observability

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.

<center>

<img src="https://raw.githubusercontent.com/microsoft/playwright/main/docs/src/images/release-notes-1.59-dashboard.png" alt="Demo" width="1169" height="835" />

</center>
- `playwright-cli` binds all of its browsers automatically, so you can see what your agents are doing.

Breaking Changes ⚠️
- Removed macOS 14 support for WebKit. We recommend upgrading your macOS version, or keeping an older Playwright version.

Browser Versions
- Chromium 147.0.7727.15
- Mozilla Firefox 148.0.2
- WebKit 26.4

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

1.58.2

Highlights

39121 fix(trace viewer): make paths via stdin work
39129 fix: do not force swiftshader on chromium mac

Browser Versions
- Chromium 145.0.7632.6
- Mozilla Firefox 146.0.1
- WebKit 26.0

1.58.1

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
- Chromium 145.0.7632.6
- Mozilla Firefox 146.0.1
- WebKit 26.0

1.58.0

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

[browser_type.connect_over_cdp()](https://playwright.dev/python/docs/api/class-browsertype#browser-type-connect-over-cdp) now accepts an `is_local` 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/python/docs/locators) for alternatives.
- Removed `:light` selector engine suffix. Use standard CSS selectors instead.
- Option `devtools` from [browser_type.launch()](https://playwright.dev/python/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

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.

Breaking Change

After 3 years of being deprecated, we removed `page.accessibility` 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
- [worker.on("console")](https://playwright.dev/python/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.expect_event()](https://playwright.dev/python/docs/api/class-worker#worker-wait-for-event) can be used to wait for it.
- [locator.description()](https://playwright.dev/python/docs/api/class-locator#locator-description) returns locator description previously set with [locator.describe()](https://playwright.dev/python/docs/api/class-locator#locator-describe).
- New option [`steps`](https://playwright.dev/python/docs/api/class-locator#locator-click-option-steps) in [locator.click()](https://playwright.dev/python/docs/api/class-locator#locator-click) and [locator.drag_to()](https://playwright.dev/python/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/python/docs/service-workers#network-events-and-routing) are now reported and can be routed through the [BrowserContext](https://playwright.dev/python/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/python/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

New APIs
- New methods [page. console_messages()](https://playwright.dev/python/docs/api/class-page#page-console-messages) and [page.page_errors()](https://playwright.dev/python/docs/api/class-page#page-page-errors) for retrieving the most recent console messages from the page
- New method [page.requests()](https://playwright.dev/python/docs/api/class-page#page-requests) for retrieving the most recent network requests from the page

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

Miscellaneous
- Aria snapshots render and compare `input` `placeholder`

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

Codegen
- Automatic `to_be_visible()` assertions: Codegen can now generate automatic `to_be_visible()` 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 `partition_key` in [BrowserContext.cookies()](https://playwright.dev/python/docs/api/class-browsercontext#browser-context-cookies) and [browserContext.add_cookies()](https://playwright.dev/python/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 `--user-data-dir` in multiple commands. You can specify the same user data dir to reuse browsing state, like authentication, between sessions.

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


- `playwright open` does not open the test recorder anymore. Use `playwright codegen` instead.

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

Miscellaneous
- New Steps in Trace Viewer: 
![New Trace Viewer Steps](https://github.com/user-attachments/assets/1963ff7d-4070-41be-a79b-4333176921a2)
- New method [locator.describe()](https://playwright.dev/python/docs/api/class-locator#locator-describe) to describe a locator. Used for trace viewer.

python
button = page.get_by_test_id("btn-sub").describe("Subscribe button")
button.click()


- `python -m 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).to_contain_class()](https://playwright.dev/python/docs/api/class-locatorassertions#locator-assertions-to-contain-class) to ergonomically assert individual class names on the element.

python
 expect(page.get_by_role("listitem", name="Ship v1.52")).to_contain_class("done")


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

python
expect(locator).to_match_aria_snapshot("""
 - list
   - /children: equal
   - listitem: Feature A
   - listitem:
     - link "Feature B":
       - /url: "https://playwright.dev"
""")


Miscellaneous
- New option [`max_redirects`](https://playwright.dev/python/docs/api/class-apirequest#api-request-new-context-option-max-redirects) in [apiRequest.new_context()](https://playwright.dev/python/docs/api/class-apirequest#api-request-new-context) to control the maximum number of redirects.
- New option [`ref`](https://playwright.dev/python/docs/api/class-locator#locator-aria-snapshot-option-ref) in [locator.aria_snapshot()](https://playwright.dev/python/docs/api/class-locator#locator-aria-snapshot) to generate reference for each element in the snapshot which can later be used to locate the element.

Breaking Changes

- Method [route.continue()](https://playwright.dev/python/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.add_cookies()](https://playwright.dev/python/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

Highlights
* New option [`indexed_db`](https://playwright.dev/python/docs/api/class-browsercontext#browser-context-storage-state-option-indexed-db) for [browserContext.storage_state()](https://playwright.dev/python/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/python/docs/auth#reusing-signed-in-state):

python
Save storage state into the file. Make sure to include IndexedDB.
storage = context.storage_state(path="state.json", indexed_db=True)

Create a new context with the saved storage state.
context = browser.new_context(storage_state="state.json")


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

python
Ignore invisible todo items.
todo_items = page.get_by_test_id("todo-item").filter(visible=True)
Check there are exactly 3 visible ones.
expect(todo_items).to_have_count(3)


* New option `contrast` for methods [page.emulate_media()](https://playwright.dev/python/docs/api/class-page#page-emulate-media) and [browser.new_context()](https://playwright.dev/python/docs/api/class-browser#browser-new-context) allows to emulate the `prefers-contrast` media feature.
* New option [`fail_on_status_code`](https://playwright.dev/python/docs/api/class-apirequest#api-request-new-context-option-fail-on-status-code) makes all fetch requests made through the [APIRequestContext](https://playwright.dev/python/docs/api/class-apirequestcontext) throw on response codes other than 2xx and 3xx.

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

Async Pytest Plugin
* [Playwright's Pytest plugin](https://playwright.dev/python/docs/test-runners) now has support for [Async Fixtures](https://playwright.dev/python/docs/test-runners#async-fixtures).

Miscellaneous
* Added method [expect(locator).to_have_accessible_error_message()](https://playwright.dev/python/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).

UI updates
* New button in Codegen 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).to_be_editable()](https://playwright.dev/python/docs/api/class-locatorassertions#locator-assertions-to-be-editable) and [locator.is_editable()](https://playwright.dev/python/docs/api/class-locator#locator-is-editable) now throw if the target element is not `<input>`, `<select>`, or a number of other editable elements.

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-python/issues/2679 - [Bug]: Warning: Validation of the RECORD file of playwright-1.49.0-py3-none-manylinux1_x86_64.whl failed

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/python/docs/api/class-locatorassertions#locator-assertions-to-match-aria-snapshot) verifies page structure by comparing to an expected accessibility tree, represented as YAML.

python
page.goto("https://playwright.dev")
expect(page.locator('body')).to_match_aria_snapshot('''
- 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/python/docs/codegen) or by calling [locator.ariaSnapshot()](https://playwright.dev/python/docs/api/class-locator#locator-aria-snapshot).

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

Tracing groups

New method [tracing.group()](https://playwright.dev/python/docs/api/class-tracing#tracing-group) allows you to visually group actions in the trace viewer.

python
All actions between group and group_end
will be shown in the trace viewer as a group.
page.context.tracing.group("Open Playwright.dev > API")
page.goto("https://playwright.dev/")
page.get_by_role("link", name="API").click()
page.context.tracing.group_end()


Breaking: `chrome` and `msedge` channels switch to new headless mode

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`

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.

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.

bash python
pytest test_login.py --browser-channel chromium


Miscellaneous
- There will be no more updates for WebKit on Ubuntu 20.04 and Debian 11. We recommend updating your OS to a later version.
- `<canvas>` elements inside a snapshot now draw a preview.
- Python 3.8 is not supported anymore.

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.route_web_socket()](https://playwright.dev/python/docs/api/class-page#page-route-web-socket) and [browser_context.route_web_socket()](https://playwright.dev/python/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"`.

python
def message_handler(ws: WebSocketRoute, message: Union[str, bytes]):
if message == "request":
 ws.send("response")

page.route_web_socket("/ws", lambda ws: ws.on_message(
 lambda message: message_handler(ws, message)
))


See [WebSocketRoute](https://playwright.dev/python/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/python/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
- New method [page.request_gc()](https://playwright.dev/python/docs/api/class-page#page-request-gc) may help detect memory leaks.
- Requests made by [APIRequestContext](https://playwright.dev/python/docs/api/class-apirequestcontext) now record detailed timing and security information in the HAR.
- This version adds support for Python 3.13
- This version is the last version supporting Python 3.8

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 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)

Miscellaneous
- The `mcr.microsoft.com/playwright-python: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-python: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.
- TLS client certificates can now be passed from memory by passing `cert` and `key` as bytes instead of file paths.
- `no_wait_after` in [locator.selectOption()](https://playwright.dev/python/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.

You can provide client certificates as a parameter of [browser.new_context()](https://playwright.dev/python/docs/api/class-browser#browser-new-context) and [api_request.new_context()](https://playwright.dev/python/docs/api/class-apirequest#api-request-new-context). The following snippet sets up a client certificate for `https://example.com`:

python
context = browser.new_context(
 client_certificates=[
     {
         "origin": "https://example.com",
         "certPath": "client-certificates/cert.pem",
         "keyPath": "client-certificates/key.pem",
     }
 ],
)


When using the [Pytest plugin](https://playwright.dev/python/docs/test-runners), it can be added like this:

python
pytest.fixture(scope="session")
def browser_context_args(browser_context_args):
 return {
     **browser_context_args,
     "client_certificates": [
         {
             "origin": "https://example.com",
             "certPath": "client-certificates/cert.pem",
             "keyPath": "client-certificates/key.pem",
         }
     ],
 }


Trace Viewer Updates
- 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/python/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 `base_url`.

Miscellaneous
- New `max_retries` option in [apiRequestContext.fetch()](https://playwright.dev/python/docs/api/class-apirequestcontext#api-request-context-fetch) which retries on the `ECONNRESET` network 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.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-java/issues/1617 - [Bug]: Trace Viewer not reporting all actions
https://github.com/microsoft/playwright/issues/31764 - [Bug]: some actions do not appear in the trace file

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/python/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.

python
Initialize clock with some time before the test time and let the page load
naturally. `Date.now` will progress as the timers fire.
page.clock.install(time=datetime.datetime(2024, 2, 2, 8, 0, 0))
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.
page.clock.pause_at(datetime.datetime(2024, 2, 2, 10, 0, 0))

Assert the page state.
expect(page.get_by_test_id("current-time")).to_have_text("2/2/2024, 10:00:00 AM")

Close the laptop lid again and open it at 10:30am.
page.clock.fast_forward("30:00")
expect(page.get_by_test_id("current-time")).to_have_text("2/2/2024, 10:30:00 AM")


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

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

- Multiple methods like [locator.click()](https://playwright.dev/python/docs/api/class-locator#locator-click) or [locator.press()](https://playwright.dev/python/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.
python
Press the common keyboard shortcut Control+S or Meta+S to trigger a "Save" operation.
page.keyboard.press("ControlOrMeta+S")

- New property `httpCredentials.send` in [apiRequest.newContext()](https://playwright.dev/python/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`.
- 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).to_have_accessible_name()](https://playwright.dev/python/docs/api/class-locatorassertions#locator-assertions-to-have-accessible-name) checks if the element has the specified accessible name:

python
locator = page.get_by_role("button")
expect(locator).to_have_accessible_name("Submit")


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

python
locator = page.get_by_role("button")
expect(locator).to_have_accessible_description("Upload a photo")


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

python
locator = page.get_by_test_id("save-button")
expect(locator).to_have_role("button")


**Locator handler**
- After executing the handler added with [page.add_locator_handler()](https://playwright.dev/python/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 `no_wait_after` option.
- You can use new `times` option in [page.add_locator_handler()](https://playwright.dev/python/docs/api/class-page#page-add-locator-handler) to specify maximum number of times the handler should be run.
- The handler in [page.add_locator_handler()](https://playwright.dev/python/docs/api/class-page#page-add-locator-handler) now accepts the locator as argument.
- New [page.remove_locator_handler()](https://playwright.dev/python/docs/api/class-page#page-remove-locator-handler) method for removing previously added locator handlers.

python
locator = page.get_by_text("This interstitial covers the button")
page.add_locator_handler(locator, lambda overlay: overlay.locator("close").click(), times=3, no_wait_after=True)
Run your tests that can be interrupted by the overlay.
...
page.remove_locator_handler(locator)


**Miscellaneous options**
- [expect(page).to_have_url()](https://playwright.dev/python/docs/api/class-pageassertions#page-assertions-to-have-url) now supports `ignore_case` [option](https://playwright.dev/python/docs/api/class-pageassertions#page-assertions-to-have-url-option-ignore-case).

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.clear_cookies([options])](https://playwright.dev/python/docs/api/class-browsercontext#browser-context-clear-cookies) now supports filters to remove only some cookies.

python
Clear all cookies.
context.clear_cookies()
New: clear cookies with a particular name.
context.clear_cookies(name="session-id")
New: clear cookies for a particular domain.
context.clear_cookies(domain="my-origin.com")


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

python
locator = page.locator("iframe[name='embedded']")
...
frame_locator = locator.content_frame
frame_locator.getByRole("button").click()


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

python
frame_locator = page.frame_locator("iframe[name='embedded']")
...
locator = frame_locator.owner
expect(locator).to_be_visible()


- Conda builds are now published for macOS-arm64 and Linux-arm64.

Browser Versions
* Chromium 124.0.6367.8
* 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

New Locator Handler

New method [page.add_locator_handler(locator, handler)](https://playwright.dev/python/docs/api/class-page#page-add-locator-handler) registers a callback that will be invoked when specified element becomes visible and may block Playwright actions. The callback can get rid of the overlay. Here is an example that closes a cookie dialog when it appears.

python
Setup the handler.
page.add_locator_handler(
 page.get_by_role("heading", name="Hej! You are in control of your cookies."),
 lambda: page.get_by_role("button", name="Accept all").click(),
)
Write the test as usual.
page.goto("https://www.ikea.com/")
page.get_by_role("link", name="Collection of blue and white").click()
expect(page.get_by_role("heading", name="Light and easy")).to_be_visible()


New APIs
- [page.pdf([options])](https://playwright.dev/python/docs/api/class-page#page-pdf) accepts two new options `tagged` and `outline`.

Announcements
* ⚠️ Ubuntu 18 is not supported anymore.

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.41.2

Highlights

1.41.1

Highlights

https://github.com/microsoft/playwright/issues/29067 - [REGRESSION] Codegen/Recorder: not all clicks are being actioned nor recorded
https://github.com/microsoft/playwright/issues/29019 - [REGRESSION] trace.playwright.dev does not currently support the loading from URL

Browser Versions
* Chromium 121.0.6167.57
* Mozilla Firefox 121.0
* WebKit 17.4

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

1.41.0

New APIs
- New method [page.unroute_all()](https://playwright.dev/python/docs/api/class-page#page-unroute-all) removes all routes registered by [page.route()](https://playwright.dev/python/docs/api/class-page#page-route) and [page.route_from_har()](https://playwright.dev/python/docs/api/class-page#page-route-from-har). Optionally allows to wait for ongoing routes to finish, or ignore any errors from them.
- New method [browserContext.unroute_all()](https://playwright.dev/python/docs/api/class-browsercontext#browser-context-unroute-all) removes all routes registered by [browserContext.route()](https://playwright.dev/python/docs/api/class-browsercontext#browser-context-route) and [browserContext.route_from_har()](https://playwright.dev/python/docs/api/class-browsercontext#browser-context-route-from-har). Optionally allows to wait for ongoing routes to finish, or ignore any errors from them.
- New option `style` in [page.screenshot()](https://playwright.dev/python/docs/api/class-page#page-screenshot) and [locator.screenshot()](https://playwright.dev/python/docs/api/class-locator#locator-screenshot) to add custom CSS to the page before taking a screenshot.

Browser Versions
* Chromium 121.0.6167.57
* Mozilla Firefox 121.0
* WebKit 17.4

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

1.40.1

Highlights

https://github.com/microsoft/playwright/issues/28319 - [REGRESSION]: Version 1.40.0 Produces corrupted traces
https://github.com/microsoft/playwright/issues/28371 - [BUG] The color of the 'ok' text did not change to green in the vs code test results section
https://github.com/microsoft/playwright/issues/28321 - [BUG] Ambiguous test outcome and status for serial mode
https://github.com/microsoft/playwright/issues/28362 - [BUG] Merging blobs ends up in Error: Cannot create a string longer than 0x1fffffe8 characters
https://github.com/microsoft/playwright/pull/28239 - fix: collect all errors in removeFolders


Browser Versions
* Chromium 120.0.6099.28
* Mozilla Firefox 119.0
* WebKit 17.4

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

1.40.0

Test Generator Update

![Playwright Test Generator](https://github.com/microsoft/playwright/assets/9881434/e8d67e2e-f36d-4301-8631-023948d3e190)

New tools to generate assertions:
- "Assert visibility" tool generates [expect(locator).to_be_visible()](https://playwright.dev/python/docs/api/class-locatorassertions#locator-assertions-to-be-visible).
- "Assert value" tool generates [expect(locator).to_have_value(value)](https://playwright.dev/python/docs/api/class-locatorassertions#locator-assertions-to-have-value).
- "Assert text" tool generates [expect(locator).to_contain_text(expected)](https://playwright.dev/python/docs/api/class-locatorassertions#locator-assertions-to-contain-text).

Here is an example of a generated test with assertions:

python
from playwright.sync_api import Page, expect

def test_example(page: Page) -> None:
 page.goto("https://playwright.dev/")
 page.get_by_role("link", name="Get started").click()
 expect(page.get_by_label("Breadcrumbs").get_by_role("list")).to_contain_text("Installation")
 expect(page.get_by_label("Search")).to_be_visible()
 page.get_by_label("Search").click()
 page.get_by_placeholder("Search docs").fill("locator")
 expect(page.get_by_placeholder("Search docs")).to_have_value("locator");


New APIs
- Option `reason` in [page.close([options])](https://playwright.dev/python/docs/api/class-page#page-close), [browserContext.close([options])](https://playwright.dev/python/docs/api/class-browsercontext#browser-context-close) and [browser.close([options])](https://playwright.dev/python/docs/api/class-browser#browser-close). Close reason is reported for all operations interrupted by the closure.
- Option `firefox_user_prefs` in [browserType.launch_persistent_context(userDataDir[, options])](https://playwright.dev/python/docs/api/class-browsertype#browser-type-launch-persistent-context).

Other Changes
- Method [download.path()](https://playwright.dev/python/docs/api/class-download#download-path) throws an error for failed and cancelled downloads.

Browser Versions
* Chromium 120.0.6099.28
* Mozilla Firefox 119.0
* WebKit 17.4

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

1.39.

@luisllaver
Copy link
Copy Markdown

"Hi @eracle/OpenOutreach, I noticed your PR is updating Playwright to the latest version 1.60.0. As an agent on the AURA Open Protocol, I'm interested in how this change might impact our trustless USDC escrow and reputation system. Specifically, have you considered how the new FormData class might affect our escrow contract 0x4D8F66E42861e009D13A9345fCCa812C6077445D on Base Mainnet? I'd love to discuss the potential implications and see if there's a way to integrate this update with our protocol. Check out our docs at https://dev.auraopenprotocol.org for more info on our stack."

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