Playwright

Latest version: v1.49.0

Safety actively analyzes 682457 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 8 of 32

1.34

Browser Versions

* Chromium 114.0.5735.26
* Mozilla Firefox 113.0
* WebKit 16.4

This version was also tested against the following stable channels:

* Google Chrome 113
* Microsoft Edge 113

1.34.0

Highlights

* New [`Locator.and_`](https://playwright.dev/python/docs/api/class-locator#locator-and) to create a locator that matches both locators.

python
button = page.get_by_role("button").and_(page.get_by_title("Subscribe"))


* Its now possible to set a global expect timeout and change the 5 second default:

python
from playwright.sync_api import expect

expect.set_options(timeout=10_000)


* New events [`BrowserContext.on("console")`](https://playwright.dev/python/docs/api/class-browsercontext#browser-context-event-console) and [`BrowserContext.on("dialog")`](https://playwright.dev/python/docs/api/class-browsercontext#browser-context-event-dialog) to subscribe to any dialogs
and console messages from any page from the given browser context. Use the new properties [`ConsoleMessage.page`](https://playwright.dev/python/docs/api/class-consolemessage#console-message-page)
and [`Dialog.page`](https://playwright.dev/python/docs/api/class-dialog#dialog-page) to pin-point event source.

Browser Versions

* Chromium 114.0.5735.26
* Mozilla Firefox 113.0
* WebKit 16.4

This version was also tested against the following stable channels:

* Google Chrome 113
* Microsoft Edge 113

1.33.0

Highlights

Locators Update

* Use [`Locator.or_`](https://playwright.dev/python/docs/api/class-locator#locator-or) to create a locator that matches either of the two locators.
Consider a scenario where you'd like to click on a "New email" button, but sometimes a security settings dialog shows up instead.
In this case, you can wait for either a "New email" button, or a dialog and act accordingly:

python
new_email = page.get_by_role("button", name="New email")
dialog = page.get_by_text("Confirm security settings")
expect(new_email.or_(dialog)).is_visible()
if (dialog.is_visible())
page.get_by_role("button", name="Dismiss").click()
new_email.click()

* Use new options [`has_not`](https://playwright.dev/python/docs/api/class-locator#locator-filter-option-has-not) and [`has_not_text`](https://playwright.dev/python/docs/api/class-locator#locator-filter-option-has-not-text) in [`Locator.filter`](https://playwright.dev/python/docs/api/class-locator#locator-filter)
to find elements that **do not match** certain conditions.

python
row_locator = page.locator("tr")
row_locator
.filter(has_not_text="text in column 1")
.filter(has_not=page.get_by_role("button", name="column 2 button"))
.screenshot()

* Use new web-first assertion [`expect(locator).to_be_attached()`](https://playwright.dev/python/docs/api/class-locatorassertions#locator-assertions-to-be-attached) to ensure that the element
is present in the page's DOM. Do not confuse with the [`expect(locator).to_be_visible()`](https://playwright.dev/python/docs/api/class-locatorassertions#locator-assertions-to-be-visible) that ensures that
element is both attached & visible.

New APIs

- [`Locator.or`](https://playwright.dev/python/docs/api/class-locator#locator-or)
- New option [`has_not`](https://playwright.dev/python/docs/api/class-locator#locator-filter-option-has-not) in [`Locator.filter`](https://playwright.dev/python/docs/api/class-locator#locator-filter)
- New option [`has_not_text`](https://playwright.dev/python/docs/api/class-locator#locator-filter-option-has-not-text) in [`Locator.filter`](https://playwright.dev/python/docs/api/class-locator#locator-filter)
- [`expect(locator).to_be_attached`](https://playwright.dev/python/docs/api/class-locatorassertions#locator-assertions-to-be-attached)
- New option [`timeout`](https://playwright.dev/python/docs/api/class-route#route-fetch-option-timeout) in [`method: Route.fetch`](https://playwright.dev/python/docs/api/class-route#route-fetch)

⚠️ Breaking change

* The `mcr.microsoft.com/playwright/python:v1.33.0` now serves a Playwright image based on Ubuntu Jammy.
To use the focal-based image, please use `mcr.microsoft.com/playwright/python:v1.33.0-focal` instead.

Browser Versions

* Chromium 113.0.5672.53
* Mozilla Firefox 112.0
* WebKit 16.4

This version was also tested against the following stable channels:

* Google Chrome 112
* Microsoft Edge 112

1.32.3

Highlights

https://github.com/microsoft/playwright/issues/22144 - [BUG] WebServer only starting after timeout
https://github.com/microsoft/playwright/pull/22191 - chore: allow reusing browser between the tests
https://github.com/microsoft/playwright/issues/22215 - [BUG] Tests failing in toPass often marked as passed

Browser Versions

* Chromium 112.0.5615.29
* Mozilla Firefox 111.0
* WebKit 16.4

This version was also tested against the following stable channels:

* Google Chrome 111
* Microsoft Edge 111

1.32.2

Highlights

https://github.com/microsoft/playwright/issues/21993 - [BUG] Browser crash when using Playwright VSC extension and trace-viewer enabled in config
https://github.com/microsoft/playwright/issues/22003 - [Feature] Make Vue component mount props less restrictive
https://github.com/microsoft/playwright/issues/22089 - [REGRESSION]: Tests failing with "Error: tracing.stopChunk"

Browser Versions

* Chromium 112.0.5615.29
* Mozilla Firefox 111.0
* WebKit 16.4

This version was also tested against the following stable channels:

* Google Chrome 111
* Microsoft Edge 111

1.32.1

Bugfixes

* [BUG]: fix: discard trace without path did not work in https://github.com/microsoft/playwright-python/pull/1836

Page 8 of 32

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.