Skip to content

Releases: microsoft/playwright-python

v1.31.1

27 Feb 17:52
ebf9ed4
Compare
Choose a tag to compare

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

21 Feb 22:45
Compare
Choose a tag to compare

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 method Route.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

25 Jan 16:29
Compare
Choose a tag to compare

🎉 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

v1.29.1

04 Jan 14:34
7d646d0
Compare
Choose a tag to compare

Bugfixes

  • fix: fulfill with json in #1701

v1.29.0

21 Dec 23:49
af2a06b
Compare
Choose a tag to compare

Highlights

New APIs

  • New method Route.fetch and new option json for Route.fulfill:

    def handle_route(route: Route):
      # Fetch original settings.
      response = route.fetch()
      # Force settings theme to a predefined value.
      json = response.json()
      json["theme"] = "Solorized"
      # Fulfill with modified data.
      route.fulfill(json=json)
    page.route("**/api/settings", handle_route)
  • New method Locator.all to iterate over all matching elements:

    # Check all checkboxes!
    checkboxes = page.get_by_role("checkbox")
    for checkbox in checkboxes.all():
      checkbox.check()
  • Locator.select_option matches now by value or label:

    <select multiple>
      <option value="red">Red</div>
      <option value="green">Green</div>
      <option value="blue">Blue</div>
    </select>
    element.select_option("Red")

Miscellaneous

Browser Versions

  • Chromium 109.0.5414.46
  • Mozilla Firefox 107.0
  • WebKit 16.4

This version was also tested against the following stable channels:

  • Google Chrome 108
  • Microsoft Edge 108

v1.28.0

16 Nov 22:15
e25107b
Compare
Choose a tag to compare

Highlights

Playwright Tools

  • Live Locators in CodeGen. Generate a locator for any element on the page using "Explore" tool.

Locator Explorer

New APIs

Browser Versions

  • Chromium 108.0.5359.29
  • Mozilla Firefox 106.0
  • WebKit 16.4

This version was also tested against the following stable channels:

  • Google Chrome 107
  • Microsoft Edge 107

v1.27.1

12 Oct 17:18
2b4e1ef
Compare
Choose a tag to compare

Highlights

This patch release includes the following bug fixes:

microsoft/playwright#18010 - fix(generator): generate nice locators for arbitrary selectors
microsoft/playwright#17952 - fix: fix typo in treeitem role typing

Browser Versions

  • Chromium 107.0.5304.18
  • Mozilla Firefox 105.0.1
  • WebKit 16.0

This version was also tested against the following stable channels:

  • Google Chrome 106
  • Microsoft Edge 106

v1.27.0

07 Oct 23:20
66f7f3a
Compare
Choose a tag to compare

Locators

With these new APIs, inspired by Testing Library, writing locators is a joy:

page.get_by_label("User Name").fill("John")

page.get_by_label("Password").fill("secret-password")

page.get_by_role("button", name="Sign in").click()

expect(page.get_by_text("Welcome, John!")).to_be_visible()

All the same methods are also available on Locator, FrameLocator and Frame classes.

Other highlights

  • As announced in v1.25, Ubuntu 18 will not be supported as of Dec 2022. In addition to that, there will be no WebKit updates on Ubuntu 18 starting from the next Playwright release.

Behavior Changes

  • expect(locator).to_have_attribute(name, value) with an empty value does not match missing attribute anymore. For example, the following snippet will succeed when button does not have a disabled attribute.

    expect(page.get_by_role("button")).to_have_attribute("disabled", "")

Browser Versions

  • Chromium 107.0.5304.18
  • Mozilla Firefox 105.0.1
  • WebKit 16.0

This version was also tested against the following stable channels:

  • Google Chrome 106
  • Microsoft Edge 106

v1.26.1

28 Sep 19:11
6765aa0
Compare
Choose a tag to compare

Bugfixes

v1.26.0

20 Sep 23:36
e9c9a0e
Compare
Choose a tag to compare

Highlights

Assertions

Other highlights

Behavior Change

A bunch of Playwright APIs already support the wait_until: "domcontentloaded" option.
For example:

page.goto("https://playwright.dev", wait_until="domcontentloaded")

Prior to 1.26, this would wait for all iframes to fire the DOMContentLoaded
event.

To align with web specification, the 'domcontentloaded' value only waits for
the target frame to fire the 'DOMContentLoaded' event. Use wait_until="load" to wait for all iframes.

Browser Versions

  • Chromium 106.0.5249.30
  • Mozilla Firefox 104.0
  • WebKit 16.0

This version was also tested against the following stable channels:

  • Google Chrome 105
  • Microsoft Edge 105