Skip to content

v1.44.0

Compare
Choose a tag to compare
@mxschmitt mxschmitt released this 17 May 10:06

New APIs

Accessibility assertions

  • Expect(locator).ToHaveAccessibleNameAsync() checks if the element has the specified accessible name:

    var locator = Page.GetByRole(AriaRole.Button);
    await Expect(locator).ToHaveAccessibleNameAsync("Submit");
  • Expect(locator).ToHaveAccessibleDescriptionAsync() checks if the element has the specified accessible description:

    var locator = Page.GetByRole(AriaRole.Button);
    await Expect(locator).ToHaveAccessibleDescriptionAsync("Upload a photo");
  • Expect(locator).ToHaveRoleAsync() checks if the element has the specified ARIA role:

    var locator = Page.GetByTestId("save-button");
    await Expect(locator).ToHaveRoleAsync(AriaRole.Button);

Locator handler

var locator = Page.GetByText("This interstitial covers the button");
await Page.AddLocatorHandlerAsync(locator, async (overlay) =>
{
    await overlay.Locator("#close").ClickAsync();
}, new() { Times = 3, NoWaitAfter = true });
// Run your tests that can be interrupted by the overlay.
// ...
await Page.RemoveLocatorHandlerAsync(locator);

Miscellaneous options

  • Multipart option in APIRequestContext.FetchAsync() supports now repeating fields with the same name using formData.append():

    var formData = Context.APIRequest.CreateFormData();
    formData.Append("file", new FilePayload()
    {
        Name = "f1.js",
        MimeType = "text/javascript",
        Buffer = System.Text.Encoding.UTF8.GetBytes("var x = 2024;")
    });
    formData.Append("file", new FilePayload()
    {
        Name = "f2.txt",
        MimeType = "text/plain",
        Buffer = System.Text.Encoding.UTF8.GetBytes("hello")
    });
    var response = await Context.APIRequest.PostAsync("https://example.com/uploadFiles", new() { Multipart = formData });
  • Expect(page).ToHaveURLAsync() now supports IgnoreCase 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