github microsoft/playwright-dotnet 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:

    var newEmail = page.GetByRole(AriaRole.Button, new() { Name = "New" });
    var dialog = page.GetByText("Confirm security settings");
    await Expect(newEmail.Or(dialog)).ToBeVisibleAsync();
    if (await dialog.IsVisibleAsync())
      await page.GetByRole(AriaRole.Button, new() { Name = "Dismiss" }).ClickAsync();
    await newEmail.ClickAsync();
  • Use new options HasNot and HasNotText in Locator.Filter
    to find elements that do not match certain conditions.

    var rowLocator = page.Locator("tr");
    await rowLocator
        .Filter(new() { HasNotText = "text in column 1" })
        .Filter(new() { HasNot = page.GetByRole(AriaRole.Button, new() { Name = "column 2 button" }))
        .ScreenshotAsync();
  • Use new web-first assertion Expect().ToBeAttachedAsync() to ensure that the element
    is present in the page's DOM. Do not confuse with the Expect().ToBeVisibleAsync() that ensures that
    element is both attached & visible.

New APIs

⚠️ Breaking change

  • The mcr.microsoft.com/playwright/dotnet:v1.33.0 now serves a Playwright image based on Ubuntu Jammy.
    To use the focal-based image, please use mcr.microsoft.com/playwright/dotnet: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-dotnet release

NewReleases is sending notifications on new releases.