Skip to content

v1.44.0

Compare
Choose a tag to compare
@yury-s yury-s released this 17 May 21:31
af2dd24

New APIs

Accessibility assertions

Locator handler

  • After executing the handler added with page.addLocatorHandler(), 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 setNoWaitAfter option.
  • You can use new setTimes option in page.addLocatorHandler() to specify maximum number of times the handler should be run.
  • The handler in page.addLocatorHandler() now accepts the locator as argument.
  • New page.removeLocatorHandler() method for removing previously added locator handlers.
Locator locator = page.getByText("This interstitial covers the button");
page.addLocatorHandler(locator, overlay -> {
  overlay.locator("#close").click();
}, new Page.AddLocatorHandlerOptions().setTimes(3).setNoWaitAfter(true));
// Run your tests that can be interrupted by the overlay.
// ...
page.removeLocatorHandler(locator);

Miscellaneous options

  • New method formData.append() allows to specify repeating fields with the same name in setMultipart option in RequestOptions:

    FormData formData = FormData.create();
    formData.append("file", new FilePayload("f1.js", "text/javascript",
    "var x = 2024;".getBytes(StandardCharsets.UTF_8)));
    formData.append("file", new FilePayload("f2.txt", "text/plain",
      "hello".getBytes(StandardCharsets.UTF_8)));
    APIResponse response = context.request().post("https://example.com/uploadFile", RequestOptions.create().setMultipart(formData));
  • expect(page).toHaveURL(url) now supports setIgnoreCase 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