Playwright

Latest version: v1.44.0

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

Scan your dependencies

Page 10 of 17

1.15.2

Highlights

This patch includes bug fixes for the following issues:

https://github.com/microsoft/playwright/issues/9065 - [BUG] browser(webkit): disable COOP support
https://github.com/microsoft/playwright/issues/9092 - [BUG] browser(webkit): fix text padding

Browser Versions

- Chromium 96.0.4641.0
- Mozilla Firefox 92.0
- WebKit 15.0

This version of Playwright was also tested against the following stable channels:

- Google Chrome 93
- Microsoft Edge 93

---

1.15.1

Highlights

This patch includes bug fixes for the following issues:

https://github.com/microsoft/playwright/pull/8955 - [BUG] fix(inspector): stop on all snapshottable actions
https://github.com/microsoft/playwright/pull/8999 - [BUG] fix: do not dedup header values
https://github.com/microsoft/playwright/pull/9038 - [BUG] fix: restore support for slowmo connect option

Browser Versions

- Chromium 96.0.4641.0
- Mozilla Firefox 92.0
- WebKit 15.0

This version of Playwright was also tested against the following stable channels:

- Google Chrome 93
- Microsoft Edge 93

1.15.0

🖱️ Mouse Wheel

By using [`Page.mouse.wheel`](https://playwright.dev/python/docs/api/class-mouse#mouse-wheel) you are now able to scroll vertically or horizontally.

📜 New Headers API

Previously it was not possible to get multiple header values of a response. This is now possible and additional helper functions are available:

- [Request.all_headers()](https://playwright.dev/python/docs/api/class-request#request-all-headers)
- [Request.headers_array()](https://playwright.dev/python/docs/api/class-request#request-headers-array)
- [Request.header_value(name: str)](https://playwright.dev/python/docs/api/class-request#request-header-value)
- [Response.all_headers()](https://playwright.dev/python/docs/api/class-response#response-all-headers)
- [Response.headers_array()](https://playwright.dev/python/docs/api/class-response#response-headers-array)
- [Response.header_value(name: str)](https://playwright.dev/python/docs/api/class-response#response-header-value)
- [Response.header_values(name: str)](https://playwright.dev/python/docs/api/class-response/#response-header-values)

🌈 Forced-Colors emulation

Its now possible to emulate the `forced-colors` CSS media feature by passing it in the [context options](https://playwright.dev/python/docs/api/class-browser#browser-new-context-option-forced-colors) or calling [Page.emulate_media()](https://playwright.dev/python/docs/api/class-page#page-emulate-media).

New APIs

- [Page.route()](https://playwright.dev/python/docs/api/class-page#page-route) accepts new `times` option to specify how many times this route should be matched.
- [Page.set_checked(selector: str, checked: bool)](https://playwright.dev/python/docs/api/class-page#page-set-checked) and [Locator.set_checked(selector: str, checked: bool)](https://playwright.dev/python/docs/api/class-locator#locator-set-checked) was introduced to set the checked state of a checkbox.
- [Request.sizes()](https://playwright.dev/python/docs/api/class-request#request-sizes) Returns resource size information for given http request.
- [BrowserContext.tracing.start_chunk()](https://playwright.dev/python/docs/api/class-tracing#tracing-start-chunk) - Start a new trace chunk.
- [BrowserContext.tracing.stop_chunk()](https://playwright.dev/python/docs/api/class-tracing#tracing-stop-chunk) - Stops a new trace chunk.

Browser Versions

- Chromium 96.0.4641.0
- Mozilla Firefox 92.0
- WebKit 15.0

This version of Playwright was also tested against the following stable channels:

- Google Chrome 93
- Microsoft Edge 93

1.14.1

Highlights

This patch includes bug fixes for the following issues:

microsoft/playwright8287 - [BUG] webkit crashes intermittently: "file data stream has an unexpected number of bytes"
microsoft/playwright8281 - [BUG] HTML report crashes if diff snapshot does not exists
microsoft/playwright8230 - Using React Selectors with multiple React trees
microsoft/playwright8366 - [BUG] Mark timeout in isVisible as deprecated and noop

Browser Versions

- Chromium 94.0.4595.0
- Mozilla Firefox 91.0
- WebKit 15.0

This version of Playwright was also tested against the following stable channels:

- Google Chrome 92
- Microsoft Edge 92

1.14.0

⚡️ New "strict" mode

Selector ambiguity is a common problem in automation testing. **"strict" mode**
ensures that your selector points to a single element and throws otherwise.

Pass `strict = true` into your action calls to opt in.

py
This will throw if you have more than one button!
page.click('button', strict=true)


📍 New [**Locators API**](https://playwright.dev/python/docs/api/class-locator)

Locator represents a view to the element(s) on the page. It captures the logic sufficient to retrieve the element at any given moment.

The difference between the [Locator](https://playwright.dev/python/docs/api/class-locator) and [ElementHandle](https://playwright.dev/python/docs/api/class-elementhandle) is that the latter points to a particular element, while [Locator](https://playwright.dev/python/docs/api/class-locator) captures the logic of how to retrieve that element.

Also, locators are **"strict" by default**!

py
locator = page.locator('button')
locator.click()


Learn more in the [documentation](https://playwright.dev/python/docs/api/class-locator).

🧩 Experimental [**React**](https://playwright.dev/python/docs/selectors#react-selectors) and [**Vue**](https://playwright.dev/python/docs/selectors#vue-selectors) selector engines

React and Vue selectors allow selecting elements by its component name and/or property values. The syntax is very similar to [attribute selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors) and supports all attribute selector operators.

py
page.click('_react=SubmitButton[enabled=true]')
page.click('_vue=submit-button[enabled=true]')


Learn more in the [react selectors documentation](https://playwright.dev/python/docs/selectors#react-selectors) and the [vue selectors documentation](https://playwright.dev/python/docs/selectors#vue-selectors).

✨ New [**`nth`**](https://playwright.dev/python/docs/selectors#n-th-element-selector) and [**`visible`**](https://playwright.dev/python/docs/selectors#selecting-visible-elements) selector engines

- [`nth`](https://playwright.dev/python/docs/selectors#n-th-element-selector) selector engine is equivalent to the `:nth-match` pseudo class, but could be combined with other selector engines.
- [`visible`](https://playwright.dev/python/docs/selectors#selecting-visible-elements) selector engine is equivalent to the `:visible` pseudo class, but could be combined with other selector engines.

py
select the first button among all buttons
button.click('button >> nth=0')
or if you are using locators, you can use first(), nth() and last()
page.locator('button').first().click()

click a visible button
button.click('button >> visible=true')


Browser Versions

- Chromium 94.0.4595.0
- Mozilla Firefox 91.0
- WebKit 15.0

This version of Playwright was also tested against the following stable channels:

- Google Chrome 92
- Microsoft Edge 92

1.13.1

Highlights

This patch includes bug fixes for the following issues:

823 - [Bug]: Warning of `Future exception was never retrieved` when `expect_*` gets used and throws inside the context manager
820 - [Bug]: `wait_for_load_state("networkidle")` was not working
812 - [Bug]: added hooks for pyinstaller

Browser Versions

- Chromium 93.0.4576.0
- Mozilla Firefox 90.0
- WebKit 14.2

Page 10 of 17

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.