Releases: microsoft/playwright-dotnet
v0.180.0
Driver Update
Driver updated to v.1.8.0. These are the outstanding changes:
- Selecting elements based on layout with
:left-of(),:right-of(),:above()and:below() SelectOptionAsyncnow waits for the options to be present
New APIs
ElementHandle.IsCheckedAsync()ElementHandle.IsDisabledAsync()ElementHandle.IsEditableAsync()ElementHandle.IsEnabledAsync()ElementHandle.IsHiddenAsync()ElementHandle.IsVisibleAsync()Page.IsCheckedAsync(selector, timeout)Page.IsDisabledAsync(selector, timeout)Page.IsEditableAsync(selector, timeout)Page.IsEnabledAsync(selector, timeout)Page.IsHiddenAsync(selector, timeout)Page.IsVisibleAsync(selector, timeout)- New enum item
EditableinElementHandle.WaitForElementStateAsync.
Breaking Changes
We are still tweaking the API so we can offer the same experience across all bindings. These are the changes we had to make in this release:
ExtraHttpHeadersproperties were renamed toExtraHTTPHeaders.SetExtraHttpHeadersAsyncmethod was renamed toSetExtraHTTPHeadersAsync.firefoxUserPrefswas removed from launch persistent options.
Changelog
v0.170.2
v0.170.1
v0.170.0
Driver update
Driver updated to v.0.170.0. See playwright changelog v1.7.0.
New APIs
- New method
BrowserContext.GetStorageStateAsync()to get current state for later reuse. - New options where added to
Browser.NewContextAsyncandBrowser.NewPageAsync.- proxy: Network proxy settings to use with this context.
- storageState: Populates context with given storage state.
- storageStatePath: Loads a storage state from a JSON file.
Possible breaking changes
- a388277 If you use
AddScriptTagAsyncwith named arguments thecontentargument was renamed toscript. - a388277 If you use
AddStyleTagAsyncwith named arguments thecontentargument was renamed tostyle.
Changelog
- 4487dee Fixed Response.Ok. It should return true if the HttpStatusCode is between 200 and 299.
- 857d919 Improved error message if browsers are missing.
- e45ef99 Added close reason in transport exceptions.
- 5b0ad49 Improved driver deploy on Xamarin.Mac apps.
- c8425a9 Improved driver deploy on Mono.
- 3d04eaa Fixed WebSocketEventArgs.WebSocket visibility.
- 8fa18ee Fixed ChromiumBrowserType overloads.
v0.162.1
v0.162.0
Major Changes
Driver updated to v.0.162.1. See playwright changelog: v1.6.0, v1.6.1 and v1.6.2.
Driver and browser install refactor.
Playwright Driver
Playwright drivers will be copied to the bin folder at build time. Nuget will rely on the RuntimeIdentifier to copy a platform-specific driver, or on the runtime used on dotnet publish.
If the RuntimeIdentifier is not set, all runtimes will be copied inside a runtimes folder. Then, the platform-specific driver will be picked at run-time.
Browsers
The way browsers are installed will vary depending on the use case scenario.
Playwright in test projects
If you use Playwright in test projects, all required browsers will be installed at build time.
Using Playwright in Docker
If you use the official Docker images, all the required browsers will be installed in that image.
The minor version of the package will tell you which docker image tag to use. For instance, PlaywrightSharp 0.162.0 will work with the tag v1.6.2.
Using Playwright in a Remote Server.
If you run Playwright in a remote server. For instance, as part of a web application, you will need to run .\bin\playwright-cli.exe install in Windows or ./bin/playwright-cli install in OSX/Linux as part of your deploy script.
New APIs
- 4679039
BrowserContextOptionswas implemented to receive a DeviceDescription in the constructor. - e6aee6c New Request.Timing.
- c5a86d6 New
recordVideoargument in BrowserContext creation. - c5a86d6 New
recordHARargument in BrowserContext creation. - 93cb3f4 Use Page.Websocket event and the new WebSocket class to inspect WebSocket connections.
- c9ab521 Introduce TapAsync.
await using var context = await _browser.NewContextAsync(new BrowserContextOptions(Playwright.Devices["iPhone 6"])
{
TimezoneId = "America/Jamaica",
Locale = "fr-CH",
UserAgent = "UA",
});Breaking Changes
- c1809ae
WaitForEventmethods were renamed toWaitForEventAsync. - ee860a8 Request.GetPostDataJsonAsync was renamed to Request.GetPostDataJson.
Changelog
v0.152.0
v0.151.0
New Features
Video screencasts API is now stable: Use the videosPath option while creating browser contexts to record videos for all pages within the context.
// With browser.NewContextAsync()
var context = await browser.NewContextAsync(videosPath: "videos/");
// With browser.NewPageAsync()
var page = await browser.NewPageAsync(videosPath: "videos/");
// [Optional] Specify video size; defaults to viewport size
var context = await browser.NewContextAsync(
videosPath: "videos/",
videoSize: new ViewportSize { Width = 800, Height = 600 }
);New APIs
Browser.NewPageAsync(),Browser.NewContextAsync()andBrowserType.LaunchPersistentContextAsync()now supportvideosPathandvideoSizeoption.- New
Page.Videoproperty. - New
Videoclass - New
BrowserContext.Browserproperty. - Both
BrowserContext.ExposeBindingAsync()andPage.ExposeBindingAsync()now accept aFunc<BindingSource, IJSHandle, TResult>to receivedIJSHandleinstead of of serialized values.