Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update playwright-dotnet monorepo #1649

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Sep 16, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
Microsoft.Playwright 1.19.0 -> 1.48.0 age adoption passing confidence
microsoft.playwright.cli 1.2.2 -> 1.2.3 age adoption passing confidence

Release Notes

microsoft/playwright-dotnet (Microsoft.Playwright)

v1.48.0

WebSocket routing

New methods Page.RouteWebSocketAsync() and BrowserContext.RouteWebSocketAsync() allow to intercept, modify and mock WebSocket connections initiated in the page. Below is a simple example that mocks WebSocket communication by responding to a "request" with a "response".

await page.RouteWebSocketAsync("/ws", ws => {
  ws.OnMessage(message => {
    if (message.Text == "request")
      ws.Send("response");
  });
});

See WebSocketRoute for more details.

UI updates

  • New "copy" buttons for annotations and test location in the HTML report.
  • Route method calls like Foute.FulfillAsync() are not shown in the report and trace viewer anymore. You can see which network requests were routed in the network tab instead.
  • New "Copy as cURL" and "Copy as fetch" buttons for requests in the network tab.

Miscellaneous

Browser Versions

  • Chromium 130.0.6723.19
  • Mozilla Firefox 130.0
  • WebKit 18.0

This version was also tested against the following stable channels:

  • Google Chrome 129
  • Microsoft Edge 129

v1.47.0

Network Tab improvements

The Network tab in the trace viewer has several nice improvements:

  • filtering by asset type and URL
  • better display of query string parameters
  • preview of font assets

Network tab now has filters

Miscellaneous

  • The mcr.microsoft.com/playwright/dotnet:v1.47.0 now serves a Playwright image based on Ubuntu 24.04 Noble.
    To use the 22.04 jammy-based image, please use mcr.microsoft.com/playwright/dotnet:v1.47.0-jammy instead.
  • The :latest/:focal/:jammy tag for Playwright Docker images is no longer being published. Pin to a specific version for better stability and reproducibility.
  • TLS client certificates can now be passed from memory by passing cert and key as byte arrays instead of file paths.
  • NoWaitAfter in locator.selectOption() was deprecated.
  • We've seen reports of WebGL in Webkit misbehaving on GitHub Actions macos-13. We recommend upgrading GitHub Actions to macos-14.

Browser Versions

  • Chromium 129.0.6668.29
  • Mozilla Firefox 130.0
  • WebKit 18.0

This version was also tested against the following stable channels:

  • Google Chrome 128
  • Microsoft Edge 128

v1.46.0

TLS Client Certificates

Playwright now allows to supply client-side certificates, so that server can verify them, as specified by TLS Client Authentication.

You can provide client certificates as a parameter of browser.NewContextAsync() and APIRequest.NewContextAsync(). The following snippet sets up a client certificate for https://example.com:

var context = await Browser.NewContextAsync(new() {
  ClientCertificates = [
    new() {
      Origin = "https://example.com",
      CertPath = "client-certificates/cert.pem",
      KeyPath = "client-certificates/key.pem",
    }
  ]
});

When using the MSTest or NUnit base-classes, these can be added by using the ContextOptions method.

Trace Viewer Updates

  • Content of text attachments is now rendered inline in the attachments pane.
  • New setting to show/hide routing actions like route.ContinueAsync().
  • Request method and status are shown in the network details tab.
  • New button to copy source file location to clipboard.
  • Metadata pane now displays the BaseURL.

Miscellaneous

Browser Versions

  • Chromium 128.0.6613.18
  • Mozilla Firefox 128.0
  • WebKit 18.0

This version was also tested against the following stable channels:

  • Google Chrome 127
  • Microsoft Edge 127

v1.45.1

Highlights

https://github.com/microsoft/playwright-java/issues/1617 - [Bug]: Trace Viewer not reporting all actionshttps://github.com/microsoft/playwright/issues/317644 - [Bug]: some actions do not appear in the trace file

Browser Versions

  • Chromium 127.0.6533.5
  • Mozilla Firefox 127.0
  • WebKit 17.4

This version was also tested against the following stable channels:

  • Google Chrome 126
  • Microsoft Edge 126

v1.45.0

Clock

Utilizing the new Clock API allows to manipulate and control time within tests to verify time-related behavior. This API covers many common scenarios, including:

  • testing with predefined time;
  • keeping consistent time and timers;
  • monitoring inactivity;
  • ticking through time manually.
// Initialize clock with some time before the test time and let the page load naturally.
// `Date.now` will progress as the timers fire.
await Page.Clock.InstallAsync(new()
{
  TimeDate = new DateTime(2024, 2, 2, 8, 0, 0)
});
await Page.GotoAsync("http://localhost:3333");

// Pretend that the user closed the laptop lid and opened it again at 10am.
// Pause the time once reached that point.
await Page.Clock.PauseAtAsync(new DateTime(2024, 2, 2, 10, 0, 0));

// Assert the page state.
await Expect(Page.GetByTestId("current-time")).ToHaveTextAsync("2/2/2024, 10:00:00 AM");

// Close the laptop lid again and open it at 10:30am.
await Page.Clock.FastForwardAsync("30:00");
await Expect(Page.GetByTestId("current-time")).ToHaveTextAsync("2/2/2024, 10:30:00 AM");

See the clock guide for more details.

Miscellaneous

  • Method locator.setInputFiles() now supports uploading a directory for <input type=file webkitdirectory> elements.
    await page.GetByLabel("Upload directory").SetInputFilesAsync("mydir");
  • Multiple methods like locator.click() or locator.press() now support a ControlOrMeta modifier key. This key maps to Meta on macOS and maps to Control on Windows and Linux.
    // Press the common keyboard shortcut Control+S or Meta+S to trigger a "Save" operation.
    await page.Keyboard.PressAsync("ControlOrMeta+S");
  • New property httpCredentials.send in apiRequest.newContext() that allows to either always send the Authorization header or only send it in response to 401 Unauthorized.
  • Playwright now supports Chromium, Firefox and WebKit on Ubuntu 24.04.
  • v1.45 is the last release to receive WebKit update for macOS 12 Monterey. Please update macOS to keep using the latest WebKit.

Browser Versions

  • Chromium 127.0.6533.5
  • Mozilla Firefox 127.0
  • WebKit 17.4

This version was also tested against the following stable channels:

  • Google Chrome 126
  • Microsoft Edge 126

v1.44.0

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

v1.43.0

New APIs

  • Method BrowserContext.ClearCookiesAsync() now supports filters to remove only some cookies.

    // Clear all cookies.
    await Context.ClearCookiesAsync();
    // New: clear cookies with a particular name.
    await Context.ClearCookiesAsync(new() { Name = "session-id" });
    // New: clear cookies for a particular domain.
    await Context.ClearCookiesAsync(new() { Domain = "my-origin.com" });
  • New property Locator.ContentFrame converts a Locator object to a FrameLocator. This can be useful when you have a Locator object obtained somewhere, and later on would like to interact with the content inside the frame.

    var locator = Page.Locator("iframe[name='embedded']");
    // ...
    var frameLocator = locator.ContentFrame;
    await frameLocator.GetByRole(AriaRole.Button).ClickAsync();
  • New property FrameLocator.Owner converts a FrameLocator object to a Locator. This can be useful when you have a FrameLocator object obtained somewhere, and later on would like to interact with the iframe element.

    var frameLocator = page.FrameLocator("iframe[name='embedded']");
    // ...
    var locator = frameLocator.Owner;
    await Expect(locator).ToBeVisibleAsync();

Browser Versions

  • Chromium 124.0.6367.8
  • Mozilla Firefox 124.0
  • WebKit 17.4

This version was also tested against the following stable channels:

  • Google Chrome 123
  • Microsoft Edge 123

v1.42.0

New Locator Handler

New method page.addLocatorHandler(locator, handler, handler, handler) registers a callback that will be invoked when specified element becomes visible and may block Playwright actions. The callback can get rid of the overlay. Here is an example that closes a cookie dialog when it appears.

// Setup the handler.
await Page.AddLocatorHandlerAsync(
    Page.GetByRole(AriaRole.Heading, new() { Name = "Hej! You are in control of your cookies." }),
    async () =>
    {
        await Page.GetByRole(AriaRole.Button, new() { Name = "Accept all" }).ClickAsync();
    });
// Write the test as usual.
await Page.GotoAsync("https://www.ikea.com/");
await Page.GetByRole(AriaRole.Link, new() { Name = "Collection of blue and white" }).ClickAsync();
await Expect(Page.GetByRole(AriaRole.Heading, new() { Name = "Light and easy" })).ToBeVisibleAsync();

New APIs

Announcements

  • ⚠️ Ubuntu 18 is not supported anymore.

Browser Versions

  • Chromium 123.0.6312.4
  • Mozilla Firefox 123.0
  • WebKit 17.4

This version was also tested against the following stable channels:

  • Google Chrome 122
  • Microsoft Edge 123

v1.41.2

Highlights

https://github.com/microsoft/playwright/issues/29067 - [REGRESSION] Codegen/Recorder: not all clicks are being actioned nor recordedhttps://github.com/microsoft/playwright/issues/290199 - [REGRESSION] trace.playwright.dev does not currently support the loading from URL

Browser Versions

  • Chromium 121.0.6167.57
  • Mozilla Firefox 121.0
  • WebKit 17.4

This version was also tested against the following stable channels:

  • Google Chrome 120
  • Microsoft Edge 120

v1.41.1

Highlights

Browser Versions

  • Chromium 121.0.6167.57
  • Mozilla Firefox 121.0
  • WebKit 17.4

This version was also tested against the following stable channels:

  • Google Chrome 120
  • Microsoft Edge 120

v1.41.0

New APIs

Browser Versions

  • Chromium 121.0.6167.57
  • Mozilla Firefox 121.0
  • WebKit 17.4

This version was also tested against the following stable channels:

  • Google Chrome 120
  • Microsoft Edge 120

v1.40.0

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

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

Trace Viewer Updates

Playwright Trace Viewer

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

New APIs

  • [BrowserContext.WebError][BrowserContext.WebError]
  • [Locator.PressSequentiallyAsync()][Locator.PressSequentiallyAsync()]

Deprecations

  • The following methods were deprecated: [Page.TypeAsync()][Page.TypeAsync()], [Frame.TypeAsync()][Frame.TypeAsync()], [Locator.TypeAsync()][Locator.TypeAsync()] and [ElementHandle.TypeAsync()][ElementHandle.TypeAsync()].
    Please use [Locator.FillAsync()][Locator.FillAsync()] instead which is much faster. Use [Locator.PressSequentiallyAsync()][Locator.PressSequentiallyAsync()] only if there is a
    special keyboard handling on the page, and you need to press keys one-by-one.
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

Fixes:

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

v1.37.0

📚 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

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

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

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

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

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

v1.31.1

Highlights

https://github.com/microsoft/playwright/issues/21093 - [Regression v1.31] Headless Windows shows cascading cmd windows

Browser Versions

  • Chromium 111.0.5563.19
  • Mozilla Firefox 109.0
  • WebKit 16.4

This version was also tested against the following stable channels:

  • Google Chrome 110
  • Microsoft Edge 110

v1.31.0

New APIs

Miscellaneous

  • DOM snapshots in trace viewer can be now opened in a separate window.
  • New option MaxRedirects for method Route.FetchAsync.
  • Playwright now supports Debian 11 arm64.

Browser Versions

  • Chromium 111.0.5563.19
  • Mozilla Firefox 109.0
  • WebKit 16.4

This version was also tested against the following stable channels:

  • Google Chrome 110
  • Microsoft Edge 110

v1.30.0

🎉 Happy New Year 🎉

Maintenance release with bugfixes and new browsers only.

Browser Versions
  • Chromium 110.0.5481.38
  • Mozilla Firefox 108.0.2
  • WebKit 16.4

This version was also tested against the following stable channels:

  • Google Chrome 109
  • Microsoft Edge 109

v1.29.0

Highlights

New APIs
  • New method Route.FetchAsync and new option Json for Route.FulfillAsync:

    await Page.RouteAsync("**/api/settings", async route => {
      // Fetch original settings.
      var response = await route.FetchAsync();
      // Force settings theme to a predefined value.
      var json = await response.JsonAsync<MyDataType>();
      json.Theme = "Solarized";
      // Fulfill with modified data.
      await route.FulfillAsync(new() {
        Json = json
      });
    });
  • New method Locator.AllAsync to iterate over all matching elements:

    // Check all checkboxes!
    var checkboxes = Page.Locator("role=checkbox");
    foreach (var checkbox in await checkboxes.AllAsync())
      await checkbox.CheckAsync();
  • Locator.SelectOptionAsync matches now by value or label:

    <select multiple>
      <option value="red">Red</div>
      <option value="green">Green</div>
      <option value="blue">Blue</div>
    </select>
    await element.SelectOptionAsync("Red");
Browser Versions
  • Chromium 109.0.5414.46
  • Mozilla Firefox 107.0
  • WebKit 16.4

This version was also tested against the following stable channels:

  • Google Chrome 108
  • Microsoft Edge 108

v1.28.0

Highlights

Playwright Tools
  • Live Locators in CodeGen. Generate a locator for any element on the page using "Explore" tool.

Locator Explorer

New APIs
Browser Versions
  • Chromium 108.0.5359.29
  • Mozilla Firefox 106.0
  • WebKit 16.4

This version was also tested against the following stable channels:

  • Google Chrome 107
  • Microsoft Edge 107

v1.27.2

Highlights

This patch release includes the following bug fixes:

https://github.com/microsoft/playwright-dotnet/issues/2345 - [BUG] No Name prop in class PageGetByRoleOptions

Browser Versions

  • Chromium 107.0.5304.18
  • Mozilla Firefox 105.0.1
  • WebKit 16.0

This version was also tested against the following stable channels:

  • Google Chrome 106
  • Microsoft Edge 106

v1.27.1

Highlights

This patch release includes the following bug fixes:

https://github.com/microsoft/playwright/pull/18010 - fix(generator): generate nice locators for arbitrary selectors
https://github.com/microsoft/playwright/issues/17960 - [BUG] Codegen 1.27 creates NUnit code that does not compilehttps://github.com/microsoft/playwright/pull/179522 - fix: fix typo in treeitem role typing

Browser Versions

  • Chromium 107.0.5304.18
  • Mozilla Firefox 105.0.1
  • WebKit 16.0

This version was also tested against the following stable channels:

  • Google Chrome 106
  • Microsoft Edge 106

v1.27.0

Highlights

Locators

With these new APIs writing locators is a joy:

await Page.GetByLabel("User Name").FillAsync("John");

await Page.GetByLabel("Password").FillAsync("secret-password");

await Page.GetByRole("button", new() { Name = "Sign in" }).ClickAsync();

await Expect(Page.GetByText("Welcome, John!")).ToBeVisibleAsync();

All the same methods are also available on Locator, FrameLocator and Frame classes.

Other highlights
  • As announced in v1.25, Ubuntu 18 will not be supported as of Dec 2022. In addition to that, there will be no WebKit updates on Ubuntu 18 starting from the next Playwright release.
Behavior Changes
  • Expect(Locator).ToHaveAttributeAsync(name, value, options) with an empty value does not match missing attribute anymore. For example, the following snippet will succeed when button does not have a disabled attribute.

    await Expect(page.GetByRole("button")).ToHaveAttribute("disabled", "");
Browser Versions
  • Chromium 107.0.5304.18
  • Mozilla Firefox 105.0.1
  • WebKit 16.0

This version was also tested against the following stable channels:

  • Google Chrome 106
  • Microsoft Edge 106

v1.26.0

Highlights

Assertions
Other highlights
  • New option MaxRedirects for ApiRequestContext.GetAsync(url, options) and others to limit redirect count.
  • Codegen now supports NUnit and MSTest frameworks.
  • ASP .NET is now supported (via packages.config)
Behavior Change

A bunch of Playwright APIs already support the WaitUntil: WaitUntilState.DOMContentLoaded option. For example:

await Page.GotoAsync("https://playwright.dev", new() { WaitUntil = WaitUntilState.DOMContentLoaded });

Prior to 1.26, this would wait for all iframes to fire the DOMContentLoaded event.

To align with web specification, the WaitUntilState.DOMContentLoaded value only waits for the target frame to fire the 'DOMContentLoaded' event. Use WaitUntil: WaitUntilState.Load to wait for all iframes.

Browser Versions
  • Chromium 106.0.5249.30
  • Mozilla Firefox 104.0
  • WebKit 16.0

This version was also tested against the following stable channels:

  • Google Chrome 105
  • Microsoft Edge 105

v1.25.0

Highlights

New .runsettings file support

Microsoft.Playwright.NUnit and Microsoft.Playwright.MSTest will now consider the .runsettings file and passed settings via the CLI when running end-to-end tests. See in the documentation for a full list of supported settings.

The following does now work:

<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
  <!-- Playwright -->  
  <Playwright>
    <BrowserName>chromium</BrowserName>
    <ExpectTimeout>5000</ExpectTimeout>
    <LaunchOptions>
      <Headless>true</Headless>
      <Channel>msedge</Channel>
    </LaunchOptions>
  </Playwright>
  <!-- General run configuration -->
  <RunConfiguration>
    <EnvironmentVariables>
      <!-- For debugging selectors, it's recommend to set the following environment variable -->
      <DEBUG>pw:api</DEBUG>
    </EnvironmentVariables>
  </RunConfiguration>
</RunSettings>
Announcements
  • 🪦 This is the last release with macOS 10.15 support (deprecated as of 1.21).
  • ⚠️ Ubuntu 18 is now deprecated and will not be supported as of Dec 2022.
Browser Versions
  • Chromium 105.0.5195.19
  • Mozilla Firefox 103.0
  • WebKit 16.0

This version was also tested against the following stable channels:

  • Google Chrome 104
  • Microsoft Edge 104

v1.24.1

Highlights

This patch includes the following bug fixes:

https://github.com/microsoft/playwright-dotnet/issues/2231 - [REGRESSION] HEADLESS env does not work anymore
https://github.com/microsoft/playwright-dotnet/issues/2232 - [BUG] - Install MS Edge fails

Browser Versions

  • Chromium 104.0.5112.48
  • Mozilla Firefox 102.0
  • WebKit 16.0

This version was also tested against the following stable channels:

  • Google Chrome 103
  • Microsoft Edge 103

v1.24.0

Highlights

🐂 Debian 11 Bullseye Support

Playwright now supports Debian 11 Bullseye on x86_64 for Chromium, Firefox and WebKit. Let us know
if you encounter any issues!

Linux support looks like this:

Ubuntu 18.04 Ubuntu 20.04 Ubuntu 22.04 Debian 11
Chromium
WebKit
Firefox
📖 New Introduction Docs

We rewrote our Getting Started docs to be more end-to-end testing focused. Check them out on playwright.dev.

Browser Versions

  • Chromium 104.0.5112.48
  • Mozilla Firefox 102.0
  • WebKit 16.0

This version was also tested against the following stable channels:

  • Google Chrome 103
  • Microsoft Edge 103

v1.23.0

Highlights

API Testing

Playwright for .NET 1.23 introduces new API Testing that lets you send requests to the server directly from .NET!
Now you can:

  • test your server API
  • prepare server side state before visiting the web application in a test
  • validate server side post-conditions after running some actions in the browser

To do a request on behalf of Playwright's Page, use new Page.APIRequest API:

// Do a GET request on behalf of page
var response = await Page.APIRequest.GetAsync("http://example.com/foo.json");
Console.WriteLine(response.Status);
Console.WriteLine(response.StatusText);
Console.WriteLine(response.Ok);
Console.WriteLine(response.Headers["Content-Type"]);
Console.WriteLine(await response.TextAsync());
Console.WriteLine((await response.JsonAsync())?.GetProperty("foo").GetString());

Read more about it in our API testing guide.

Network Replay

Now you can record network traffic into a HAR file and re-use this traffic in your tests.

To record network into HAR file:

pwsh bin\Debug\netX\playwright.ps1 open --save-har=example.har --save-har-glob="**/api/**" https://example.com

Alternatively, you can record HAR programmatically:

var context = await browser.NewContextAsync(new ()
{
  RecordHarPath = harPath,
  RecordHarUrlFilterString = "**/api/**",
});

// ... Perform actions ...

// Close context to ensure HAR is saved to disk.
context.CloseAsync();

Use the new methods Page.RouteFromHARAsync or BrowserContext.RouteFromHARAsync to serve matching responses from the HAR file:

await context.RouteFromHARAsync("example.har");

Read more in our documentation.

Advanced Routing

You can now use Route.FallbackAsync to defer routing to other handlers.

Consider the following example:

// Remove a header from all requests.
await page.RouteAsync("**/*", async route =>
{
    var headers = route.Request.Headers;
    headers.Remove("X-Secret");
    await route.ContinueAsync(new () { Headers = headers });
});

// Abort all images.
await page.RouteAsync("**/*", async route =>
{
    if (route.Request.ResourceType == "image")
    {
        await route.AbortAsync();
    }
    else
    {
        await route.FallbackAsync();
    }
});

Note that the new methods Page.RouteFromHARAsync and BrowserContext.RouteFromHARAsync also participate in routing and could be deferred to.

Web-First Assertions Update

Miscellaneous
  • If there's a service worker that's in your way, you can now easily disable it with a new context option ServiceWorkers:
    var context = await Browser.NewContextAsync(new()
    {
        ServiceWorkers = ServiceWorkerPolicy.Block
    });
  • Using .zip path for recordHar context option automatically zips the resulting HAR:
    var context = await Browser.NewContextAsync(new() { RecordHarPath = "example.har.zip" });
  • If you intend to edit HAR by hand, consider using the "minimal" HAR recording mode
    that only records information that is essential for replaying:
    var context = await Browser.NewContextAsync(new() { RecordHarPath = "example.har", RecordHarMode = HarMode.Minimal });
  • Playwright now runs on Ubuntu 22 amd64 and Ubuntu 22 arm64.
  • Playwright for .NET now supports linux-arm64 and provides a arm64 Ubuntu 20.04 Docker image for it.

v1.22.0

Highlights

  • Role selectors that allow selecting elements by their ARIA role, ARIA attributes and accessible name.

    // Click a button with accessible name "log in"
    await page.ClickAsync("role=button[name='log in']")

    Read more in our documentation.

  • New Locator.Filter API to filter an existing locator

    var buttons = page.Locator("role=button");
    // ...
    var submitLocator = buttons.Filter(new LocatorFilterOptions { HasText = "Sign up" });
    await submitLocator.ClickAsync();

v1.21.0

Highlights
  • New experimental role selectors that allow selecting elements by their ARIA role, ARIA attributes and accessible name.

    // Click a button with accessible name "log in"
    await page.ClickAsync("role=button[name='log in']")

    To use role selectors, make sure to pass PLAYWRIGHT_EXPERIMENTAL_FEATURES=1 environment variable.

    Read more in our documentation.

  • New scale option in Page.ScreenshotAsync for smaller sized screenshots.

  • New caret option in Page.ScreenshotAsync to control text caret. Defaults to "hide".

  • We now ship a designated .NET docker image mcr.microsoft.com/playwright/dotnet. Read more in our documentation.

Behavior Changes
Browser Versions
  • Chromium 101.0.4951.26
  • Mozilla Firefox 98.0.2
  • WebKit 15.4

This version was also tested against the following stable channels:

  • Google Chrome 100
  • Microsoft Edge 100

v1.20.2

Highlights

This patch includes the following bug fixes:

https://github.com/microsoft/playwright/issues/12711 - [REGRESSION] Page.screenshot hangs on some siteshttps://github.com/microsoft/playwright/issues/128077 - [BUG] Cookies get assigned before fulfilling a responshttps://github.com/microsoft/playwright/issues/1282121 - [BUG] Chromium: Cannot click, element intercepts pointer evenhttps://github.com/microsoft/playwright/issues/12887887 - [BUG] Locator.count() with _vue selector with Rhttps://github.com/microsoft/playwright/issues/1297412974 - [BUG] Regression - chromium browser closes during test or debugging session on https://github.com/microsoft/playwright-dotnet/issues/2074s/2074 - [BUG] NullReferenceException in Connection.WrapApiCalhttps://github.com/microsoft/playwright-dotnet/issues/2069es/2069 - [BUG] dotnet build did not override files

Browser Versions

  • Chromium 101.0.4921.0
  • Mozilla Firefox 97.0.1
  • WebKit 15.4

This version was also tested against the following stable channels:

  • Google Chrome 99
  • Microsoft Edge 99

v1.20.1

Highlights

This patch includes bug fixes for the following issues:

https://github.com/microsoft/playwright-dotnet/pull/2067 - [BUG] Running Playwright without a namespace lead to a null pointer exception

Browser Versions

  • Chromium 101.0.4921.0
  • Mozilla Firefox 97.0.1
  • WebKit 15.4

This version was also tested against the following stable channels:

  • Google Chrome 99
  • Microsoft Edge 99

v1.20.0

Web-First Assertions

Playwright for .NET 1.20 introduces Web-First Assertions.

Consider the following example:

using System.Threading.Tasks;
using Microsoft.Playwright.NUnit;
using NUnit.Framework;

namespace Playwright.TestingHarnessTest.NUnit
{
    public class ExampleTests : PageTest
    {
        [Test]
        public async Task StatusBecomesSubmitted()
        {
            await Expect(Page.Locator(".status")).ToHaveTextAsync("Submitted");
        }
    }
}

Playwright will be re-testing the node with the selector .status until
fetched Node has the "Submitted" text. It will be re-fetching the node and
checking it over and over, until the condition is met or until the timeout is
reached. You can pass this timeout as an option.

Read more in our documentation.

Other Updates


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/playwright-dotnet-monorepo branch 2 times, most recently from e70999f to 1c11adc Compare October 21, 2024 15:16
@renovate renovate bot force-pushed the renovate/playwright-dotnet-monorepo branch 2 times, most recently from 8c1a8cf to a066e1e Compare November 4, 2024 15:31
@renovate renovate bot force-pushed the renovate/playwright-dotnet-monorepo branch 2 times, most recently from 7d4b731 to 86f04b7 Compare November 13, 2024 13:54
@renovate renovate bot force-pushed the renovate/playwright-dotnet-monorepo branch from 86f04b7 to 63cfea7 Compare November 13, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants