diff --git a/.claude/skills/playwright-roll/SKILL.md b/.claude/skills/playwright-roll/SKILL.md new file mode 100644 index 000000000..ae20cab7c --- /dev/null +++ b/.claude/skills/playwright-roll/SKILL.md @@ -0,0 +1,27 @@ +--- +name: playwright-roll +description: Roll Playwright .NET to a new version +--- + +Help the user roll to a new version of Playwright. +../../../ROLLING.md contains general instructions and scripts. + +Start with running the roll script to update the version and regenerate the API to see the state of things. + +```bash +./build.sh --roll +``` + +Afterwards, work through the list of changes that need to be backported. +You can find a list of pull requests that might need to be taking into account in the issue titled "Backport changes". +Work through them one-by-one and check off the items that you have handled. +Not all of them will be relevant, some might have partially been reverted, etc. - so feel free to check with the upstream release branch. + +Rolling includes: +- updating client implementation to match changes in the upstream JS implementation (see ../playwright/packages/playwright-core/src/client) +- adding a couple of new tests to verify new/changed functionality + +## Tips & Tricks +- Project checkouts are in the parent directory (`../`). +- when updating checkboxes, store the issue content into /tmp and edit it there, then update the issue based on the file +- use the "gh" cli to interact with GitHub diff --git a/README.md b/README.md index 831de7318..94d7d5d00 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ | | Linux | macOS | Windows | | :--- | :---: | :---: | :---: | -| Chromium 143.0.7499.4 | ✅ | ✅ | ✅ | +| Chromium 145.0.7632.6 | ✅ | ✅ | ✅ | | WebKit 26.0 | ✅ | ✅ | ✅ | -| Firefox 144.0.2 | ✅ | ✅ | ✅ | +| Firefox 146.0.1 | ✅ | ✅ | ✅ | 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/src/Common/Version.props b/src/Common/Version.props index bf7fc75f8..d9af6edfd 100644 --- a/src/Common/Version.props +++ b/src/Common/Version.props @@ -2,7 +2,7 @@ 1.57.0 $(AssemblyVersion) - 1.57.0-beta-1763739794000 + 1.58.0 $(AssemblyVersion) $(AssemblyVersion) true diff --git a/src/Playwright.TestingHarnessTest/package-lock.json b/src/Playwright.TestingHarnessTest/package-lock.json index c1b039ce4..631c8f66e 100644 --- a/src/Playwright.TestingHarnessTest/package-lock.json +++ b/src/Playwright.TestingHarnessTest/package-lock.json @@ -7,19 +7,18 @@ "": { "name": "playwright.testingharnesstest", "devDependencies": { - "@playwright/test": "1.57.0-beta-1763739794000", + "@playwright/test": "1.58.0", "@types/node": "^22.12.0", "fast-xml-parser": "^4.5.0" } }, "node_modules/@playwright/test": { - "version": "1.57.0-beta-1763739794000", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.57.0-beta-1763739794000.tgz", - "integrity": "sha512-il2Y+gK76m4ostGoqf7OpsM1TyAUewCInxMZp6jv9gIt7pX1qtGP9MM9lwQMV1w9eHswIRwROq1ZNY2lHMiGJw==", + "version": "1.58.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.58.0.tgz", + "integrity": "sha512-fWza+Lpbj6SkQKCrU6si4iu+fD2dD3gxNHFhUPxsfXBPhnv3rRSQVd0NtBUT9Z/RhF/boCBcuUaMUSTRTopjZg==", "dev": true, - "license": "Apache-2.0", "dependencies": { - "playwright": "1.57.0-beta-1763739794000" + "playwright": "1.58.0" }, "bin": { "playwright": "cli.js" @@ -67,7 +66,6 @@ "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, "hasInstallScript": true, - "license": "MIT", "optional": true, "os": [ "darwin" @@ -77,13 +75,12 @@ } }, "node_modules/playwright": { - "version": "1.57.0-beta-1763739794000", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.57.0-beta-1763739794000.tgz", - "integrity": "sha512-bpSDY1AfvivHwNXj0ShzcEgUx+lhwOIPvJhW28ZACOKFvVziw6ZNbJb1pXgkyPe5xe3wBU1m2PpyuWg9wxqsBQ==", + "version": "1.58.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.58.0.tgz", + "integrity": "sha512-2SVA0sbPktiIY/MCOPX8e86ehA/e+tDNq+e5Y8qjKYti2Z/JG7xnronT/TXTIkKbYGWlCbuucZ6dziEgkoEjQQ==", "dev": true, - "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.57.0-beta-1763739794000" + "playwright-core": "1.58.0" }, "bin": { "playwright": "cli.js" @@ -96,11 +93,10 @@ } }, "node_modules/playwright-core": { - "version": "1.57.0-beta-1763739794000", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.57.0-beta-1763739794000.tgz", - "integrity": "sha512-L8JmfQwOo6bILY2NgxbjFhHnhcgDtOA/itxrfibkfJI+xzdrFiDBtfi7nRbULDLlK5Ezp03sJLFfJQrYqZJ+uA==", + "version": "1.58.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.58.0.tgz", + "integrity": "sha512-aaoB1RWrdNi3//rOeKuMiS65UCcgOVljU46At6eFcOFPFHWtd2weHRRow6z/n+Lec0Lvu0k9ZPKJSjPugikirw==", "dev": true, - "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" }, @@ -124,12 +120,12 @@ }, "dependencies": { "@playwright/test": { - "version": "1.57.0-beta-1763739794000", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.57.0-beta-1763739794000.tgz", - "integrity": "sha512-il2Y+gK76m4ostGoqf7OpsM1TyAUewCInxMZp6jv9gIt7pX1qtGP9MM9lwQMV1w9eHswIRwROq1ZNY2lHMiGJw==", + "version": "1.58.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.58.0.tgz", + "integrity": "sha512-fWza+Lpbj6SkQKCrU6si4iu+fD2dD3gxNHFhUPxsfXBPhnv3rRSQVd0NtBUT9Z/RhF/boCBcuUaMUSTRTopjZg==", "dev": true, "requires": { - "playwright": "1.57.0-beta-1763739794000" + "playwright": "1.58.0" } }, "@types/node": { @@ -158,19 +154,19 @@ "optional": true }, "playwright": { - "version": "1.57.0-beta-1763739794000", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.57.0-beta-1763739794000.tgz", - "integrity": "sha512-bpSDY1AfvivHwNXj0ShzcEgUx+lhwOIPvJhW28ZACOKFvVziw6ZNbJb1pXgkyPe5xe3wBU1m2PpyuWg9wxqsBQ==", + "version": "1.58.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.58.0.tgz", + "integrity": "sha512-2SVA0sbPktiIY/MCOPX8e86ehA/e+tDNq+e5Y8qjKYti2Z/JG7xnronT/TXTIkKbYGWlCbuucZ6dziEgkoEjQQ==", "dev": true, "requires": { "fsevents": "2.3.2", - "playwright-core": "1.57.0-beta-1763739794000" + "playwright-core": "1.58.0" } }, "playwright-core": { - "version": "1.57.0-beta-1763739794000", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.57.0-beta-1763739794000.tgz", - "integrity": "sha512-L8JmfQwOo6bILY2NgxbjFhHnhcgDtOA/itxrfibkfJI+xzdrFiDBtfi7nRbULDLlK5Ezp03sJLFfJQrYqZJ+uA==", + "version": "1.58.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.58.0.tgz", + "integrity": "sha512-aaoB1RWrdNi3//rOeKuMiS65UCcgOVljU46At6eFcOFPFHWtd2weHRRow6z/n+Lec0Lvu0k9ZPKJSjPugikirw==", "dev": true }, "strnum": { diff --git a/src/Playwright.TestingHarnessTest/package.json b/src/Playwright.TestingHarnessTest/package.json index 727c43124..6c456c1c9 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.57.0-beta-1763739794000", + "@playwright/test": "1.58.0", "@types/node": "^22.12.0", "fast-xml-parser": "^4.5.0" } diff --git a/src/Playwright.Tests/WorkersTests.cs b/src/Playwright.Tests/WorkersTests.cs index d975698dc..db77a867f 100644 --- a/src/Playwright.Tests/WorkersTests.cs +++ b/src/Playwright.Tests/WorkersTests.cs @@ -207,7 +207,9 @@ public async Task ShouldFormatNumberUsingContextLocale() page.WaitForWorkerAsync(), page.EvaluateAsync("() => new Worker(URL.createObjectURL(new Blob(['console.log(1)'], {type: 'application/javascript'})))")); - Assert.AreEqual("10\u00A0000,2", await worker.EvaluateAsync("() => (10000.20).toLocaleString()")); + // 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()")); } [PlaywrightTest("workers.spec.ts", "should report console event on the worker")] diff --git a/src/Playwright/API/Generated/ILocator.cs b/src/Playwright/API/Generated/ILocator.cs index 807e562b8..b40360a22 100644 --- a/src/Playwright/API/Generated/ILocator.cs +++ b/src/Playwright/API/Generated/ILocator.cs @@ -358,8 +358,7 @@ public partial interface ILocator /// /// /// Returns locator description previously set with . - /// Returns null if no custom description has been set. Prefer Locator.toString() - /// for a human-readable representation, as it uses the description when available. + /// Returns null if no custom description has been set. /// /// **Usage** /// diff --git a/src/Playwright/API/Generated/ILocatorAssertions.cs b/src/Playwright/API/Generated/ILocatorAssertions.cs index f736c7c3d..eef9b4b1f 100644 --- a/src/Playwright/API/Generated/ILocatorAssertions.cs +++ b/src/Playwright/API/Generated/ILocatorAssertions.cs @@ -301,7 +301,7 @@ public partial interface ILocatorAssertions /// Let's see how we can use the assertion: /// /// // ✓ Contains the right items in the right order
- /// await Expect(Page.Locator("ul > li")).ToContainTextAsync(new string[] {"Text 1", "Text 3", "Text 4"});
+ /// await Expect(Page.Locator("ul > li")).ToContainTextAsync(new string[] {"Text 1", "Text 3"});
///
/// // ✖ Wrong order
/// await Expect(Page.Locator("ul > li")).ToContainTextAsync(new string[] {"Text 3", "Text 2"});
@@ -346,7 +346,7 @@ public partial interface ILocatorAssertions /// Let's see how we can use the assertion: /// /// // ✓ Contains the right items in the right order
- /// await Expect(Page.Locator("ul > li")).ToContainTextAsync(new string[] {"Text 1", "Text 3", "Text 4"});
+ /// await Expect(Page.Locator("ul > li")).ToContainTextAsync(new string[] {"Text 1", "Text 3"});
///
/// // ✖ Wrong order
/// await Expect(Page.Locator("ul > li")).ToContainTextAsync(new string[] {"Text 3", "Text 2"});
@@ -391,7 +391,7 @@ public partial interface ILocatorAssertions /// Let's see how we can use the assertion: /// /// // ✓ Contains the right items in the right order
- /// await Expect(Page.Locator("ul > li")).ToContainTextAsync(new string[] {"Text 1", "Text 3", "Text 4"});
+ /// await Expect(Page.Locator("ul > li")).ToContainTextAsync(new string[] {"Text 1", "Text 3"});
///
/// // ✖ Wrong order
/// await Expect(Page.Locator("ul > li")).ToContainTextAsync(new string[] {"Text 3", "Text 2"});
@@ -436,7 +436,7 @@ public partial interface ILocatorAssertions /// Let's see how we can use the assertion: /// /// // ✓ Contains the right items in the right order
- /// await Expect(Page.Locator("ul > li")).ToContainTextAsync(new string[] {"Text 1", "Text 3", "Text 4"});
+ /// await Expect(Page.Locator("ul > li")).ToContainTextAsync(new string[] {"Text 1", "Text 3"});
///
/// // ✖ Wrong order
/// await Expect(Page.Locator("ul > li")).ToContainTextAsync(new string[] {"Text 3", "Text 2"});
diff --git a/src/Playwright/API/Generated/IRoute.cs b/src/Playwright/API/Generated/IRoute.cs index 694c3d103..d7748750c 100644 --- a/src/Playwright/API/Generated/IRoute.cs +++ b/src/Playwright/API/Generated/IRoute.cs @@ -94,16 +94,20 @@ public partial interface IRoute /// If you want next matching handler in the chain to be invoked. /// /// - /// The Cookie header cannot be overridden using this method. If a value is provided, - /// it will be ignored, and the cookie will be loaded from the browser's cookie store. - /// To set custom cookies, use . + /// Some request headers are **forbidden** and cannot be overridden (for example, Cookie, + /// Host, Content-Length and others, see this + /// MDN page for full list). If an override is provided for a forbidden header, + /// it will be ignored and the original request header will be used. /// + /// To set custom cookies, use . ///
/// /// - /// The Cookie header cannot be overridden using this method. If a value is provided, - /// it will be ignored, and the cookie will be loaded from the browser's cookie store. - /// To set custom cookies, use . + /// Some request headers are **forbidden** and cannot be overridden (for example, Cookie, + /// Host, Content-Length and others, see this + /// MDN page for full list). If an override is provided for a forbidden header, + /// it will be ignored and the original request header will be used. To set custom + /// cookies, use . /// /// /// Call options diff --git a/src/Playwright/API/Generated/Options/BrowserTypeConnectOverCDPOptions.cs b/src/Playwright/API/Generated/Options/BrowserTypeConnectOverCDPOptions.cs index 15e437190..1d9a2c2a2 100644 --- a/src/Playwright/API/Generated/Options/BrowserTypeConnectOverCDPOptions.cs +++ b/src/Playwright/API/Generated/Options/BrowserTypeConnectOverCDPOptions.cs @@ -39,6 +39,7 @@ public BrowserTypeConnectOverCDPOptions(BrowserTypeConnectOverCDPOptions clone) } Headers = clone.Headers; + IsLocal = clone.IsLocal; SlowMo = clone.SlowMo; Timeout = clone.Timeout; } @@ -47,6 +48,16 @@ public BrowserTypeConnectOverCDPOptions(BrowserTypeConnectOverCDPOptions clone) [JsonPropertyName("headers")] public IEnumerable>? Headers { get; set; } + /// + /// + /// Tells Playwright that it runs on the same host as the CDP server. It will enable + /// certain optimizations that rely upon the file system being the same between Playwright + /// and the Browser. + /// + /// + [JsonPropertyName("isLocal")] + public bool? IsLocal { get; set; } + /// /// /// Slows down Playwright operations by the specified amount of milliseconds. Useful diff --git a/src/Playwright/API/Generated/Options/BrowserTypeLaunchOptions.cs b/src/Playwright/API/Generated/Options/BrowserTypeLaunchOptions.cs index d41cba614..21524e913 100644 --- a/src/Playwright/API/Generated/Options/BrowserTypeLaunchOptions.cs +++ b/src/Playwright/API/Generated/Options/BrowserTypeLaunchOptions.cs @@ -41,7 +41,6 @@ public BrowserTypeLaunchOptions(BrowserTypeLaunchOptions clone) Args = clone.Args; Channel = clone.Channel; ChromiumSandbox = clone.ChromiumSandbox; - Devtools = clone.Devtools; DownloadsPath = clone.DownloadsPath; Env = clone.Env; ExecutablePath = clone.ExecutablePath; @@ -93,21 +92,6 @@ public BrowserTypeLaunchOptions(BrowserTypeLaunchOptions clone) [JsonPropertyName("chromiumSandbox")] public bool? ChromiumSandbox { get; set; } - /// - /// - /// **DEPRECATED** Use debugging - /// tools instead. - /// - /// - /// **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If - /// this option is true, the option will - /// be set false. - /// - /// - [JsonPropertyName("devtools")] - [System.Obsolete] - public bool? Devtools { get; set; } - /// /// /// If specified, accepted downloads are downloaded into this directory. Otherwise, @@ -160,8 +144,7 @@ public BrowserTypeLaunchOptions(BrowserTypeLaunchOptions clone) /// /// Whether to run browser in headless mode. More details for Chromium /// and Firefox. - /// Defaults to true unless the option - /// is true. + /// Defaults to true. /// /// [JsonPropertyName("headless")] diff --git a/src/Playwright/API/Generated/Options/BrowserTypeLaunchPersistentContextOptions.cs b/src/Playwright/API/Generated/Options/BrowserTypeLaunchPersistentContextOptions.cs index 83ff8f082..8ad5df706 100644 --- a/src/Playwright/API/Generated/Options/BrowserTypeLaunchPersistentContextOptions.cs +++ b/src/Playwright/API/Generated/Options/BrowserTypeLaunchPersistentContextOptions.cs @@ -49,7 +49,6 @@ public BrowserTypeLaunchPersistentContextOptions(BrowserTypeLaunchPersistentCont ColorScheme = clone.ColorScheme; Contrast = clone.Contrast; DeviceScaleFactor = clone.DeviceScaleFactor; - Devtools = clone.Devtools; DownloadsPath = clone.DownloadsPath; Env = clone.Env; ExecutablePath = clone.ExecutablePath; @@ -232,21 +231,6 @@ public BrowserTypeLaunchPersistentContextOptions(BrowserTypeLaunchPersistentCont [JsonPropertyName("deviceScaleFactor")] public float? DeviceScaleFactor { get; set; } - /// - /// - /// **DEPRECATED** Use debugging - /// tools instead. - /// - /// - /// **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If - /// this option is true, the - /// option will be set false. - /// - /// - [JsonPropertyName("devtools")] - [System.Obsolete] - public bool? Devtools { get; set; } - /// /// /// If specified, accepted downloads are downloaded into this directory. Otherwise, @@ -330,8 +314,7 @@ public BrowserTypeLaunchPersistentContextOptions(BrowserTypeLaunchPersistentCont /// /// Whether to run browser in headless mode. More details for Chromium /// and Firefox. - /// Defaults to true unless the option - /// is true. + /// Defaults to true. /// /// [JsonPropertyName("headless")] diff --git a/src/Playwright/CompatibilitySuppressions.xml b/src/Playwright/CompatibilitySuppressions.xml index 051ce2bd0..a21ccc5ff 100644 --- a/src/Playwright/CompatibilitySuppressions.xml +++ b/src/Playwright/CompatibilitySuppressions.xml @@ -1,5 +1,5 @@  - + CP0001 @@ -22,6 +22,34 @@ lib/netstandard2.0/Microsoft.Playwright.dll true + + CP0002 + M:Microsoft.Playwright.BrowserTypeLaunchOptions.get_Devtools + lib/netstandard2.0/Microsoft.Playwright.dll + lib/netstandard2.0/Microsoft.Playwright.dll + true + + + CP0002 + M:Microsoft.Playwright.BrowserTypeLaunchOptions.set_Devtools(System.Nullable{System.Boolean}) + lib/netstandard2.0/Microsoft.Playwright.dll + lib/netstandard2.0/Microsoft.Playwright.dll + true + + + CP0002 + M:Microsoft.Playwright.BrowserTypeLaunchPersistentContextOptions.get_Devtools + lib/netstandard2.0/Microsoft.Playwright.dll + lib/netstandard2.0/Microsoft.Playwright.dll + true + + + CP0002 + M:Microsoft.Playwright.BrowserTypeLaunchPersistentContextOptions.set_Devtools(System.Nullable{System.Boolean}) + lib/netstandard2.0/Microsoft.Playwright.dll + lib/netstandard2.0/Microsoft.Playwright.dll + true + CP0002 M:Microsoft.Playwright.IPage.get_Accessibility diff --git a/src/Playwright/Core/BrowserType.cs b/src/Playwright/Core/BrowserType.cs index dac243264..4246ad57a 100644 --- a/src/Playwright/Core/BrowserType.cs +++ b/src/Playwright/Core/BrowserType.cs @@ -66,9 +66,6 @@ public async Task LaunchAsync(BrowserTypeLaunchOptions? options = defa { "handleSIGINT", options.HandleSIGINT }, { "handleSIGTERM", options.HandleSIGTERM }, { "headless", options.Headless }, -#pragma warning disable CS0612 // Type or member is obsolete - { "devtools", options.Devtools }, -#pragma warning restore CS0612 // Type or member is obsolete { "env", options.Env?.ToProtocol() }, { "proxy", options.Proxy }, { "downloadsPath", options.DownloadsPath }, @@ -103,9 +100,6 @@ public async Task LaunchPersistentContextAsync(string userDataD ["handleSIGHUP"] = options.HandleSIGHUP, ["timeout"] = TimeoutSettings.LaunchTimeout(options.Timeout), ["env"] = options.Env?.ToProtocol(), -#pragma warning disable CS0612 // Type or member is obsolete - ["devtools"] = options.Devtools, -#pragma warning restore CS0612 // Type or member is obsolete ["slowMo"] = options.SlowMo, ["ignoreHTTPSErrors"] = options.IgnoreHTTPSErrors, ["bypassCSP"] = options.BypassCSP, @@ -273,6 +267,7 @@ public async Task ConnectOverCDPAsync(string endpointURL, BrowserTypeC { "headers", options.Headers?.ToProtocol() }, { "slowMo", options.SlowMo }, { "timeout", TimeoutSettings.LaunchTimeout(options.Timeout) }, + { "isLocal", options.IsLocal }, }).ConfigureAwait(false); Browser browser = result.GetProperty("browser").ToObject(_connection.DefaultJsonSerializerOptions); browser.ConnectToBrowserType(this, null); diff --git a/src/Playwright/Transport/Protocol/Generated/AgentUsage.cs b/src/Playwright/Transport/Protocol/Generated/AgentUsage.cs new file mode 100644 index 000000000..8bcfaac81 --- /dev/null +++ b/src/Playwright/Transport/Protocol/Generated/AgentUsage.cs @@ -0,0 +1,39 @@ +/* + * 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.Transport.Protocol; + +internal class AgentUsage +{ + [JsonPropertyName("turns")] + public int Turns { get; set; } + + [JsonPropertyName("inputTokens")] + public int InputTokens { get; set; } + + [JsonPropertyName("outputTokens")] + public int OutputTokens { get; set; } +} diff --git a/src/Playwright/Transport/Protocol/Generated/PageAgentInitializer.cs b/src/Playwright/Transport/Protocol/Generated/PageAgentInitializer.cs new file mode 100644 index 000000000..b50744ade --- /dev/null +++ b/src/Playwright/Transport/Protocol/Generated/PageAgentInitializer.cs @@ -0,0 +1,33 @@ +/* + * 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.Transport.Protocol; + +internal class PageAgentInitializer : EventTargetInitializer +{ + [JsonPropertyName("page")] + public Core.Page Page { get; set; } = null!; +}