Releases: microsoft/playwright-dotnet
v1.31.1
Highlights
microsoft/playwright#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
-
New assertion
Expect(locator).ToBeInViewportAsync()
ensures that locator points to an element that intersects viewport, according to the intersection observer API.var locator = Page.GetByRole(AriaRole.Button); // Make sure at least some part of element intersects viewport. await Expect(locator).ToBeInViewportAsync(); // Make sure element is fully outside of viewport. await Expect(locator).Not.ToBeInViewportAsync(); // Make sure that at least half of the element intersects viewport. await Expect(locator).ToBeInViewportAsync(new() { Ratio = 0.5 });
-
New methods
BrowserContext.NewCDPSessionAsync(Page)
andBrowser.NewBrowserCDPSessionAsync()
create a Chrome DevTools Protocol session for the page and browser respectively.
Miscellaneous
- DOM snapshots in trace viewer can be now opened in a separate window.
- New option
MaxRedirects
for methodRoute.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 optionJson
forRoute.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.
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:
#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:
microsoft/playwright#18010 - fix(generator): generate nice locators for arbitrary selectors
microsoft/playwright#17960 - [BUG] Codegen 1.27 creates NUnit code that does not compile
microsoft/playwright#17952 - 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:
- Page.GetByText(text, options) to locate by text content.
- Page.GetByRole(role, options) to locate by ARIA role, ARIA attributes and accessible name.
- Page.GetByLabel(text, options) to locate a form control by associated label's text.
- Page.GetByPlaceholder(text, options) to locate an input by placeholder.
- Page.GetByAltText(text, options)e to locate an element, usually image, by its text alternative.
- Page.GetByTitle(text, options) to locate an element by its title.
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 adisabled
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
- New option
Enabled
for Expect(Locator).ToBeEnabledAsync(options). - Expect(Locator).ToHaveTextAsync(expected, options) now pierces open shadow roots.
- New option
Editable
for Expect(Locator).ToBeEditableAsync(options). - New option
Visible
for Expect(Locator).ToBeVisibleAsync(options). - Expect(ApiResponse).ToBeOKAsync() is now available.
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