v1.44.0
New APIs
Accessibility assertions
-
expect(locator).to_have_accessible_name() checks if the element has the specified accessible name:
locator = page.get_by_role("button") expect(locator).to_have_accessible_name("Submit")
-
expect(locator).to_have_accessible_description() checks if the element has the specified accessible description:
locator = page.get_by_role("button") expect(locator).to_have_accessible_description("Upload a photo")
-
expect(locator).to_have_role() checks if the element has the specified ARIA role:
locator = page.get_by_test_id("save-button") expect(locator).to_have_role("button")
Locator handler
- After executing the handler added with page.add_locator_handler(), Playwright will now wait until the overlay that triggered the handler is not visible anymore. You can opt-out of this behavior with the new
no_wait_after
option. - You can use new
times
option in page.add_locator_handler() to specify maximum number of times the handler should be run. - The handler in page.add_locator_handler() now accepts the locator as argument.
- New page.remove_locator_handler() method for removing previously added locator handlers.
locator = page.get_by_text("This interstitial covers the button")
page.add_locator_handler(locator, lambda overlay: overlay.locator("#close").click(), times=3, no_wait_after=True)
# Run your tests that can be interrupted by the overlay.
# ...
page.remove_locator_handler(locator)
Miscellaneous options
- expect(page).to_have_url() now supports
ignore_case
option.
Browser Versions
- Chromium 125.0.6422.14
- Mozilla Firefox 125.0.1
- WebKit 17.4
This version was also tested against the following stable channels:
- Google Chrome 124
- Microsoft Edge 124