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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .claude/skills/playwright-roll/SKILL.md
Original file line number Diff line number Diff line change
@@ -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 <driver-version>
```

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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

| | Linux | macOS | Windows |
| :--- | :---: | :---: | :---: |
| Chromium <!-- GEN:chromium-version -->143.0.7499.4<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| Chromium <!-- GEN:chromium-version -->145.0.7632.6<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| WebKit <!-- GEN:webkit-version -->26.0<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| Firefox <!-- GEN:firefox-version -->144.0.2<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| Firefox <!-- GEN:firefox-version -->146.0.1<!-- GEN:stop --> | ✅ | ✅ | ✅ |

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

Expand Down
2 changes: 1 addition & 1 deletion src/Common/Version.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<AssemblyVersion>1.57.0</AssemblyVersion>
<PackageVersion>$(AssemblyVersion)</PackageVersion>
<DriverVersion>1.57.0-beta-1763739794000</DriverVersion>
<DriverVersion>1.58.0</DriverVersion>
<ReleaseVersion>$(AssemblyVersion)</ReleaseVersion>
<FileVersion>$(AssemblyVersion)</FileVersion>
<NoDefaultExcludes>true</NoDefaultExcludes>
Expand Down
50 changes: 23 additions & 27 deletions src/Playwright.TestingHarnessTest/package-lock.json

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

2 changes: 1 addition & 1 deletion src/Playwright.TestingHarnessTest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "playwright.testingharnesstest",
"private": true,
"devDependencies": {
"@playwright/test": "1.57.0-beta-1763739794000",
"@playwright/test": "1.58.0",
"@types/node": "^22.12.0",
"fast-xml-parser": "^4.5.0"
}
Expand Down
4 changes: 3 additions & 1 deletion src/Playwright.Tests/WorkersTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>("() => (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<string>("() => (10000.20).toLocaleString()"));
}

[PlaywrightTest("workers.spec.ts", "should report console event on the worker")]
Expand Down
3 changes: 1 addition & 2 deletions src/Playwright/API/Generated/ILocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,7 @@ public partial interface ILocator
/// <summary>
/// <para>
/// Returns locator description previously set with <see cref="ILocator.Describe"/>.
/// Returns <c>null</c> if no custom description has been set. Prefer <c>Locator.toString()</c>
/// for a human-readable representation, as it uses the description when available.
/// Returns <c>null</c> if no custom description has been set.
/// </para>
/// <para>**Usage**</para>
/// <code>
Expand Down
8 changes: 4 additions & 4 deletions src/Playwright/API/Generated/ILocatorAssertions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public partial interface ILocatorAssertions
/// <para>Let's see how we can use the assertion:</para>
/// <code>
/// // ✓ Contains the right items in the right order<br/>
/// await Expect(Page.Locator("ul &gt; li")).ToContainTextAsync(new string[] {"Text 1", "Text 3", "Text 4"});<br/>
/// await Expect(Page.Locator("ul &gt; li")).ToContainTextAsync(new string[] {"Text 1", "Text 3"});<br/>
/// <br/>
/// // ✖ Wrong order<br/>
/// await Expect(Page.Locator("ul &gt; li")).ToContainTextAsync(new string[] {"Text 3", "Text 2"});<br/>
Expand Down Expand Up @@ -346,7 +346,7 @@ public partial interface ILocatorAssertions
/// <para>Let's see how we can use the assertion:</para>
/// <code>
/// // ✓ Contains the right items in the right order<br/>
/// await Expect(Page.Locator("ul &gt; li")).ToContainTextAsync(new string[] {"Text 1", "Text 3", "Text 4"});<br/>
/// await Expect(Page.Locator("ul &gt; li")).ToContainTextAsync(new string[] {"Text 1", "Text 3"});<br/>
/// <br/>
/// // ✖ Wrong order<br/>
/// await Expect(Page.Locator("ul &gt; li")).ToContainTextAsync(new string[] {"Text 3", "Text 2"});<br/>
Expand Down Expand Up @@ -391,7 +391,7 @@ public partial interface ILocatorAssertions
/// <para>Let's see how we can use the assertion:</para>
/// <code>
/// // ✓ Contains the right items in the right order<br/>
/// await Expect(Page.Locator("ul &gt; li")).ToContainTextAsync(new string[] {"Text 1", "Text 3", "Text 4"});<br/>
/// await Expect(Page.Locator("ul &gt; li")).ToContainTextAsync(new string[] {"Text 1", "Text 3"});<br/>
/// <br/>
/// // ✖ Wrong order<br/>
/// await Expect(Page.Locator("ul &gt; li")).ToContainTextAsync(new string[] {"Text 3", "Text 2"});<br/>
Expand Down Expand Up @@ -436,7 +436,7 @@ public partial interface ILocatorAssertions
/// <para>Let's see how we can use the assertion:</para>
/// <code>
/// // ✓ Contains the right items in the right order<br/>
/// await Expect(Page.Locator("ul &gt; li")).ToContainTextAsync(new string[] {"Text 1", "Text 3", "Text 4"});<br/>
/// await Expect(Page.Locator("ul &gt; li")).ToContainTextAsync(new string[] {"Text 1", "Text 3"});<br/>
/// <br/>
/// // ✖ Wrong order<br/>
/// await Expect(Page.Locator("ul &gt; li")).ToContainTextAsync(new string[] {"Text 3", "Text 2"});<br/>
Expand Down
16 changes: 10 additions & 6 deletions src/Playwright/API/Generated/IRoute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,20 @@ public partial interface IRoute
/// If you want next matching handler in the chain to be invoked.
/// </para>
/// <para>
/// The <c>Cookie</c> 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 <see cref="IBrowserContext.AddCookiesAsync"/>.
/// Some request headers are **forbidden** and cannot be overridden (for example, <c>Cookie</c>,
/// <c>Host</c>, <c>Content-Length</c> and others, see <a href="https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_request_header">this
/// MDN page</a> for full list). If an override is provided for a forbidden header,
/// it will be ignored and the original request header will be used.
/// </para>
/// <para>To set custom cookies, use <see cref="IBrowserContext.AddCookiesAsync"/>.</para>
/// </summary>
/// <remarks>
/// <para>
/// The <c>Cookie</c> 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 <see cref="IBrowserContext.AddCookiesAsync"/>.
/// Some request headers are **forbidden** and cannot be overridden (for example, <c>Cookie</c>,
/// <c>Host</c>, <c>Content-Length</c> and others, see <a href="https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_request_header">this
/// MDN page</a> 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 <see cref="IBrowserContext.AddCookiesAsync"/>.
/// </para>
/// </remarks>
/// <param name="options">Call options</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public BrowserTypeConnectOverCDPOptions(BrowserTypeConnectOverCDPOptions clone)
}

Headers = clone.Headers;
IsLocal = clone.IsLocal;
SlowMo = clone.SlowMo;
Timeout = clone.Timeout;
}
Expand All @@ -47,6 +48,16 @@ public BrowserTypeConnectOverCDPOptions(BrowserTypeConnectOverCDPOptions clone)
[JsonPropertyName("headers")]
public IEnumerable<KeyValuePair<string, string>>? Headers { get; set; }

/// <summary>
/// <para>
/// 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.
/// </para>
/// </summary>
[JsonPropertyName("isLocal")]
public bool? IsLocal { get; set; }

/// <summary>
/// <para>
/// Slows down Playwright operations by the specified amount of milliseconds. Useful
Expand Down
19 changes: 1 addition & 18 deletions src/Playwright/API/Generated/Options/BrowserTypeLaunchOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -93,21 +92,6 @@ public BrowserTypeLaunchOptions(BrowserTypeLaunchOptions clone)
[JsonPropertyName("chromiumSandbox")]
public bool? ChromiumSandbox { get; set; }

/// <summary>
/// <para>
/// **DEPRECATED** Use <a href="https://playwright.dev/dotnet/docs/debug">debugging
/// tools</a> instead.
/// </para>
/// <para>
/// **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If
/// this option is <c>true</c>, the <see cref="IBrowserType.LaunchAsync"/> option will
/// be set <c>false</c>.
/// </para>
/// </summary>
[JsonPropertyName("devtools")]
[System.Obsolete]
public bool? Devtools { get; set; }

/// <summary>
/// <para>
/// If specified, accepted downloads are downloaded into this directory. Otherwise,
Expand Down Expand Up @@ -160,8 +144,7 @@ public BrowserTypeLaunchOptions(BrowserTypeLaunchOptions clone)
/// <para>
/// Whether to run browser in headless mode. More details for <a href="https://developers.google.com/web/updates/2017/04/headless-chrome">Chromium</a>
/// and <a href="https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/">Firefox</a>.
/// Defaults to <c>true</c> unless the <see cref="IBrowserType.LaunchAsync"/> option
/// is <c>true</c>.
/// Defaults to <c>true</c>.
/// </para>
/// </summary>
[JsonPropertyName("headless")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -232,21 +231,6 @@ public BrowserTypeLaunchPersistentContextOptions(BrowserTypeLaunchPersistentCont
[JsonPropertyName("deviceScaleFactor")]
public float? DeviceScaleFactor { get; set; }

/// <summary>
/// <para>
/// **DEPRECATED** Use <a href="https://playwright.dev/dotnet/docs/debug">debugging
/// tools</a> instead.
/// </para>
/// <para>
/// **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If
/// this option is <c>true</c>, the <see cref="IBrowserType.LaunchPersistentContextAsync"/>
/// option will be set <c>false</c>.
/// </para>
/// </summary>
[JsonPropertyName("devtools")]
[System.Obsolete]
public bool? Devtools { get; set; }

/// <summary>
/// <para>
/// If specified, accepted downloads are downloaded into this directory. Otherwise,
Expand Down Expand Up @@ -330,8 +314,7 @@ public BrowserTypeLaunchPersistentContextOptions(BrowserTypeLaunchPersistentCont
/// <para>
/// Whether to run browser in headless mode. More details for <a href="https://developers.google.com/web/updates/2017/04/headless-chrome">Chromium</a>
/// and <a href="https://hacks.mozilla.org/2017/12/using-headless-mode-in-firefox/">Firefox</a>.
/// Defaults to <c>true</c> unless the <see cref="IBrowserType.LaunchAsync"/> option
/// is <c>true</c>.
/// Defaults to <c>true</c>.
/// </para>
/// </summary>
[JsonPropertyName("headless")]
Expand Down
30 changes: 29 additions & 1 deletion src/Playwright/CompatibilitySuppressions.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- https://learn.microsoft.com/dotnet/fundamentals/package-validation/diagnostic-ids -->
<!-- https://learn.microsoft.com/en-us/dotnet/fundamentals/package-validation/diagnostic-ids -->
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Suppression>
<DiagnosticId>CP0001</DiagnosticId>
Expand All @@ -22,6 +22,34 @@
<Right>lib/netstandard2.0/Microsoft.Playwright.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Microsoft.Playwright.BrowserTypeLaunchOptions.get_Devtools</Target>
<Left>lib/netstandard2.0/Microsoft.Playwright.dll</Left>
<Right>lib/netstandard2.0/Microsoft.Playwright.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Microsoft.Playwright.BrowserTypeLaunchOptions.set_Devtools(System.Nullable{System.Boolean})</Target>
<Left>lib/netstandard2.0/Microsoft.Playwright.dll</Left>
<Right>lib/netstandard2.0/Microsoft.Playwright.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Microsoft.Playwright.BrowserTypeLaunchPersistentContextOptions.get_Devtools</Target>
<Left>lib/netstandard2.0/Microsoft.Playwright.dll</Left>
<Right>lib/netstandard2.0/Microsoft.Playwright.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Microsoft.Playwright.BrowserTypeLaunchPersistentContextOptions.set_Devtools(System.Nullable{System.Boolean})</Target>
<Left>lib/netstandard2.0/Microsoft.Playwright.dll</Left>
<Right>lib/netstandard2.0/Microsoft.Playwright.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Microsoft.Playwright.IPage.get_Accessibility</Target>
Expand Down
Loading
Loading