Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

| | Linux | macOS | Windows |
| :--- | :---: | :---: | :---: |
| Chromium <!-- GEN:chromium-version -->149.0.7827.55<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| Chromium <!-- GEN:chromium-version -->151.0.7922.34<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| WebKit <!-- GEN:webkit-version -->26.5<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| Firefox <!-- GEN:firefox-version -->151.0<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| Firefox <!-- GEN:firefox-version -->153.0<!-- GEN:stop --> | ✅ | ✅ | ✅ |

Playwright for .NET is the official language port of [Playwright](https://playwright.dev), the library to automate [Chromium](https://www.chromium.org/Home), [Firefox](https://www.mozilla.org/en-US/firefox/new/) and [WebKit](https://webkit.org/) with a single API. Playwright is built to enable cross-browser web automation that is **ever-green**, **capable**, **reliable** and **fast**.

Expand Down
7 changes: 6 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ function download_driver() {
function roll_driver() {
new_driver_version="$1"
upstream_package_version=$(node -e "console.log(require('${upstream_repo_path}/package.json').version)")
new_node_version=$(sed -n 's/^NODE_VERSION="\([^"]*\)".*/\1/p' "${upstream_repo_path}/utils/build/build-playwright-driver.sh")
new_node_version=$(curl -fsSL "https://nodejs.org/dist/index.json" \
| node -e "let s='';process.stdin.on('data',d=>s+=d).on('end',()=>console.log(JSON.parse(s).find(r=>r.lts).version.slice(1)))")
if [[ -z "${new_node_version}" ]]; then
echo "Failed to determine the Node.js version for driver ${new_driver_version}"
exit 1
fi
echo "Rolling .NET driver to driver ${new_driver_version} (Node.js ${new_node_version}) and upstream version ${upstream_package_version}..."

xml_file_path="./src/Common/Version.props"
Expand Down
8 changes: 4 additions & 4 deletions src/Common/Version.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<PropertyGroup>
<AssemblyVersion>1.61.0</AssemblyVersion>
<PackageVersion>$(AssemblyVersion)</PackageVersion>
<DriverVersion>1.61.1-beta-1782139630000</DriverVersion>
<!-- The Node.js version bundled with the driver. Kept in sync with NODE_VERSION
in upstream's utils/build/build-playwright-driver.sh by the roll script. -->
<DriverNodeVersion>24.16.0</DriverNodeVersion>
<DriverVersion>1.62.0</DriverVersion>
<!-- The Node.js version bundled with the driver. Set by the roll script to the latest
Node.js LTS, matching upstream's utils/build/update-playwright-node.mjs. -->
<DriverNodeVersion>24.18.1</DriverNodeVersion>
<ReleaseVersion>$(AssemblyVersion)</ReleaseVersion>
<FileVersion>$(AssemblyVersion)</FileVersion>
<NoDefaultExcludes>true</NoDefaultExcludes>
Expand Down
52 changes: 26 additions & 26 deletions src/Playwright.TestingHarnessTest/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Playwright.TestingHarnessTest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "playwright.testingharnesstest",
"private": true,
"devDependencies": {
"@playwright/test": "1.61.1-beta-1782139630000",
"@playwright/test": "1.62.0",
"@types/node": "^22.12.0",
"fast-xml-parser": "^4.5.0"
}
Expand Down
2 changes: 1 addition & 1 deletion src/Playwright.Tests/PageNetworkResponseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public async Task ShouldReturnSecurityDetails()
var response = await Page.GotoAsync(HttpsServer.EmptyPage);
var details = await response.SecurityDetailsAsync();

var name = "puppeteer-tests";
var name = TestConstants.IsWebKit && TestConstants.IsWindows ? "true" : "puppeteer-tests";
Assert.AreEqual(name, details.SubjectName);
if (TestConstants.IsWebKit)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Playwright.Tests/PageScreenshotTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ public async Task ShouldWorkWhileNavigating()
{
try
{
await Page.ScreenshotAsync();
await Page.ScreenshotAsync(new() { FullPage = true });
}
catch (Exception ex) when (ex.Message.Contains("Cannot take a screenshot while page is navigating"))
{
Expand Down
4 changes: 1 addition & 3 deletions src/Playwright.Tests/WorkersTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,7 @@ public async Task ShouldFormatNumberUsingContextLocale()
page.WaitForWorkerAsync(),
page.EvaluateAsync("() => new Worker(URL.createObjectURL(new Blob(['console.log(1)'], {type: 'application/javascript'})))"));

// https://github.com/microsoft/playwright/issues/38919
var expected = TestConstants.IsFirefox ? "10,000.2" : "10\u00A0000,2";
Assert.AreEqual(expected, await worker.EvaluateAsync<string>("() => (10000.20).toLocaleString()"));
Assert.AreEqual("10\u00A0000,2", await worker.EvaluateAsync<string>("() => (10000.20).toLocaleString()"));
}

[PlaywrightTest("workers.spec.ts", "should report console event on the worker")]
Expand Down
2 changes: 2 additions & 0 deletions src/Playwright/API/Generated/Enums/ScreenshotType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ public enum ScreenshotType
Png,
[EnumMember(Value = "jpeg")]
Jpeg,
[EnumMember(Value = "webp")]
Webp,
}
35 changes: 35 additions & 0 deletions src/Playwright/API/Generated/Enums/ScrollMode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* MIT License
*
* Copyright (c) Microsoft Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

using System.Runtime.Serialization;

namespace Microsoft.Playwright;

public enum ScrollMode
{
[EnumMember(Value = "auto")]
Auto,
[EnumMember(Value = "none")]
None,
}
12 changes: 12 additions & 0 deletions src/Playwright/API/Generated/IAPIResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,18 @@ public partial interface IAPIResponse
/// <summary><para>Returns the text representation of response body.</para></summary>
Task<string> TextAsync();

/// <summary>
/// <para>
/// Returns resource timing information for given response. For redirected requests,
/// returns the information for the last request in the redirect chain. When the response
/// is served <a href="https://playwright.dev/dotnet/docs/mock#replaying-from-har">from
/// the HAR file</a>, timing information is not available and all the values are -1.
/// Find more information at <a href="https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming">Resource
/// Timing API</a>.
/// </para>
/// </summary>
RequestTimingResult Timing { get; }

/// <summary><para>Contains the URL of the response.</para></summary>
string Url { get; }
}
8 changes: 5 additions & 3 deletions src/Playwright/API/Generated/IBrowserContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1010,16 +1010,18 @@ public partial interface IBrowserContext
/// <summary>
/// <para>
/// Returns storage state for this browser context, contains current cookies, local
/// storage snapshot and IndexedDB snapshot.
/// storage snapshot, IndexedDB snapshot and virtual WebAuthn credentials.
/// </para>
/// </summary>
/// <param name="options">Call options</param>
Task<string> StorageStateAsync(BrowserContextStorageStateOptions? options = default);

/// <summary>
/// <para>
/// Clears the existing cookies, local storage and IndexedDB entries for all origins
/// and sets the new storage state.
/// Clears the existing cookies, local storage, IndexedDB entries and virtual WebAuthn
/// credentials, and sets the new storage state. When the storage state contains credentials,
/// the virtual WebAuthn authenticator is installed (equivalent to <see cref="ICredentials.InstallAsync"/>),
/// preventing all real authenticators from working in this context.
/// </para>
/// <para>**Usage**</para>
/// <code>
Expand Down
10 changes: 10 additions & 0 deletions src/Playwright/API/Generated/IBrowserType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ public partial interface IBrowserType
/// via <see cref="IBrowserType.ConnectAsync"/>. If you are experiencing issues or attempting
/// to use advanced functionality, you probably want to use <see cref="IBrowserType.ConnectAsync"/>.
/// </para>
/// <para>
/// Playwright maintains a curated list of arguments for launching the browser. If you
/// launch the browser without Playwright and do not pass the exact same arguments,
/// some of Playwright functionality may be broken upon connecting to the browser.
/// </para>
/// <para>**Usage**</para>
/// <code>
/// var browser = await playwright.Chromium.ConnectOverCDPAsync("http://localhost:9222");<br/>
Expand All @@ -111,6 +116,11 @@ public partial interface IBrowserType
/// to use advanced functionality, you probably want to use <see cref="IBrowserType.ConnectAsync"/>.
///
/// </para>
/// <para>
/// Playwright maintains a curated list of arguments for launching the browser. If you
/// launch the browser without Playwright and do not pass the exact same arguments,
/// some of Playwright functionality may be broken upon connecting to the browser.
/// </para>
/// </remarks>
/// <param name="endpointURL">
/// A CDP websocket endpoint or http url to connect to. For example <c>http://localhost:9222/</c>
Expand Down
9 changes: 7 additions & 2 deletions src/Playwright/API/Generated/ICredentials.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace Microsoft.Playwright;
/// / <c>navigator.credentials.get()</c> ceremonies in the page, without a real authenticator
/// or hardware security key.
/// </para>
/// <para>There are two common ways to use it:</para>
/// <para>There are three common ways to use it:</para>
/// <para>**Usage: seed a known credential**</para>
/// <code>
/// var context = await browser.NewContextAsync();<br/>
Expand All @@ -53,7 +53,7 @@ namespace Microsoft.Playwright;
/// await page.GotoAsync("https://example.com/login");<br/>
/// // The page's navigator.credentials.get() is answered with the seeded passkey.
/// </code>
/// <para>**Usage: capture a passkey, then reuse it**</para>
/// <para>**Usage: capture a credential, then reuse it**</para>
/// <code>
/// // setup test: let the app register a passkey, then save it.<br/>
/// var context = await browser.NewContextAsync();<br/>
Expand Down Expand Up @@ -85,6 +85,11 @@ namespace Microsoft.Playwright;
/// await page.GotoAsync("https://example.com/login");<br/>
/// // navigator.credentials.get() resolves the captured passkey — already signed in.
/// </code>
/// <para>**Usage: save credentials in the storage state, restore later**</para>
/// <para>
/// See <a href="https://playwright.dev/dotnet/docs/auth">authentication guide</a> for
/// examples of using saving and resotring the storage state.
/// </para>
/// <para>**Defaults**</para>
/// </summary>
public partial interface ICredentials
Expand Down
28 changes: 28 additions & 0 deletions src/Playwright/API/Generated/ILocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1983,4 +1983,32 @@ public partial interface ILocator
/// </summary>
/// <param name="options">Call options</param>
Task WaitForAsync(LocatorWaitForOptions? options = default);

/// <summary>
/// <para>
/// Returns when <see cref="ILocator.WaitForFunctionAsync"/> returns a truthy value,
/// called with the matching element as a first argument, and <see cref="ILocator.WaitForFunctionAsync"/>
/// as a second argument.
/// </para>
/// <para>
/// This is a generic way to wait for an element to reach a custom condition without
/// asserting it. The locator is re-resolved on each retry, so it tolerates the element
/// being re-rendered while waiting.
/// </para>
/// <para>
/// If <see cref="ILocator.WaitForFunctionAsync"/> returns a <see cref="Task"/>, this
/// method will wait for the promise to resolve before checking its value.
/// </para>
/// <para>If <see cref="ILocator.WaitForFunctionAsync"/> throws or rejects, this method throws.</para>
/// <para>**Usage**</para>
/// <para>Wait for an attribute to appear:</para>
/// <para>Passing argument to <see cref="ILocator.WaitForFunctionAsync"/>:</para>
/// </summary>
/// <param name="expression">
/// JavaScript expression to be evaluated in the browser context. If the expression
/// evaluates to a function, the function is automatically invoked.
/// </param>
/// <param name="arg">Optional argument to pass to <see cref="ILocator.WaitForFunctionAsync"/>.</param>
/// <param name="options">Call options</param>
Task WaitForFunctionAsync(string expression, object? arg = default, LocatorWaitForFunctionOptions? options = default);
}
Loading
Loading