chore: Update playwright-dotnet monorepo #1649
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.19.0
->1.48.0
1.2.2
->1.2.3
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"
.See WebSocketRoute for more details.
UI updates
Miscellaneous
Browser Versions
This version was also tested against the following stable channels:
v1.47.0
Network Tab improvements
The Network tab in the trace viewer has several nice improvements:
Miscellaneous
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.:latest
/:focal
/:jammy
tag for Playwright Docker images is no longer being published. Pin to a specific version for better stability and reproducibility.cert
andkey
as byte arrays instead of file paths.NoWaitAfter
in locator.selectOption() was deprecated.macos-13
. We recommend upgrading GitHub Actions tomacos-14
.Browser Versions
This version was also tested against the following stable channels:
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
:When using the MSTest or NUnit base-classes, these can be added by using the ContextOptions method.
Trace Viewer Updates
BaseURL
.Miscellaneous
MaxRetries
option in apiRequestContext.FetchAsync() which retries on theECONNRESET
network error.Browser Versions
This version was also tested against the following stable channels:
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
This version was also tested against the following stable channels:
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:
See the clock guide for more details.
Miscellaneous
<input type=file webkitdirectory>
elements.ControlOrMeta
modifier key. This key maps toMeta
on macOS and maps toControl
on Windows and Linux.httpCredentials.send
in apiRequest.newContext() that allows to either always send theAuthorization
header or only send it in response to401 Unauthorized
.Browser Versions
This version was also tested against the following stable channels:
v1.44.0
New APIs
Accessibility assertions
Expect(locator).ToHaveAccessibleNameAsync() checks if the element has the specified accessible name:
Expect(locator).ToHaveAccessibleDescriptionAsync() checks if the element has the specified accessible description:
Expect(locator).ToHaveRoleAsync() checks if the element has the specified ARIA role:
Locator handler
NoWaitAfter
option.Times
option in page.AddLocatorHandlerAsync() to specify maximum number of times the handler should be run.Miscellaneous options
Multipart
option inAPIRequestContext.FetchAsync()
supports now repeating fields with the same name using formData.append():Expect(page).ToHaveURLAsync() now supports
IgnoreCase
option.Browser Versions
This version was also tested against the following stable channels:
v1.43.0
New APIs
Method BrowserContext.ClearCookiesAsync() now supports filters to remove only some cookies.
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.
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.Browser Versions
This version was also tested against the following stable channels:
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.
New APIs
tagged
andoutline
.Announcements
Browser Versions
This version was also tested against the following stable channels:
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
This version was also tested against the following stable channels:
v1.41.1
Highlights
Browser Versions
This version was also tested against the following stable channels:
v1.41.0
New APIs
style
in page.ScreenshotAsync() and locator.ScreenshotAsync() to add custom CSS to the page before taking a screenshot.Browser Versions
This version was also tested against the following stable channels:
v1.40.0
Test Generator Update
New tools to generate assertions:
Here is an example of a generated test with assertions:
New APIs
Reason
in Page.CloseAsync([options]), BrowserContext.CloseAsync([options]) and Browser.CloseAsync([options]). Close reason is reported for all operations interrupted by the closure.FirefoxUserPrefs
in browserType.launchPersistentContext(userDataDir[, options]).Other Changes
Potential breaking changes
When using
Microsoft.Playwright.MSTest
orMicrosoft.Playwright.NUnit
,Locale
andColorScheme
were taken from the operating system as a default. After v1.40, its now aligned with Playwright for Node.js toen-US
andlight
. In order to opt-in for the previous behaviour, theContextOptions
method can be overidden.Browser Versions
This version was also tested against the following stable channels:
v1.39.0
Evergreen browsers update.
Browser Versions
This version was also tested against the following stable channels:
v1.38.0
Trace Viewer Updates
New APIs
BrowserContext.WebError
][BrowserContext.WebError]Locator.PressSequentiallyAsync()
][Locator.PressSequentiallyAsync()]Deprecations
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 aspecial keyboard handling on the page, and you need to press keys one-by-one.
Browser Versions
This version was also tested against the following stable channels:
v1.37.1
Fixes:
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:
Browser Versions
This version was also tested against the following stable channels:
v1.36.0
Highlights
🏝️ Summer maintenance release.
Browser Versions
This version was also tested against the following stable channels:
v1.35.0
Highlights
New option
MaskColor
for methodsPage.screenshot()
andLocator.screenshot()
to change default masking color.New
uninstall
CLI command to uninstall browser binaries:Browser Versions
This version was also tested against the following stable channels:
v1.34.0
Highlights
New
Locator.And
to create a locator that matches both locators.New events
BrowserContext.Console
andBrowserContext.Dialog
to subscribe to any dialogsand console messages from any page from the given browser context. Use the new methods
ConsoleMessage.Page
and
Dialog.Page
to pin-point event source.Browser Versions
This version was also tested against the following stable channels:
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:
Use new options
HasNot
andHasNotText
inLocator.Filter
to find elements that do not match certain conditions.
Use new web-first assertion
Expect().ToBeAttachedAsync()
to ensure that the elementis present in the page's DOM. Do not confuse with the
Expect().ToBeVisibleAsync()
that ensures thatelement is both attached & visible.
New APIs
Locator.Or
HasNot
inLocator.Filter
HasNotText
inLocator.Filter
Expect().ToBeAttachedAsync
Timeout
inRoute.FetchAsync
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
This version was also tested against the following stable channels:
v1.32.0
v1.32.0
New APIs
UpdateMode
andUpdateContent
inPage.RouteFromHARAsync()
andBrowserContext.RouteFromHARAsync()
.Name
in methodTracing.StartChunkAsync()
.Browser Versions
This version was also tested against the following stable channels:
v1.31.1
Highlights
https://github.com/microsoft/playwright/issues/21093 - [Regression v1.31] Headless Windows shows cascading cmd windows
Browser Versions
This version was also tested against the following stable channels:
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.New methods
BrowserContext.NewCDPSessionAsync(Page)
andBrowser.NewBrowserCDPSessionAsync()
create a Chrome DevTools Protocol session for the page and browser respectively.Miscellaneous
MaxRedirects
for methodRoute.FetchAsync
.Browser Versions
This version was also tested against the following stable channels:
v1.30.0
🎉 Happy New Year 🎉
Maintenance release with bugfixes and new browsers only.
Browser Versions
This version was also tested against the following stable channels:
v1.29.0
Highlights
New APIs
New method
Route.FetchAsync
and new optionJson
forRoute.FulfillAsync
:New method
Locator.AllAsync
to iterate over all matching elements:Locator.SelectOptionAsync
matches now by value or label:Browser Versions
This version was also tested against the following stable channels:
v1.28.0
Highlights
Playwright Tools
New APIs
method: Locator.blur
method: Locator.clear
Browser Versions
This version was also tested against the following stable channels:
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
This version was also tested against the following stable channels:
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
This version was also tested against the following stable channels:
v1.27.0
Highlights
Locators
With these new APIs writing locators is a joy:
All the same methods are also available on Locator, FrameLocator and Frame classes.
Other highlights
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.Browser Versions
This version was also tested against the following stable channels:
v1.26.0
Highlights
Assertions
Enabled
for Expect(Locator).ToBeEnabledAsync(options).Editable
for Expect(Locator).ToBeEditableAsync(options).Visible
for Expect(Locator).ToBeVisibleAsync(options).Other highlights
MaxRedirects
for ApiRequestContext.GetAsync(url, options) and others to limit redirect count.packages.config
)Behavior Change
A bunch of Playwright APIs already support the
WaitUntil: WaitUntilState.DOMContentLoaded
option. For example: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. UseWaitUntil: WaitUntilState.Load
to wait for all iframes.Browser Versions
This version was also tested against the following stable channels:
v1.25.0
Highlights
New .runsettings file support
Microsoft.Playwright.NUnit
andMicrosoft.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:
Announcements
Browser Versions
This version was also tested against the following stable channels:
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 anymorehttps://github.com/microsoft/playwright-dotnet/issues/2232 - [BUG] - Install MS Edge fails
Browser Versions
This version was also tested against the following stable channels:
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:
📖 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
This version was also tested against the following stable channels:
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:
To do a request on behalf of Playwright's Page, use new
Page.APIRequest
API: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:
Alternatively, you can record HAR programmatically:
Use the new methods
Page.RouteFromHARAsync
orBrowserContext.RouteFromHARAsync
to serve matching responses from the HAR file:Read more in our documentation.
Advanced Routing
You can now use
Route.FallbackAsync
to defer routing to other handlers.Consider the following example:
Note that the new methods
Page.RouteFromHARAsync
andBrowserContext.RouteFromHARAsync
also participate in routing and could be deferred to.Web-First Assertions Update
LocatorAssertions.ToHaveValuesAsync
that asserts all selected values of<select multiple>
element.LocatorAssertions.ToContainTextAsync
andLocatorAssertions.ToHaveTextAsync
now acceptIgnoreCase
option.Miscellaneous
ServiceWorkers
:.zip
path forrecordHar
context option automatically zips the resulting HAR:"minimal"
HAR recording modethat only records information that is essential for replaying:
v1.22.0
Highlights
Role selectors that allow selecting elements by their ARIA role, ARIA attributes and accessible name.
Read more in our documentation.
New
Locator.Filter
API to filter an existing locatorv1.21.0
Highlights
New experimental role selectors that allow selecting elements by their ARIA role, ARIA attributes and accessible name.
To use role selectors, make sure to pass
PLAYWRIGHT_EXPERIMENTAL_FEATURES=1
environment variable.Read more in our documentation.
New
scale
option inPage.ScreenshotAsync
for smaller sized screenshots.New
caret
option inPage.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
Locator.SetInputFilesAsync
API.Browser Versions
This version was also tested against the following stable channels:
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
This version was also tested against the following stable channels:
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
This version was also tested against the following stable channels:
v1.20.0
Web-First Assertions
Playwright for .NET 1.20 introduces Web-First Assertions.
Consider the following example:
Playwright will be re-testing the node with the selector
.status
untilfetched Node has the
"Submitted"
text. It will be re-fetching the node andchecking 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
page.screenshot()
,locator.screenshot()
andelementHandle.screenshot()
:ScreenshotAnimations.Disabled
reConfiguration
📅 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.
This PR was generated by Mend Renovate. View the repository job log.