Skip to content

Releases: microsoft/playwright-dotnet

v1.40.0

21 Nov 21:56
cbef904
Compare
Choose a tag to compare

Test Generator Update

Playwright Test Generator

New tools to generate assertions:

Here is an example of a generated test with assertions:

await Page.GotoAsync("https://playwright.dev/");
await Page.GetByRole(AriaRole.Link, new() { Name = "Get started" }).ClickAsync();
await Expect(Page.GetByLabel("Breadcrumbs").GetByRole(AriaRole.List)).ToContainTextAsync("Installation");
await Expect(Page.GetByLabel("Search")).ToBeVisibleAsync();
await Page.GetByLabel("Search").ClickAsync();
await Page.GetByPlaceholder("Search docs").FillAsync("locator");
await Expect(Page.GetByPlaceholder("Search docs")).ToHaveValueAsync("locator");

New APIs

Other Changes

Potential breaking changes

When using Microsoft.Playwright.MSTest or Microsoft.Playwright.NUnit, Locale and ColorScheme were taken from the operating system as a default. After v1.40, its now aligned with Playwright for Node.js to en-US and light. In order to opt-in for the previous behaviour, the ContextOptions method can be overidden.

using Microsoft.Playwright.NUnit;

namespace PlaywrightTests;

[Parallelizable(ParallelScope.Self)]
[TestFixture]
public class MyTest : PageTest
{
    public override BrowserNewContextOptions ContextOptions()
    {
        return new BrowserNewContextOptions()
        {
            Locale = "en-GB",
            ColorScheme = ColorScheme.Light,
        };
    }
}

Browser Versions

  • Chromium 120.0.6099.28
  • Mozilla Firefox 119.0
  • WebKit 17.4

This version was also tested against the following stable channels:

  • Google Chrome 119
  • Microsoft Edge 119

v1.39.0

16 Oct 08:53
eade3f5
Compare
Choose a tag to compare

Evergreen browsers update.

Browser Versions

  • Chromium 119.0.6045.9
  • Mozilla Firefox 118.0.1
  • WebKit 17.4

This version was also tested against the following stable channels:

  • Google Chrome 118
  • Microsoft Edge 118

v1.38.0

19 Sep 09:33
Compare
Choose a tag to compare

Trace Viewer Updates

Playwright Trace Viewer

  1. Zoom into time range.
  2. Network panel redesign.

New APIs

Deprecations

Browser Versions

  • Chromium 117.0.5938.62
  • Mozilla Firefox 117.0
  • WebKit 17.0

This version was also tested against the following stable channels:

  • Google Chrome 116
  • Microsoft Edge 116

v1.37.1

16 Aug 08:26
5400658
Compare
Choose a tag to compare

Fixes:

  • [REGRESSION]: Playwright.CreateAsync() did not work in applications without a Console. (#2663)

v1.37.0

14 Aug 17:43
Compare
Choose a tag to compare

📚 Debian 12 Bookworm Support

Playwright now supports Debian 12 Bookworm on both x86_64 and arm64 for Chromium, Firefox and WebKit.
Let us know if you encounter any issues!

Linux support looks like this:

Ubuntu 20.04 Ubuntu 22.04 Debian 11 Debian 12
Chromium
WebKit
Firefox

Browser Versions

  • Chromium 116.0.5845.82
  • Mozilla Firefox 115.0
  • WebKit 17.0

This version was also tested against the following stable channels:

  • Google Chrome 115
  • Microsoft Edge 115

v1.36.0

14 Jul 17:29
b768b4d
Compare
Choose a tag to compare

Highlights

🏝️ Summer maintenance release.

Browser Versions

  • Chromium 115.0.5790.75
  • Mozilla Firefox 115.0
  • WebKit 17.0

This version was also tested against the following stable channels:

  • Google Chrome 114
  • Microsoft Edge 114

v1.35.0

13 Jun 07:40
ca7b02a
Compare
Choose a tag to compare

Highlights

  • New option MaskColor for methods Page.screenshot() and Locator.screenshot() to change default masking color.

  • New uninstall CLI command to uninstall browser binaries:

    $ pwsh bin/Debug/netX/playwright.ps1 uninstall # remove browsers installed by this installation
    $ pwsh bin/Debug/netX/playwright.ps1 uninstall --all # remove all ever-install Playwright browsers

Browser Versions

  • Chromium 115.0.5790.13
  • Mozilla Firefox 113.0
  • WebKit 16.4

This version was also tested against the following stable channels:

  • Google Chrome 114
  • Microsoft Edge 114

v1.34.0

26 May 22:31
e629971
Compare
Choose a tag to compare

Highlights

Browser Versions

  • Chromium 114.0.5735.26
  • Mozilla Firefox 113.0
  • WebKit 16.4

This version was also tested against the following stable channels:

  • Google Chrome 113
  • Microsoft Edge 113

v1.33.0

03 May 14:19
e195255
Compare
Choose a tag to compare

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

v1.32.0

27 Mar 20:45
eb9a43b
Compare
Choose a tag to compare

v1.32.0

New APIs

Browser Versions

  • Chromium 112.0.5615.29
  • Mozilla Firefox 111.0
  • WebKit 16.4

This version was also tested against the following stable channels:

  • Google Chrome 111
  • Microsoft Edge 111