github microsoft/playwright-python v1.33.0

latest releases: v1.47.0, v1.46.0, v1.45.1...
17 months ago

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 and has_not_text in Locator.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 the expect(locator).to_be_visible() that ensures that
    element is both attached & visible.

New APIs

⚠️ 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

Don't miss a new playwright-python release

NewReleases is sending notifications on new releases.