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
14 changes: 14 additions & 0 deletions .claude/skills/playwright-roll/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@ 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

## Renaming generated types

When the API generator produces an unhelpful name for a return type (e.g. `Bind` instead of `BrowserBindResult`), you can control it by adding a struct alias in the upstream docs.

In the docs markdown file (e.g. `docs/src/api/class-browser.md`), change the return type from `<[Object]>` to `<[Object=DesiredName]>`:

```diff
-- returns: <[Object]>
+- returns: <[Object=BrowserBindResult]>
- `endpoint` <[string]>
```

The `=Name` syntax sets `structName` on the parsed type, which the .NET generator uses directly as the class name. After making this change, re-run `./build.sh --roll <version>` to regenerate, then update any hand-written implementation code to use the new type name.

## 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.
Expand Down
35 changes: 35 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,41 @@ tail -5 /tmp/test-results.txt # summary
- New channel object types require: enum entry in `ChannelOwnerType.cs`, case in `Connection.cs`, initializer in `Transport/Protocol/Generated/`, and a `Core/` class.
- Public APIs should use .NET standard types (e.g. `IAsyncDisposable`) not custom Playwright types. Internal helpers (e.g. `Disposable` class in `Core/`) stay internal.

## Commit Convention

Before committing, run `dotnet format ./src/ -v:diag` and fix style issues.

Semantic commit messages: `label(scope): description`

Labels: `fix`, `feat`, `chore`, `docs`, `test`, `devops`

```bash
git checkout -b fix-39562
# ... make changes ...
git add <changed-files>
git commit -m "$(cat <<'EOF'
fix(proxy): handle SOCKS proxy authentication

Fixes: https://github.com/microsoft/playwright/issues/39562
EOF
)"
git push origin fix-39562
gh pr create --repo microsoft/playwright --head username:fix-39562 \
--title "fix(proxy): handle SOCKS proxy authentication" \
--body "$(cat <<'EOF'
## Summary
- <describe the change very! briefly>

Fixes https://github.com/microsoft/playwright/issues/39562
EOF
)"
```

Never add Co-Authored-By agents in commit message.
Never add "Generated with" in commit message.
Never add test plan to PR description. Keep PR description short — a few bullet points at most.
Branch naming for issue fixes: `fix-<issue-number>`

## Commits
- Do not include "co-authored" block in the commit message.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
| | Linux | macOS | Windows |
| :--- | :---: | :---: | :---: |
| Chromium <!-- GEN:chromium-version -->147.0.7727.15<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| WebKit <!-- GEN:webkit-version -->26.0<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| WebKit <!-- GEN:webkit-version -->26.4<!-- GEN:stop --> | ✅ | ✅ | ✅ |
| Firefox <!-- GEN:firefox-version -->148.0.2<!-- 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.58.0</AssemblyVersion>
<PackageVersion>$(AssemblyVersion)</PackageVersion>
<DriverVersion>1.60.0-alpha-2026-03-31</DriverVersion>
<DriverVersion>1.59.1</DriverVersion>
<ReleaseVersion>$(AssemblyVersion)</ReleaseVersion>
<FileVersion>$(AssemblyVersion)</FileVersion>
<NoDefaultExcludes>true</NoDefaultExcludes>
Expand Down
46 changes: 23 additions & 23 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.60.0-alpha-2026-03-31",
"@playwright/test": "1.59.1",
"@types/node": "^22.12.0",
"fast-xml-parser": "^4.5.0"
}
Expand Down
43 changes: 43 additions & 0 deletions src/Playwright/API/Generated/Enums/AnnotatePosition.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* 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 AnnotatePosition
{
[EnumMember(Value = "top-left")]
TopLeft,
[EnumMember(Value = "top")]
Top,
[EnumMember(Value = "top-right")]
TopRight,
[EnumMember(Value = "bottom-left")]
BottomLeft,
[EnumMember(Value = "bottom")]
Bottom,
[EnumMember(Value = "bottom-right")]
BottomRight,
}
13 changes: 13 additions & 0 deletions src/Playwright/API/Generated/IBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,19 @@ public partial interface IBrowser
/// <param name="options">Call options</param>
Task<IPage> NewPageAsync(BrowserNewPageOptions? options = default);

/// <summary>
/// <para>
/// Binds the browser to a named pipe or web socket, making it available for other clients
/// to connect to.
/// </para>
/// </summary>
/// <param name="title">Title of the browser server, used for identification.</param>
/// <param name="options">Call options</param>
Task<BrowserBindResult> BindAsync(string title, BrowserBindOptions? options = default);

/// <summary><para>Unbinds the browser server previously bound with <see cref="IBrowser.BindAsync"/>.</para></summary>
Task UnbindAsync();

/// <summary><para>Returns the browser version.</para></summary>
string Version { get; }
}
6 changes: 6 additions & 0 deletions src/Playwright/API/Generated/IPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2327,6 +2327,12 @@ public partial interface IPage
/// <param name="handler">Handler function to route the WebSocket.</param>
Task RouteWebSocketAsync(Func<string, bool> url, Action<IWebSocketRoute> handler);

/// <summary>
/// <para><see cref="IScreencast"/> object associated with this page.</para>
/// <para>**Usage**</para>
/// </summary>
public IScreencast Screencast { get; }

/// <summary><para>Returns the buffer with the captured screenshot.</para></summary>
/// <param name="options">Call options</param>
Task<byte[]> ScreenshotAsync(PageScreenshotOptions? options = default);
Expand Down
12 changes: 12 additions & 0 deletions src/Playwright/API/Generated/IScreencast.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,21 @@ public partial interface IScreencast
/// <param name="options">Call options</param>
Task ShowChapterAsync(string title, ScreencastShowChapterOptions? options = default);

/// <summary>
/// <para>
/// Enables visual annotations on interacted elements. Returns a disposable that stops
/// showing actions when disposed.
/// </para>
/// </summary>
/// <param name="options">Call options</param>
Task<IAsyncDisposable> ShowActionsAsync(ScreencastShowActionsOptions? options = default);

/// <summary><para>Shows overlays.</para></summary>
Task ShowOverlaysAsync();

/// <summary><para>Removes action decorations.</para></summary>
Task HideActionsAsync();

/// <summary><para>Hides overlays without removing them.</para></summary>
Task HideOverlaysAsync();
}
66 changes: 66 additions & 0 deletions src/Playwright/API/Generated/Options/BrowserBindOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* 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 BrowserBindOptions
{
public BrowserBindOptions() { }

public BrowserBindOptions(BrowserBindOptions clone)
{
if (clone == null)
{
return;
}

Host = clone.Host;
Port = clone.Port;
WorkspaceDir = clone.WorkspaceDir;
}

/// <summary>
/// <para>
/// Host to bind the web socket server to. When specified, a web socket server is created
/// instead of a named pipe.
/// </para>
/// </summary>
[JsonPropertyName("host")]
public string? Host { get; set; }

/// <summary>
/// <para>
/// Port to bind the web socket server to. When specified, a web socket server is created
/// instead of a named pipe. Use <c>0</c> to let the OS pick an available port.
/// </para>
/// </summary>
[JsonPropertyName("port")]
public int? Port { get; set; }

/// <summary><para>Working directory associated with this browser server.</para></summary>
[JsonPropertyName("workspaceDir")]
public string? WorkspaceDir { get; set; }
}
Loading
Loading