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
andHasNotText
inLocator.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 theExpect().ToBeVisibleAsync()
that ensures that
element is both attached & visible.
New APIs
Locator.Or
- New option
HasNot
inLocator.Filter
- New option
HasNotText
inLocator.Filter
Expect().ToBeAttachedAsync
- New option
Timeout
inRoute.FetchAsync
⚠️ 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 usemcr.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