You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .claude/skills/playwright-roll/SKILL.md
+14-6Lines changed: 14 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,23 +5,31 @@ description: Roll Playwright .NET to a new version
5
5
6
6
Help the user roll to a new version of Playwright.
7
7
../../../ROLLING.md contains general instructions and scripts.
8
+
See also [CLAUDE.md](../../../CLAUDE.md) for build, test, and architecture details.
8
9
9
-
Start with running the roll script to update the version and regenerate the API to see the state of things.
10
+
Unless the exact version is specified by the user, you need to find the latest version of the driver.
11
+
Check the publish workflow here: https://github.com/microsoft/playwright/actions/workflows/publish_release.yml. The step that builds and publishes the driver contains the exact version you need.
12
+
13
+
Now, with the driver version known, always start with running the roll script to update the version and regenerate the API to see the state of things.
10
14
11
15
```bash
12
16
./build.sh --roll <driver-version>
13
17
```
14
18
15
19
Afterwards, work through the list of changes that need to be backported.
16
-
You can find a list of pull requests that might need to be taking into account in the issue titled "Backport changes".
17
-
Work through them one-by-one and check off the items that you have handled.
18
-
Not all of them will be relevant, some might have partially been reverted, etc. - so feel free to check with the upstream release branch.
20
+
You can find a list of pull requests that might need to be taking into account in the issue titled "Backport changes". Ignore the items that are already checked off.
21
+
22
+
Some items may be irrelevant to the .NET implementation - feel free to check with the upstream.
23
+
24
+
Some items may be connected, for example when the API has changed multiple times. In this case, handle them alltogether, aligning with the latest change. Check upstream to see the latest implementation.
25
+
26
+
Otherwise, work through items one-by-one.
19
27
20
28
Rolling includes:
21
29
- updating client implementation to match changes in the upstream JS implementation (see ../playwright/packages/playwright-core/src/client)
22
30
- adding a couple of new tests to verify new/changed functionality
23
31
24
32
## Tips & Tricks
25
33
- Project checkouts are in the parent directory (`../`).
26
-
-when updating checkboxes, store the issue content into /tmp and edit it there, then update the issue based on the file
27
-
-use the "gh" cli to interact with GitHub
34
+
-When updating checkboxes, store the issue content into /tmp and edit it there, then update the issue based on the file.
grep "^ Failed" /tmp/test-results.txt # list failures
28
+
tail -5 /tmp/test-results.txt # summary
29
+
```
30
+
31
+
## Architecture
32
+
33
+
### Generated vs hand-written code
34
+
- Public API interfaces (e.g. `src/Playwright/API/Generated/IPage.cs`) are **generated** by `../playwright/utils/doclint/generateDotnetApi.js` from the upstream API docs. Do not hand-edit these — update the generator instead.
35
+
- The generator uses `classNameMap` for type mappings (e.g. `Disposable` → `IAsyncDisposable`, `boolean` → `bool`). Add entries there when a Playwright type should map to a different .NET type.
36
+
- The generator skips generating interface files for types like `TimeoutException` and `IAsyncDisposable` that map to built-in .NET types.
37
+
- Supplement interfaces (`src/Playwright/API/Supplements/`) are hand-written and extend the generated interfaces with .NET-specific overloads.
38
+
- Internal implementations live in `src/Playwright/Core/` (namespace `Microsoft.Playwright.Core`). These implement both the generated and supplement interfaces.
39
+
40
+
### Key patterns
41
+
- All Playwright objects extend `ChannelOwner` and communicate via `SendMessageToServerAsync`.
42
+
-`Connection.cs` has a factory switch that creates the right `ChannelOwner` subclass based on `ChannelOwnerType`.
43
+
- New channel object types require: enum entry in `ChannelOwnerType.cs`, case in `Connection.cs`, initializer in `Transport/Protocol/Generated/`, and a `Core/` class.
44
+
- Public APIs should use .NET standard types (e.g. `IAsyncDisposable`) not custom Playwright types. Internal helpers (e.g. `Disposable` class in `Core/`) stay internal.
45
+
46
+
## Commits
47
+
- Do not include "co-authored" block in the commit message.
48
+
49
+
## Rolling to a new Playwright version
50
+
See [.claude/skills/playwright-roll/SKILL.md](.claude/skills/playwright-roll/SKILL.md).
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**.
0 commit comments