diff --git a/README.md b/README.md index 50fae47ca..866a13a26 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ | | Linux | macOS | Windows | | :--- | :---: | :---: | :---: | -| Chromium 149.0.7827.55 | ✅ | ✅ | ✅ | +| Chromium 151.0.7922.34 | ✅ | ✅ | ✅ | | WebKit 26.5 | ✅ | ✅ | ✅ | -| Firefox 151.0 | ✅ | ✅ | ✅ | +| Firefox 153.0 | ✅ | ✅ | ✅ | 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**. diff --git a/build.sh b/build.sh index 356294a74..e8fe70a85 100755 --- a/build.sh +++ b/build.sh @@ -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" diff --git a/src/Common/Version.props b/src/Common/Version.props index 7baf72963..47253ca92 100644 --- a/src/Common/Version.props +++ b/src/Common/Version.props @@ -2,10 +2,10 @@ 1.61.0 $(AssemblyVersion) - 1.61.1-beta-1782139630000 - - 24.16.0 + 1.62.0 + + 24.18.1 $(AssemblyVersion) $(AssemblyVersion) true diff --git a/src/Playwright.TestingHarnessTest/package-lock.json b/src/Playwright.TestingHarnessTest/package-lock.json index 412cb89c6..1cbdd580f 100644 --- a/src/Playwright.TestingHarnessTest/package-lock.json +++ b/src/Playwright.TestingHarnessTest/package-lock.json @@ -7,25 +7,25 @@ "": { "name": "playwright.testingharnesstest", "devDependencies": { - "@playwright/test": "1.61.1-beta-1782139630000", + "@playwright/test": "1.62.0", "@types/node": "^22.12.0", "fast-xml-parser": "^4.5.0" } }, "node_modules/@playwright/test": { - "version": "1.61.1-beta-1782139630000", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.61.1-beta-1782139630000.tgz", - "integrity": "sha512-a4IIfD+EjVQB/8PR5rloMKsBljAN62m5/MO0ZBwDLGMgFBTXlmIvdcG9SDR6m9YAWPqizI7EMBcqWGu1jDrDxg==", + "version": "1.62.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.62.0.tgz", + "integrity": "sha512-9zOJ6ZQRAena31MpOH9VSzIz8Ou3YJ/wtY/eQm5T2uhfhG7/U3COrMS8xOtUrZrp9OgdmzEnIYODye3nY1VqzA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright": "1.61.1-beta-1782139630000" + "playwright": "1.62.0" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/@types/node": { @@ -77,35 +77,35 @@ } }, "node_modules/playwright": { - "version": "1.61.1-beta-1782139630000", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.61.1-beta-1782139630000.tgz", - "integrity": "sha512-eh4FPRjtO9BxEnjcABkPMuB2LOLeXUIo6MOE3mQRIIxVFZYlRLJxk828nlT9dv8BbXnBCjAzoyAlqbURh1ptew==", + "version": "1.62.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.62.0.tgz", + "integrity": "sha512-Z14dG305dgaLu6foB1TXQagFiW8JfSUIUaUuPaKQ6NtBPKF1P/qXcqfh6c6K/icPqdy37JmjbiBXf6JNg6Sylw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.61.1-beta-1782139630000" + "playwright-core": "1.62.0" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=18" + "node": ">=20" }, "optionalDependencies": { "fsevents": "2.3.2" } }, "node_modules/playwright-core": { - "version": "1.61.1-beta-1782139630000", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.61.1-beta-1782139630000.tgz", - "integrity": "sha512-xQQR7v/sFoVdUGCWvGPRICNLfsOXOpI3+X8IuzaodXz5NgihKJquBEhkYDQBkcEDfhOAat1RXw8/SmDlhOZhfw==", + "version": "1.62.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.62.0.tgz", + "integrity": "sha512-nsNRyq0r2zsG8AcRHWknc9QRA5XCueC7gWMrs+Gx2tlZn9hcl8zudfh00lhJPY1DE7NmZ6bDsT9g2yey8mXljA==", "dev": true, "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/strnum": { @@ -124,12 +124,12 @@ }, "dependencies": { "@playwright/test": { - "version": "1.61.1-beta-1782139630000", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.61.1-beta-1782139630000.tgz", - "integrity": "sha512-a4IIfD+EjVQB/8PR5rloMKsBljAN62m5/MO0ZBwDLGMgFBTXlmIvdcG9SDR6m9YAWPqizI7EMBcqWGu1jDrDxg==", + "version": "1.62.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.62.0.tgz", + "integrity": "sha512-9zOJ6ZQRAena31MpOH9VSzIz8Ou3YJ/wtY/eQm5T2uhfhG7/U3COrMS8xOtUrZrp9OgdmzEnIYODye3nY1VqzA==", "dev": true, "requires": { - "playwright": "1.61.1-beta-1782139630000" + "playwright": "1.62.0" } }, "@types/node": { @@ -158,19 +158,19 @@ "optional": true }, "playwright": { - "version": "1.61.1-beta-1782139630000", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.61.1-beta-1782139630000.tgz", - "integrity": "sha512-eh4FPRjtO9BxEnjcABkPMuB2LOLeXUIo6MOE3mQRIIxVFZYlRLJxk828nlT9dv8BbXnBCjAzoyAlqbURh1ptew==", + "version": "1.62.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.62.0.tgz", + "integrity": "sha512-Z14dG305dgaLu6foB1TXQagFiW8JfSUIUaUuPaKQ6NtBPKF1P/qXcqfh6c6K/icPqdy37JmjbiBXf6JNg6Sylw==", "dev": true, "requires": { "fsevents": "2.3.2", - "playwright-core": "1.61.1-beta-1782139630000" + "playwright-core": "1.62.0" } }, "playwright-core": { - "version": "1.61.1-beta-1782139630000", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.61.1-beta-1782139630000.tgz", - "integrity": "sha512-xQQR7v/sFoVdUGCWvGPRICNLfsOXOpI3+X8IuzaodXz5NgihKJquBEhkYDQBkcEDfhOAat1RXw8/SmDlhOZhfw==", + "version": "1.62.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.62.0.tgz", + "integrity": "sha512-nsNRyq0r2zsG8AcRHWknc9QRA5XCueC7gWMrs+Gx2tlZn9hcl8zudfh00lhJPY1DE7NmZ6bDsT9g2yey8mXljA==", "dev": true }, "strnum": { diff --git a/src/Playwright.TestingHarnessTest/package.json b/src/Playwright.TestingHarnessTest/package.json index d0a5de9eb..096b94220 100644 --- a/src/Playwright.TestingHarnessTest/package.json +++ b/src/Playwright.TestingHarnessTest/package.json @@ -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" } diff --git a/src/Playwright.Tests/PageNetworkResponseTests.cs b/src/Playwright.Tests/PageNetworkResponseTests.cs index a361383ae..fb0a63369 100644 --- a/src/Playwright.Tests/PageNetworkResponseTests.cs +++ b/src/Playwright.Tests/PageNetworkResponseTests.cs @@ -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) { diff --git a/src/Playwright.Tests/PageScreenshotTests.cs b/src/Playwright.Tests/PageScreenshotTests.cs index b43fb3a3c..3b48332ef 100644 --- a/src/Playwright.Tests/PageScreenshotTests.cs +++ b/src/Playwright.Tests/PageScreenshotTests.cs @@ -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")) { diff --git a/src/Playwright.Tests/WorkersTests.cs b/src/Playwright.Tests/WorkersTests.cs index db77a867f..d975698dc 100644 --- a/src/Playwright.Tests/WorkersTests.cs +++ b/src/Playwright.Tests/WorkersTests.cs @@ -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("() => (10000.20).toLocaleString()")); + Assert.AreEqual("10\u00A0000,2", await worker.EvaluateAsync("() => (10000.20).toLocaleString()")); } [PlaywrightTest("workers.spec.ts", "should report console event on the worker")] diff --git a/src/Playwright/API/Generated/Enums/ScreenshotType.cs b/src/Playwright/API/Generated/Enums/ScreenshotType.cs index 00c7f7be3..a6ab13301 100644 --- a/src/Playwright/API/Generated/Enums/ScreenshotType.cs +++ b/src/Playwright/API/Generated/Enums/ScreenshotType.cs @@ -32,4 +32,6 @@ public enum ScreenshotType Png, [EnumMember(Value = "jpeg")] Jpeg, + [EnumMember(Value = "webp")] + Webp, } diff --git a/src/Playwright/API/Generated/Enums/ScrollMode.cs b/src/Playwright/API/Generated/Enums/ScrollMode.cs new file mode 100644 index 000000000..cd20d1f18 --- /dev/null +++ b/src/Playwright/API/Generated/Enums/ScrollMode.cs @@ -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, +} diff --git a/src/Playwright/API/Generated/IAPIResponse.cs b/src/Playwright/API/Generated/IAPIResponse.cs index 3c538f0ed..72a11c1a7 100644 --- a/src/Playwright/API/Generated/IAPIResponse.cs +++ b/src/Playwright/API/Generated/IAPIResponse.cs @@ -92,6 +92,18 @@ public partial interface IAPIResponse /// Returns the text representation of response body. Task TextAsync(); + /// + /// + /// 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 from + /// the HAR file, timing information is not available and all the values are -1. + /// Find more information at Resource + /// Timing API. + /// + /// + RequestTimingResult Timing { get; } + /// Contains the URL of the response. string Url { get; } } diff --git a/src/Playwright/API/Generated/IBrowserContext.cs b/src/Playwright/API/Generated/IBrowserContext.cs index 05ea188b6..3d1541005 100644 --- a/src/Playwright/API/Generated/IBrowserContext.cs +++ b/src/Playwright/API/Generated/IBrowserContext.cs @@ -1010,7 +1010,7 @@ public partial interface IBrowserContext /// /// /// Returns storage state for this browser context, contains current cookies, local - /// storage snapshot and IndexedDB snapshot. + /// storage snapshot, IndexedDB snapshot and virtual WebAuthn credentials. /// /// /// Call options @@ -1018,8 +1018,10 @@ public partial interface IBrowserContext /// /// - /// 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 ), + /// preventing all real authenticators from working in this context. /// /// **Usage** /// diff --git a/src/Playwright/API/Generated/IBrowserType.cs b/src/Playwright/API/Generated/IBrowserType.cs index 019e24665..0863a1c19 100644 --- a/src/Playwright/API/Generated/IBrowserType.cs +++ b/src/Playwright/API/Generated/IBrowserType.cs @@ -93,6 +93,11 @@ public partial interface IBrowserType /// via . If you are experiencing issues or attempting /// to use advanced functionality, you probably want to use . /// + /// + /// 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. + /// /// **Usage** /// /// var browser = await playwright.Chromium.ConnectOverCDPAsync("http://localhost:9222");
@@ -111,6 +116,11 @@ public partial interface IBrowserType /// to use advanced functionality, you probably want to use . /// /// + /// + /// 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. + /// /// /// /// A CDP websocket endpoint or http url to connect to. For example http://localhost:9222/ diff --git a/src/Playwright/API/Generated/ICredentials.cs b/src/Playwright/API/Generated/ICredentials.cs index 612bba632..8cd79cf84 100644 --- a/src/Playwright/API/Generated/ICredentials.cs +++ b/src/Playwright/API/Generated/ICredentials.cs @@ -34,7 +34,7 @@ namespace Microsoft.Playwright; /// / navigator.credentials.get() ceremonies in the page, without a real authenticator /// or hardware security key. /// -/// There are two common ways to use it: +/// There are three common ways to use it: /// **Usage: seed a known credential** /// /// var context = await browser.NewContextAsync();
@@ -53,7 +53,7 @@ namespace Microsoft.Playwright; /// await page.GotoAsync("https://example.com/login");
/// // The page's navigator.credentials.get() is answered with the seeded passkey. ///
-/// **Usage: capture a passkey, then reuse it** +/// **Usage: capture a credential, then reuse it** /// /// // setup test: let the app register a passkey, then save it.
/// var context = await browser.NewContextAsync();
@@ -85,6 +85,11 @@ namespace Microsoft.Playwright; /// await page.GotoAsync("https://example.com/login");
/// // navigator.credentials.get() resolves the captured passkey — already signed in. ///
+/// **Usage: save credentials in the storage state, restore later** +/// +/// See authentication guide for +/// examples of using saving and resotring the storage state. +/// /// **Defaults** ///
public partial interface ICredentials diff --git a/src/Playwright/API/Generated/ILocator.cs b/src/Playwright/API/Generated/ILocator.cs index 47b714023..992bfae6a 100644 --- a/src/Playwright/API/Generated/ILocator.cs +++ b/src/Playwright/API/Generated/ILocator.cs @@ -1983,4 +1983,32 @@ public partial interface ILocator /// /// Call options Task WaitForAsync(LocatorWaitForOptions? options = default); + + /// + /// + /// Returns when returns a truthy value, + /// called with the matching element as a first argument, and + /// as a second argument. + /// + /// + /// 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. + /// + /// + /// If returns a , this + /// method will wait for the promise to resolve before checking its value. + /// + /// If throws or rejects, this method throws. + /// **Usage** + /// Wait for an attribute to appear: + /// Passing argument to : + /// + /// + /// JavaScript expression to be evaluated in the browser context. If the expression + /// evaluates to a function, the function is automatically invoked. + /// + /// Optional argument to pass to . + /// Call options + Task WaitForFunctionAsync(string expression, object? arg = default, LocatorWaitForFunctionOptions? options = default); } diff --git a/src/Playwright/API/Generated/IPage.cs b/src/Playwright/API/Generated/IPage.cs index 8acc53e21..bac08cf88 100644 --- a/src/Playwright/API/Generated/IPage.cs +++ b/src/Playwright/API/Generated/IPage.cs @@ -1272,7 +1272,25 @@ public partial interface IPage /// null. /// /// Navigate to the previous page in history. + /// + /// **Testing Back/Forward Cache (BFCache) is not supported.** By default, Playwright + /// disables the Back/Forward Cache across all browsers. Even if explicitly enabled, + /// Playwright's internal state relies on network-level navigation events. Because BFCache + /// restores unfreeze the DOM without firing these events, using page.goBack() + /// or page.goForward() to trigger a BFCache restore will result in timeouts + /// and a desynchronized Page state. + /// /// + /// + /// + /// **Testing Back/Forward Cache (BFCache) is not supported.** By default, Playwright + /// disables the Back/Forward Cache across all browsers. Even if explicitly enabled, + /// Playwright's internal state relies on network-level navigation events. Because BFCache + /// restores unfreeze the DOM without firing these events, using page.goBack() + /// or page.goForward() to trigger a BFCache restore will result in timeouts + /// and a desynchronized Page state. + /// + /// /// Call options Task GoBackAsync(PageGoBackOptions? options = default); @@ -1283,7 +1301,25 @@ public partial interface IPage /// null. /// /// Navigate to the next page in history. + /// + /// **Testing Back/Forward Cache (BFCache) is not supported.** By default, Playwright + /// disables the Back/Forward Cache across all browsers. Even if explicitly enabled, + /// Playwright's internal state relies on network-level navigation events. Because BFCache + /// restores unfreeze the DOM without firing these events, using page.goBack() + /// or page.goForward() to trigger a BFCache restore will result in timeouts + /// and a desynchronized Page state. + /// /// + /// + /// + /// **Testing Back/Forward Cache (BFCache) is not supported.** By default, Playwright + /// disables the Back/Forward Cache across all browsers. Even if explicitly enabled, + /// Playwright's internal state relies on network-level navigation events. Because BFCache + /// restores unfreeze the DOM without firing these events, using page.goBack() + /// or page.goForward() to trigger a BFCache restore will result in timeouts + /// and a desynchronized Page state. + /// + /// /// Call options Task GoForwardAsync(PageGoForwardOptions? options = default); diff --git a/src/Playwright/API/Generated/Options/BrowserContextStorageStateOptions.cs b/src/Playwright/API/Generated/Options/BrowserContextStorageStateOptions.cs index a79431646..ca5b40466 100644 --- a/src/Playwright/API/Generated/Options/BrowserContextStorageStateOptions.cs +++ b/src/Playwright/API/Generated/Options/BrowserContextStorageStateOptions.cs @@ -37,10 +37,25 @@ public BrowserContextStorageStateOptions(BrowserContextStorageStateOptions clone return; } + Credentials = clone.Credentials; IndexedDB = clone.IndexedDB; Path = clone.Path; } + /// + /// + /// Set to true to include the context's virtual WebAuthn + /// (passkeys) in the storage state snapshot. The captured credentials carry their private + /// keys, so they can be re-seeded into a later context via the + /// option or . Note that restoring + /// the storage state that contains credentials will automatically install the virtual + /// WebAuthn authenticator (see ), and prevent + /// all real authenticators from working in this context. + /// + /// + [JsonPropertyName("credentials")] + public bool? Credentials { get; set; } + /// /// /// Set to true to include IndexedDB diff --git a/src/Playwright/API/Generated/Options/ElementHandleCheckOptions.cs b/src/Playwright/API/Generated/Options/ElementHandleCheckOptions.cs index 041ab5d8c..42250d66b 100644 --- a/src/Playwright/API/Generated/Options/ElementHandleCheckOptions.cs +++ b/src/Playwright/API/Generated/Options/ElementHandleCheckOptions.cs @@ -40,6 +40,7 @@ public ElementHandleCheckOptions(ElementHandleCheckOptions clone) Force = clone.Force; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Timeout = clone.Timeout; Trial = clone.Trial; } @@ -70,6 +71,19 @@ public ElementHandleCheckOptions(ElementHandleCheckOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// Maximum time in milliseconds. Defaults to 30000 (30 seconds). Pass 0 diff --git a/src/Playwright/API/Generated/Options/ElementHandleClickOptions.cs b/src/Playwright/API/Generated/Options/ElementHandleClickOptions.cs index 729edf82b..3caa3d0c1 100644 --- a/src/Playwright/API/Generated/Options/ElementHandleClickOptions.cs +++ b/src/Playwright/API/Generated/Options/ElementHandleClickOptions.cs @@ -45,6 +45,7 @@ public ElementHandleClickOptions(ElementHandleClickOptions clone) Modifiers = clone.Modifiers; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Steps = clone.Steps; Timeout = clone.Timeout; Trial = clone.Trial; @@ -109,6 +110,19 @@ public ElementHandleClickOptions(ElementHandleClickOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// Defaults to 1. Sends n interpolated mousemove events to represent diff --git a/src/Playwright/API/Generated/Options/ElementHandleDblClickOptions.cs b/src/Playwright/API/Generated/Options/ElementHandleDblClickOptions.cs index 6a93de976..cd0c31ca9 100644 --- a/src/Playwright/API/Generated/Options/ElementHandleDblClickOptions.cs +++ b/src/Playwright/API/Generated/Options/ElementHandleDblClickOptions.cs @@ -44,6 +44,7 @@ public ElementHandleDblClickOptions(ElementHandleDblClickOptions clone) Modifiers = clone.Modifiers; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Steps = clone.Steps; Timeout = clone.Timeout; Trial = clone.Trial; @@ -99,6 +100,19 @@ public ElementHandleDblClickOptions(ElementHandleDblClickOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// Defaults to 1. Sends n interpolated mousemove events to represent diff --git a/src/Playwright/API/Generated/Options/ElementHandleHoverOptions.cs b/src/Playwright/API/Generated/Options/ElementHandleHoverOptions.cs index b5e4e91e5..880b212a4 100644 --- a/src/Playwright/API/Generated/Options/ElementHandleHoverOptions.cs +++ b/src/Playwright/API/Generated/Options/ElementHandleHoverOptions.cs @@ -42,6 +42,7 @@ public ElementHandleHoverOptions(ElementHandleHoverOptions clone) Modifiers = clone.Modifiers; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Timeout = clone.Timeout; Trial = clone.Trial; } @@ -83,6 +84,19 @@ public ElementHandleHoverOptions(ElementHandleHoverOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// Maximum time in milliseconds. Defaults to 30000 (30 seconds). Pass 0 diff --git a/src/Playwright/API/Generated/Options/ElementHandleInputValueOptions.cs b/src/Playwright/API/Generated/Options/ElementHandleInputValueOptions.cs index 63faea044..22aa493ba 100644 --- a/src/Playwright/API/Generated/Options/ElementHandleInputValueOptions.cs +++ b/src/Playwright/API/Generated/Options/ElementHandleInputValueOptions.cs @@ -40,13 +40,8 @@ public ElementHandleInputValueOptions(ElementHandleInputValueOptions clone) Timeout = clone.Timeout; } - /// - /// - /// Maximum time in milliseconds. Defaults to 30000 (30 seconds). Pass 0 - /// to disable timeout. The default value can be changed by using the - /// or methods. - /// - /// + /// **DEPRECATED** This option is ignored. The value is returned immediately. [JsonPropertyName("timeout")] + [System.Obsolete] public float? Timeout { get; set; } } diff --git a/src/Playwright/API/Generated/Options/ElementHandleScreenshotOptions.cs b/src/Playwright/API/Generated/Options/ElementHandleScreenshotOptions.cs index ce6676e52..44a77e2a7 100644 --- a/src/Playwright/API/Generated/Options/ElementHandleScreenshotOptions.cs +++ b/src/Playwright/API/Generated/Options/ElementHandleScreenshotOptions.cs @@ -121,7 +121,13 @@ public ElementHandleScreenshotOptions(ElementHandleScreenshotOptions clone) [JsonPropertyName("path")] public string? Path { get; set; } - /// The quality of the image, between 0-100. Not applicable to png images. + /// + /// + /// The quality of the image, between 0-100. Not applicable to png images. For + /// jpeg the default is 80. For webp, a quality of 100 (the + /// default) produces a lossless image, while lower values use lossy compression. + /// + /// [JsonPropertyName("quality")] public int? Quality { get; set; } diff --git a/src/Playwright/API/Generated/Options/ElementHandleSetCheckedOptions.cs b/src/Playwright/API/Generated/Options/ElementHandleSetCheckedOptions.cs index f3d9ac728..ec7fc3503 100644 --- a/src/Playwright/API/Generated/Options/ElementHandleSetCheckedOptions.cs +++ b/src/Playwright/API/Generated/Options/ElementHandleSetCheckedOptions.cs @@ -40,6 +40,7 @@ public ElementHandleSetCheckedOptions(ElementHandleSetCheckedOptions clone) Force = clone.Force; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Timeout = clone.Timeout; Trial = clone.Trial; } @@ -70,6 +71,19 @@ public ElementHandleSetCheckedOptions(ElementHandleSetCheckedOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// Maximum time in milliseconds. Defaults to 30000 (30 seconds). Pass 0 diff --git a/src/Playwright/API/Generated/Options/ElementHandleTapOptions.cs b/src/Playwright/API/Generated/Options/ElementHandleTapOptions.cs index c4f13bd17..c28bc8e63 100644 --- a/src/Playwright/API/Generated/Options/ElementHandleTapOptions.cs +++ b/src/Playwright/API/Generated/Options/ElementHandleTapOptions.cs @@ -42,6 +42,7 @@ public ElementHandleTapOptions(ElementHandleTapOptions clone) Modifiers = clone.Modifiers; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Timeout = clone.Timeout; Trial = clone.Trial; } @@ -83,6 +84,19 @@ public ElementHandleTapOptions(ElementHandleTapOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// Maximum time in milliseconds. Defaults to 30000 (30 seconds). Pass 0 diff --git a/src/Playwright/API/Generated/Options/ElementHandleUncheckOptions.cs b/src/Playwright/API/Generated/Options/ElementHandleUncheckOptions.cs index 5ed3fd833..c3d0fd3f0 100644 --- a/src/Playwright/API/Generated/Options/ElementHandleUncheckOptions.cs +++ b/src/Playwright/API/Generated/Options/ElementHandleUncheckOptions.cs @@ -40,6 +40,7 @@ public ElementHandleUncheckOptions(ElementHandleUncheckOptions clone) Force = clone.Force; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Timeout = clone.Timeout; Trial = clone.Trial; } @@ -70,6 +71,19 @@ public ElementHandleUncheckOptions(ElementHandleUncheckOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// Maximum time in milliseconds. Defaults to 30000 (30 seconds). Pass 0 diff --git a/src/Playwright/API/Generated/Options/FrameCheckOptions.cs b/src/Playwright/API/Generated/Options/FrameCheckOptions.cs index 2f5095f50..891258398 100644 --- a/src/Playwright/API/Generated/Options/FrameCheckOptions.cs +++ b/src/Playwright/API/Generated/Options/FrameCheckOptions.cs @@ -40,6 +40,7 @@ public FrameCheckOptions(FrameCheckOptions clone) Force = clone.Force; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Strict = clone.Strict; Timeout = clone.Timeout; Trial = clone.Trial; @@ -71,6 +72,19 @@ public FrameCheckOptions(FrameCheckOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// When true, the call requires selector to resolve to a single element. If given selector diff --git a/src/Playwright/API/Generated/Options/FrameClickOptions.cs b/src/Playwright/API/Generated/Options/FrameClickOptions.cs index 428db4168..b81b6d316 100644 --- a/src/Playwright/API/Generated/Options/FrameClickOptions.cs +++ b/src/Playwright/API/Generated/Options/FrameClickOptions.cs @@ -45,6 +45,7 @@ public FrameClickOptions(FrameClickOptions clone) Modifiers = clone.Modifiers; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Strict = clone.Strict; Timeout = clone.Timeout; Trial = clone.Trial; @@ -109,6 +110,19 @@ public FrameClickOptions(FrameClickOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// When true, the call requires selector to resolve to a single element. If given selector diff --git a/src/Playwright/API/Generated/Options/FrameDblClickOptions.cs b/src/Playwright/API/Generated/Options/FrameDblClickOptions.cs index f8331fc44..beed3ba4c 100644 --- a/src/Playwright/API/Generated/Options/FrameDblClickOptions.cs +++ b/src/Playwright/API/Generated/Options/FrameDblClickOptions.cs @@ -44,6 +44,7 @@ public FrameDblClickOptions(FrameDblClickOptions clone) Modifiers = clone.Modifiers; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Strict = clone.Strict; Timeout = clone.Timeout; Trial = clone.Trial; @@ -99,6 +100,19 @@ public FrameDblClickOptions(FrameDblClickOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// When true, the call requires selector to resolve to a single element. If given selector diff --git a/src/Playwright/API/Generated/Options/FrameDragAndDropOptions.cs b/src/Playwright/API/Generated/Options/FrameDragAndDropOptions.cs index 3f960d92d..119fc017b 100644 --- a/src/Playwright/API/Generated/Options/FrameDragAndDropOptions.cs +++ b/src/Playwright/API/Generated/Options/FrameDragAndDropOptions.cs @@ -39,6 +39,7 @@ public FrameDragAndDropOptions(FrameDragAndDropOptions clone) Force = clone.Force; NoWaitAfter = clone.NoWaitAfter; + Scroll = clone.Scroll; SourcePosition = clone.SourcePosition; Steps = clone.Steps; Strict = clone.Strict; @@ -64,6 +65,19 @@ public FrameDragAndDropOptions(FrameDragAndDropOptions clone) [System.Obsolete] public bool? NoWaitAfter { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// Clicks on the source element at this point relative to the top-left corner of the diff --git a/src/Playwright/API/Generated/Options/FrameHoverOptions.cs b/src/Playwright/API/Generated/Options/FrameHoverOptions.cs index 2de5994d6..5ec4d6369 100644 --- a/src/Playwright/API/Generated/Options/FrameHoverOptions.cs +++ b/src/Playwright/API/Generated/Options/FrameHoverOptions.cs @@ -42,6 +42,7 @@ public FrameHoverOptions(FrameHoverOptions clone) Modifiers = clone.Modifiers; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Strict = clone.Strict; Timeout = clone.Timeout; Trial = clone.Trial; @@ -84,6 +85,19 @@ public FrameHoverOptions(FrameHoverOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// When true, the call requires selector to resolve to a single element. If given selector diff --git a/src/Playwright/API/Generated/Options/FrameSetCheckedOptions.cs b/src/Playwright/API/Generated/Options/FrameSetCheckedOptions.cs index 6bda69b9e..db9f208ef 100644 --- a/src/Playwright/API/Generated/Options/FrameSetCheckedOptions.cs +++ b/src/Playwright/API/Generated/Options/FrameSetCheckedOptions.cs @@ -40,6 +40,7 @@ public FrameSetCheckedOptions(FrameSetCheckedOptions clone) Force = clone.Force; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Strict = clone.Strict; Timeout = clone.Timeout; Trial = clone.Trial; @@ -71,6 +72,19 @@ public FrameSetCheckedOptions(FrameSetCheckedOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// When true, the call requires selector to resolve to a single element. If given selector diff --git a/src/Playwright/API/Generated/Options/FrameTapOptions.cs b/src/Playwright/API/Generated/Options/FrameTapOptions.cs index f433f3a53..24985149d 100644 --- a/src/Playwright/API/Generated/Options/FrameTapOptions.cs +++ b/src/Playwright/API/Generated/Options/FrameTapOptions.cs @@ -42,6 +42,7 @@ public FrameTapOptions(FrameTapOptions clone) Modifiers = clone.Modifiers; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Strict = clone.Strict; Timeout = clone.Timeout; Trial = clone.Trial; @@ -84,6 +85,19 @@ public FrameTapOptions(FrameTapOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// When true, the call requires selector to resolve to a single element. If given selector diff --git a/src/Playwright/API/Generated/Options/FrameUncheckOptions.cs b/src/Playwright/API/Generated/Options/FrameUncheckOptions.cs index a34099530..10fdb275b 100644 --- a/src/Playwright/API/Generated/Options/FrameUncheckOptions.cs +++ b/src/Playwright/API/Generated/Options/FrameUncheckOptions.cs @@ -40,6 +40,7 @@ public FrameUncheckOptions(FrameUncheckOptions clone) Force = clone.Force; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Strict = clone.Strict; Timeout = clone.Timeout; Trial = clone.Trial; @@ -71,6 +72,19 @@ public FrameUncheckOptions(FrameUncheckOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// When true, the call requires selector to resolve to a single element. If given selector diff --git a/src/Playwright/API/Generated/Options/LocatorCheckOptions.cs b/src/Playwright/API/Generated/Options/LocatorCheckOptions.cs index b2d6c14e7..4320c1e55 100644 --- a/src/Playwright/API/Generated/Options/LocatorCheckOptions.cs +++ b/src/Playwright/API/Generated/Options/LocatorCheckOptions.cs @@ -40,6 +40,7 @@ public LocatorCheckOptions(LocatorCheckOptions clone) Force = clone.Force; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Timeout = clone.Timeout; Trial = clone.Trial; } @@ -70,6 +71,19 @@ public LocatorCheckOptions(LocatorCheckOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// Maximum time in milliseconds. Defaults to 30000 (30 seconds). Pass 0 diff --git a/src/Playwright/API/Generated/Options/LocatorClickOptions.cs b/src/Playwright/API/Generated/Options/LocatorClickOptions.cs index 29e56a749..78786ae25 100644 --- a/src/Playwright/API/Generated/Options/LocatorClickOptions.cs +++ b/src/Playwright/API/Generated/Options/LocatorClickOptions.cs @@ -45,6 +45,7 @@ public LocatorClickOptions(LocatorClickOptions clone) Modifiers = clone.Modifiers; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Steps = clone.Steps; Timeout = clone.Timeout; Trial = clone.Trial; @@ -109,6 +110,19 @@ public LocatorClickOptions(LocatorClickOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// Defaults to 1. Sends n interpolated mousemove events to represent diff --git a/src/Playwright/API/Generated/Options/LocatorDblClickOptions.cs b/src/Playwright/API/Generated/Options/LocatorDblClickOptions.cs index 5fa4d331f..57df7c968 100644 --- a/src/Playwright/API/Generated/Options/LocatorDblClickOptions.cs +++ b/src/Playwright/API/Generated/Options/LocatorDblClickOptions.cs @@ -44,6 +44,7 @@ public LocatorDblClickOptions(LocatorDblClickOptions clone) Modifiers = clone.Modifiers; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Steps = clone.Steps; Timeout = clone.Timeout; Trial = clone.Trial; @@ -99,6 +100,19 @@ public LocatorDblClickOptions(LocatorDblClickOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// Defaults to 1. Sends n interpolated mousemove events to represent diff --git a/src/Playwright/API/Generated/Options/LocatorDragToOptions.cs b/src/Playwright/API/Generated/Options/LocatorDragToOptions.cs index ffec6f1a2..d9c4af5e4 100644 --- a/src/Playwright/API/Generated/Options/LocatorDragToOptions.cs +++ b/src/Playwright/API/Generated/Options/LocatorDragToOptions.cs @@ -39,6 +39,7 @@ public LocatorDragToOptions(LocatorDragToOptions clone) Force = clone.Force; NoWaitAfter = clone.NoWaitAfter; + Scroll = clone.Scroll; SourcePosition = clone.SourcePosition; Steps = clone.Steps; TargetPosition = clone.TargetPosition; @@ -63,6 +64,19 @@ public LocatorDragToOptions(LocatorDragToOptions clone) [System.Obsolete] public bool? NoWaitAfter { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// Clicks on the source element at this point relative to the top-left corner of the diff --git a/src/Playwright/API/Generated/Options/LocatorHoverOptions.cs b/src/Playwright/API/Generated/Options/LocatorHoverOptions.cs index 38b2d64e3..ff9f39338 100644 --- a/src/Playwright/API/Generated/Options/LocatorHoverOptions.cs +++ b/src/Playwright/API/Generated/Options/LocatorHoverOptions.cs @@ -42,6 +42,7 @@ public LocatorHoverOptions(LocatorHoverOptions clone) Modifiers = clone.Modifiers; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Timeout = clone.Timeout; Trial = clone.Trial; } @@ -83,6 +84,19 @@ public LocatorHoverOptions(LocatorHoverOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// Maximum time in milliseconds. Defaults to 30000 (30 seconds). Pass 0 diff --git a/src/Playwright/API/Generated/Options/LocatorScreenshotOptions.cs b/src/Playwright/API/Generated/Options/LocatorScreenshotOptions.cs index 7d9d8aa0b..165b5ed3b 100644 --- a/src/Playwright/API/Generated/Options/LocatorScreenshotOptions.cs +++ b/src/Playwright/API/Generated/Options/LocatorScreenshotOptions.cs @@ -121,7 +121,13 @@ public LocatorScreenshotOptions(LocatorScreenshotOptions clone) [JsonPropertyName("path")] public string? Path { get; set; } - /// The quality of the image, between 0-100. Not applicable to png images. + /// + /// + /// The quality of the image, between 0-100. Not applicable to png images. For + /// jpeg the default is 80. For webp, a quality of 100 (the + /// default) produces a lossless image, while lower values use lossy compression. + /// + /// [JsonPropertyName("quality")] public int? Quality { get; set; } diff --git a/src/Playwright/API/Generated/Options/LocatorSetCheckedOptions.cs b/src/Playwright/API/Generated/Options/LocatorSetCheckedOptions.cs index 4a615adbf..7910526bf 100644 --- a/src/Playwright/API/Generated/Options/LocatorSetCheckedOptions.cs +++ b/src/Playwright/API/Generated/Options/LocatorSetCheckedOptions.cs @@ -40,6 +40,7 @@ public LocatorSetCheckedOptions(LocatorSetCheckedOptions clone) Force = clone.Force; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Timeout = clone.Timeout; Trial = clone.Trial; } @@ -70,6 +71,19 @@ public LocatorSetCheckedOptions(LocatorSetCheckedOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// Maximum time in milliseconds. Defaults to 30000 (30 seconds). Pass 0 diff --git a/src/Playwright/API/Generated/Options/LocatorTapOptions.cs b/src/Playwright/API/Generated/Options/LocatorTapOptions.cs index 0216ffb75..afb04d908 100644 --- a/src/Playwright/API/Generated/Options/LocatorTapOptions.cs +++ b/src/Playwright/API/Generated/Options/LocatorTapOptions.cs @@ -42,6 +42,7 @@ public LocatorTapOptions(LocatorTapOptions clone) Modifiers = clone.Modifiers; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Timeout = clone.Timeout; Trial = clone.Trial; } @@ -83,6 +84,19 @@ public LocatorTapOptions(LocatorTapOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// Maximum time in milliseconds. Defaults to 30000 (30 seconds). Pass 0 diff --git a/src/Playwright/API/Generated/Options/LocatorUncheckOptions.cs b/src/Playwright/API/Generated/Options/LocatorUncheckOptions.cs index cfdab8ec2..b991740c5 100644 --- a/src/Playwright/API/Generated/Options/LocatorUncheckOptions.cs +++ b/src/Playwright/API/Generated/Options/LocatorUncheckOptions.cs @@ -40,6 +40,7 @@ public LocatorUncheckOptions(LocatorUncheckOptions clone) Force = clone.Force; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Timeout = clone.Timeout; Trial = clone.Trial; } @@ -70,6 +71,19 @@ public LocatorUncheckOptions(LocatorUncheckOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// Maximum time in milliseconds. Defaults to 30000 (30 seconds). Pass 0 diff --git a/src/Playwright/API/Generated/Options/LocatorWaitForFunctionOptions.cs b/src/Playwright/API/Generated/Options/LocatorWaitForFunctionOptions.cs new file mode 100644 index 000000000..84996362c --- /dev/null +++ b/src/Playwright/API/Generated/Options/LocatorWaitForFunctionOptions.cs @@ -0,0 +1,53 @@ +/* + * 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.Text.Json.Serialization; + +namespace Microsoft.Playwright; + +public class LocatorWaitForFunctionOptions +{ + public LocatorWaitForFunctionOptions() { } + + public LocatorWaitForFunctionOptions(LocatorWaitForFunctionOptions clone) + { + if (clone == null) + { + return; + } + + Timeout = clone.Timeout; + } + + /// + /// + /// Maximum time to wait for in milliseconds. Defaults to 30000 (30 seconds). + /// Pass 0 to disable timeout. The default value can be changed by using the + /// or + /// methods. + /// + /// + [JsonPropertyName("timeout")] + public float? Timeout { get; set; } +} diff --git a/src/Playwright/API/Generated/Options/PageCheckOptions.cs b/src/Playwright/API/Generated/Options/PageCheckOptions.cs index 9f62becf7..08bc92ddf 100644 --- a/src/Playwright/API/Generated/Options/PageCheckOptions.cs +++ b/src/Playwright/API/Generated/Options/PageCheckOptions.cs @@ -40,6 +40,7 @@ public PageCheckOptions(PageCheckOptions clone) Force = clone.Force; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Strict = clone.Strict; Timeout = clone.Timeout; Trial = clone.Trial; @@ -71,6 +72,19 @@ public PageCheckOptions(PageCheckOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// When true, the call requires selector to resolve to a single element. If given selector diff --git a/src/Playwright/API/Generated/Options/PageClickOptions.cs b/src/Playwright/API/Generated/Options/PageClickOptions.cs index a83c13ddb..1eef192bf 100644 --- a/src/Playwright/API/Generated/Options/PageClickOptions.cs +++ b/src/Playwright/API/Generated/Options/PageClickOptions.cs @@ -45,6 +45,7 @@ public PageClickOptions(PageClickOptions clone) Modifiers = clone.Modifiers; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Strict = clone.Strict; Timeout = clone.Timeout; Trial = clone.Trial; @@ -109,6 +110,19 @@ public PageClickOptions(PageClickOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// When true, the call requires selector to resolve to a single element. If given selector diff --git a/src/Playwright/API/Generated/Options/PageDblClickOptions.cs b/src/Playwright/API/Generated/Options/PageDblClickOptions.cs index 987234dfd..aab57b032 100644 --- a/src/Playwright/API/Generated/Options/PageDblClickOptions.cs +++ b/src/Playwright/API/Generated/Options/PageDblClickOptions.cs @@ -44,6 +44,7 @@ public PageDblClickOptions(PageDblClickOptions clone) Modifiers = clone.Modifiers; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Strict = clone.Strict; Timeout = clone.Timeout; Trial = clone.Trial; @@ -99,6 +100,19 @@ public PageDblClickOptions(PageDblClickOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// When true, the call requires selector to resolve to a single element. If given selector diff --git a/src/Playwright/API/Generated/Options/PageDragAndDropOptions.cs b/src/Playwright/API/Generated/Options/PageDragAndDropOptions.cs index b59a5bf27..4d95d702c 100644 --- a/src/Playwright/API/Generated/Options/PageDragAndDropOptions.cs +++ b/src/Playwright/API/Generated/Options/PageDragAndDropOptions.cs @@ -39,6 +39,7 @@ public PageDragAndDropOptions(PageDragAndDropOptions clone) Force = clone.Force; NoWaitAfter = clone.NoWaitAfter; + Scroll = clone.Scroll; SourcePosition = clone.SourcePosition; Steps = clone.Steps; Strict = clone.Strict; @@ -64,6 +65,19 @@ public PageDragAndDropOptions(PageDragAndDropOptions clone) [System.Obsolete] public bool? NoWaitAfter { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// Clicks on the source element at this point relative to the top-left corner of the diff --git a/src/Playwright/API/Generated/Options/PageHoverOptions.cs b/src/Playwright/API/Generated/Options/PageHoverOptions.cs index 47f7886a5..f2f8cc6d2 100644 --- a/src/Playwright/API/Generated/Options/PageHoverOptions.cs +++ b/src/Playwright/API/Generated/Options/PageHoverOptions.cs @@ -42,6 +42,7 @@ public PageHoverOptions(PageHoverOptions clone) Modifiers = clone.Modifiers; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Strict = clone.Strict; Timeout = clone.Timeout; Trial = clone.Trial; @@ -84,6 +85,19 @@ public PageHoverOptions(PageHoverOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// When true, the call requires selector to resolve to a single element. If given selector diff --git a/src/Playwright/API/Generated/Options/PageScreenshotOptions.cs b/src/Playwright/API/Generated/Options/PageScreenshotOptions.cs index f7c41d012..12b5f087d 100644 --- a/src/Playwright/API/Generated/Options/PageScreenshotOptions.cs +++ b/src/Playwright/API/Generated/Options/PageScreenshotOptions.cs @@ -136,7 +136,13 @@ public PageScreenshotOptions(PageScreenshotOptions clone) [JsonPropertyName("path")] public string? Path { get; set; } - /// The quality of the image, between 0-100. Not applicable to png images. + /// + /// + /// The quality of the image, between 0-100. Not applicable to png images. For + /// jpeg the default is 80. For webp, a quality of 100 (the + /// default) produces a lossless image, while lower values use lossy compression. + /// + /// [JsonPropertyName("quality")] public int? Quality { get; set; } diff --git a/src/Playwright/API/Generated/Options/PageSetCheckedOptions.cs b/src/Playwright/API/Generated/Options/PageSetCheckedOptions.cs index e40f5fbd2..ab565fad1 100644 --- a/src/Playwright/API/Generated/Options/PageSetCheckedOptions.cs +++ b/src/Playwright/API/Generated/Options/PageSetCheckedOptions.cs @@ -40,6 +40,7 @@ public PageSetCheckedOptions(PageSetCheckedOptions clone) Force = clone.Force; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Strict = clone.Strict; Timeout = clone.Timeout; Trial = clone.Trial; @@ -71,6 +72,19 @@ public PageSetCheckedOptions(PageSetCheckedOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// When true, the call requires selector to resolve to a single element. If given selector diff --git a/src/Playwright/API/Generated/Options/PageTapOptions.cs b/src/Playwright/API/Generated/Options/PageTapOptions.cs index c1690cdb9..e38121c92 100644 --- a/src/Playwright/API/Generated/Options/PageTapOptions.cs +++ b/src/Playwright/API/Generated/Options/PageTapOptions.cs @@ -42,6 +42,7 @@ public PageTapOptions(PageTapOptions clone) Modifiers = clone.Modifiers; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Strict = clone.Strict; Timeout = clone.Timeout; Trial = clone.Trial; @@ -84,6 +85,19 @@ public PageTapOptions(PageTapOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// When true, the call requires selector to resolve to a single element. If given selector diff --git a/src/Playwright/API/Generated/Options/PageUncheckOptions.cs b/src/Playwright/API/Generated/Options/PageUncheckOptions.cs index cd93b8c47..1ce89ebaf 100644 --- a/src/Playwright/API/Generated/Options/PageUncheckOptions.cs +++ b/src/Playwright/API/Generated/Options/PageUncheckOptions.cs @@ -40,6 +40,7 @@ public PageUncheckOptions(PageUncheckOptions clone) Force = clone.Force; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; + Scroll = clone.Scroll; Strict = clone.Strict; Timeout = clone.Timeout; Trial = clone.Trial; @@ -71,6 +72,19 @@ public PageUncheckOptions(PageUncheckOptions clone) [JsonPropertyName("position")] public Position? Position { get; set; } + /// + /// + /// Controls whether Playwright scrolls the element into view before performing the + /// action. Defaults to "auto", which scrolls the element into view when necessary, + /// including scrolling nested scrollable containers. When set to "none", Playwright + /// does not scroll the element and the action fails if the element is not already in + /// the viewport. This is useful to assert that an element is reachable by the user + /// without additional scrolling. + /// + /// + [JsonPropertyName("scroll")] + public ScrollMode? Scroll { get; set; } + /// /// /// When true, the call requires selector to resolve to a single element. If given selector diff --git a/src/Playwright/API/Generated/Types/RequestTimingResult.cs b/src/Playwright/API/Generated/Types/RequestTimingResult.cs index d09368b20..c856d6d0d 100644 --- a/src/Playwright/API/Generated/Types/RequestTimingResult.cs +++ b/src/Playwright/API/Generated/Types/RequestTimingResult.cs @@ -36,7 +36,7 @@ public partial class RequestTimingResult /// /// - /// Time immediately before the browser starts the domain name lookup for the resource. + /// Time immediately before the client starts the domain name lookup for the resource. /// The value is given in milliseconds relative to startTime, -1 if not available. /// /// @@ -46,7 +46,7 @@ public partial class RequestTimingResult /// /// - /// Time immediately after the browser starts the domain name lookup for the resource. + /// Time immediately after the client ends the domain name lookup for the resource. /// The value is given in milliseconds relative to startTime, -1 if not available. /// /// @@ -56,9 +56,9 @@ public partial class RequestTimingResult /// /// - /// Time immediately before the user agent starts establishing the connection to the - /// server to retrieve the resource. The value is given in milliseconds relative to - /// startTime, -1 if not available. + /// Time immediately before the client starts establishing the connection to the server + /// to retrieve the resource. The value is given in milliseconds relative to startTime, + /// -1 if not available. /// /// [Required] @@ -67,7 +67,7 @@ public partial class RequestTimingResult /// /// - /// Time immediately before the browser starts the handshake process to secure the current + /// Time immediately before the client starts the handshake process to secure the current /// connection. The value is given in milliseconds relative to startTime, -1 /// if not available. /// @@ -78,9 +78,9 @@ public partial class RequestTimingResult /// /// - /// Time immediately before the user agent starts establishing the connection to the - /// server to retrieve the resource. The value is given in milliseconds relative to - /// startTime, -1 if not available. + /// Time immediately after the client establishes the connection to the server to retrieve + /// the resource. The value is given in milliseconds relative to startTime, -1 + /// if not available. /// /// [Required] @@ -89,7 +89,7 @@ public partial class RequestTimingResult /// /// - /// Time immediately before the browser starts requesting the resource from the server, + /// Time immediately before the client starts requesting the resource from the server, /// cache, or local resource. The value is given in milliseconds relative to startTime, /// -1 if not available. /// @@ -100,9 +100,9 @@ public partial class RequestTimingResult /// /// - /// Time immediately after the browser receives the first byte of the response from - /// the server, cache, or local resource. The value is given in milliseconds relative - /// to startTime, -1 if not available. + /// Time immediately after the client receives the first byte of the response from the + /// server, cache, or local resource. The value is given in milliseconds relative to + /// startTime, -1 if not available. /// /// [Required] @@ -111,7 +111,7 @@ public partial class RequestTimingResult /// /// - /// Time immediately after the browser receives the last byte of the resource or immediately + /// Time immediately after the client receives the last byte of the resource or immediately /// before the transport connection is closed, whichever comes first. The value is given /// in milliseconds relative to startTime, -1 if not available. /// diff --git a/src/Playwright/Core/APIResponse.cs b/src/Playwright/Core/APIResponse.cs index f772339f5..f38845a45 100644 --- a/src/Playwright/Core/APIResponse.cs +++ b/src/Playwright/Core/APIResponse.cs @@ -57,6 +57,26 @@ public APIResponse(APIRequestContext context, Transport.Protocol.APIResponse ini public string Url => _initializer.Url; + public RequestTimingResult Timing + { + get + { + var timing = _initializer.Timing; + return new RequestTimingResult + { + StartTime = timing?.StartTime ?? -1, + DomainLookupStart = timing?.DomainLookupStart ?? -1, + DomainLookupEnd = timing?.DomainLookupEnd ?? -1, + ConnectStart = timing?.ConnectStart ?? -1, + SecureConnectionStart = timing?.SecureConnectionStart ?? -1, + ConnectEnd = timing?.ConnectEnd ?? -1, + RequestStart = timing?.RequestStart ?? -1, + ResponseStart = timing?.ResponseStart ?? -1, + ResponseEnd = timing == null ? -1 : _initializer.ResponseEndTiming, + }; + } + } + public Task SecurityDetailsAsync() => Task.FromResult(_initializer.SecurityDetails == null ? null : new ResponseSecurityDetailsResult { diff --git a/src/Playwright/Core/Locator.cs b/src/Playwright/Core/Locator.cs index f249fe4cb..41174c2fa 100644 --- a/src/Playwright/Core/Locator.cs +++ b/src/Playwright/Core/Locator.cs @@ -398,6 +398,18 @@ public Task WaitForAsync(LocatorWaitForOptions? options = null) }); } + public Task WaitForFunctionAsync(string expression, object? arg = default, LocatorWaitForFunctionOptions? options = default) + { + return _frame.SendMessageToServerAsync("waitForFunction", new Dictionary + { + ["selector"] = _selector, + ["strict"] = true, + ["expression"] = expression, + ["arg"] = ScriptsHelper.SerializedArgument(arg), + ["timeout"] = _frame.Timeout(options?.Timeout), + }); + } + internal Task ExpectAsync(string expression, FrameExpectOptions options, string? title) => this._frame.WrapApiCallAsync( () => _frame.ExpectAsync(_selector, expression, options), diff --git a/src/Playwright/Transport/Connection.cs b/src/Playwright/Transport/Connection.cs index d13ec912b..9707c0b9e 100644 --- a/src/Playwright/Transport/Connection.cs +++ b/src/Playwright/Transport/Connection.cs @@ -181,6 +181,11 @@ private async Task InnerSendMessageToServerAsync( ["internal"] = isInternal, ["wallTime"] = DateTimeOffset.Now.ToUnixTimeMilliseconds(), }; + if (sanitizedArgs.TryGetValue("timeout", out var timeout)) + { + sanitizedArgs.Remove("timeout"); + metadata["timeout"] = timeout; + } if (!string.IsNullOrEmpty(title)) { metadata["title"] = title; diff --git a/src/Playwright/Transport/Protocol/Generated/APIResponse.cs b/src/Playwright/Transport/Protocol/Generated/APIResponse.cs index aea48c06f..0eae706f0 100644 --- a/src/Playwright/Transport/Protocol/Generated/APIResponse.cs +++ b/src/Playwright/Transport/Protocol/Generated/APIResponse.cs @@ -49,4 +49,10 @@ internal class APIResponse [JsonPropertyName("serverAddr")] public RemoteAddr ServerAddr { get; set; } = null!; + + [JsonPropertyName("timing")] + public RequestTimingResult Timing { get; set; } = null!; + + [JsonPropertyName("responseEndTiming")] + public float ResponseEndTiming { get; set; } } diff --git a/src/Playwright/Transport/Protocol/Generated/Metadata.cs b/src/Playwright/Transport/Protocol/Generated/Metadata.cs index ea50cfcbc..e8c5b5a33 100644 --- a/src/Playwright/Transport/Protocol/Generated/Metadata.cs +++ b/src/Playwright/Transport/Protocol/Generated/Metadata.cs @@ -39,4 +39,7 @@ internal class Metadata [JsonPropertyName("stepId")] public string StepId { get; set; } = null!; + + [JsonPropertyName("timeout")] + public float Timeout { get; set; } } diff --git a/src/Playwright/Transport/Protocol/Generated/SerializedValue.cs b/src/Playwright/Transport/Protocol/Generated/SerializedValue.cs index a54cb1732..a3b02871d 100644 --- a/src/Playwright/Transport/Protocol/Generated/SerializedValue.cs +++ b/src/Playwright/Transport/Protocol/Generated/SerializedValue.cs @@ -68,6 +68,9 @@ internal class SerializedValue [JsonPropertyName("h")] public int? H { get; set; } + [JsonPropertyName("fn")] + public string Fn { get; set; } = null!; + [JsonPropertyName("id")] public int? Id { get; set; }