Releases: microsoft/playwright-python
v1.36.0
v1.35.0
Highlights
-
New option
mask_color
for methodsPage.screenshot()
andLocator.screenshot()
to change default masking color. -
New
uninstall
CLI command to uninstall browser binaries:$ playwright uninstall # remove browsers installed by this installation $ playwright uninstall --all # remove all ever-install Playwright browsers
Browser Versions
- Chromium 115.0.5790.13
- Mozilla Firefox 113.0
- WebKit 16.4
This version was also tested against the following stable channels:
- Google Chrome 114
- Microsoft Edge 114
v1.34.0
Highlights
-
New
Locator.and_
to create a locator that matches both locators.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:
from playwright.sync_api import expect expect.set_options(timeout=10_000)
-
New events
BrowserContext.on("console")
andBrowserContext.on("dialog")
to subscribe to any dialogs
and console messages from any page from the given browser context. Use the new propertiesConsoleMessage.page
andDialog.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
v1.33.0
Highlights
Locators Update
-
Use
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: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
andhas_not_text
inLocator.filter
to find elements that do not match certain conditions.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()
to ensure that the element
is present in the page's DOM. Do not confuse with theexpect(locator).to_be_visible()
that ensures that
element is both attached & visible.
New APIs
Locator.or
- New option
has_not
inLocator.filter
- New option
has_not_text
inLocator.filter
expect(locator).to_be_attached
- New option
timeout
inmethod: 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 usemcr.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
v1.32.1
v1.32.0
v1.32.0
New APIs
- Custom expect message, see test assertions documentation.
- Chaining existing locator objects, see locator docs for details.
- New options
update_mode
andupdate_content
inpage.route_from_har()
andbrowser_context.route_from_har()
. - New option
name
in methodtracing.start_chunk()
.
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
v1.31.1
Highlights
microsoft/playwright#21093 - [Regression v1.31] Headless Windows shows cascading cmd windows
Browser Versions
- Chromium 111.0.5563.19
- Mozilla Firefox 109.0
- WebKit 16.4
This version was also tested against the following stable channels:
- Google Chrome 110
- Microsoft Edge 110
v1.31.0
New APIs
-
New assertion
expect(locator).to_be_in_viewport()
ensures that locator points to an element that intersects viewport, according to the intersection observer API.from playwright.sync_api import expect locator = page.get_by_role("button") # Make sure at least some part of element intersects viewport. expect(locator).to_be_in_viewport() # Make sure element is fully outside of viewport. expect(locator).not_to_be_in_viewport() # Make sure that at least half of the element intersects viewport. expect(locator).to_be_in_viewport(ratio=0.5)
Miscellaneous
- DOM snapshots in trace viewer can be now opened in a separate window.
- New option
max_redirects
for methodRoute.fetch
. - Playwright now supports Debian 11 arm64.
Browser Versions
- Chromium 111.0.5563.19
- Mozilla Firefox 109.0
- WebKit 16.4
This version was also tested against the following stable channels:
- Google Chrome 110
- Microsoft Edge 110
v1.30.0
🎉 Happy New Year 🎉
Maintenance release with bugfixes and new browsers only.
Browser Versions
- Chromium 110.0.5481.38
- Mozilla Firefox 108.0.2
- WebKit 16.4
This version was also tested against the following stable channels:
- Google Chrome 109
- Microsoft Edge 109