| Dimension | Shared | Only in A | Only in B | Overlap |
|---|---|---|---|---|
| Sections | 0 | 17 | 1 | 0% |
| Commands | 0 | 32 | 0 | 0% |
| Section tags | 1 | 10 | 0 | 9% |
What each file covers
Sections
0 shared · 17 only in A · 1 only in B- − Monorepo Packages
- − Browser Packages
- − Tooling Packages
- − Component Testing
- − Key Directories
- − Build
- − Lint and type check
- − Test Commands
- − Filtering
- − Test Directories and Fixtures
- − DEPS System
- − Coding Convention
- − Commit Convention
- − ... make changes ...
- − **Never `git push` without an explicit instruction to push.**
- − Summary
- − Development Guides
- + PR Review Guidelines
Commands
0 shared · 32 only in A · 0 only in B- − npm run build
- − npm run watch
- − npm run flint
- − npm run ctest tests/page/locator-click.spec.ts
- − npm run ctest tests/page/locator-click.spec.ts:12
- − npm run ctest -- --grep "should click"
- − npm run ctest-mcp snapshot
- − git checkout -b fix-39562
- − git add <changed-files>
- − git commit -m "$(cat <<'EOF'
- − git push origin fix-39562
- − gh pr create --repo microsoft/playwright --head username:fix-39562 \
- − playwright-core
- − playwright
- − playwright-test
- − playwright-client
- − playwright-chromium
- − playwright-firefox
- − playwright-webkit
- − playwright-browser-chromium
- − playwright-browser-firefox
- − playwright-browser-webkit
- − playwright-ct-core
- − playwright-ct-react
- − playwright-ct-vue
- − tsc --noEmit
- − npm run ctest <filter>
- − npm run test <filter> -- --project=<chromium,firefix,webkit>
- − npm run ttest <filter>
- − npm run ctest-mcp <filter>
- − npm run test-mcp <filter> -- --project=<chromium,firefox,webkit>
- − git push
Section tags
1 shared · 10 only in A · 0 only in B- − build
- − test
- − lint-format
- − code-style
- − architecture
- − types
- − dependencies
- − ui
- − monorepo
- − do-not
- git-pr
Line diff
microsoft/playwright · CLAUDE.md
@@ −1 @@
1### Monorepo Packages
2
3| Package | npm name | Purpose |
4|---------|----------|---------|
5| `playwright-core` | `playwright-core` | Browser automation engine: client, server, dispatchers, protocol |
6| `playwright` | `playwright` | Test runner + browser automation (public package) |
7| `playwright-test` | `@playwright/test` | Test runner entry point |
8| `playwright-client` | `@playwright/client` | Standalone client package |
9| `protocol` | *(internal)* | RPC protocol definitions (`protocol.yml` → generated `channels.d.ts`) |
10
11### Browser Packages
12
13`playwright-chromium`, `playwright-firefox`, `playwright-webkit` — per-browser distributions.
14`playwright-browser-chromium`, `playwright-browser-firefox`, `playwright-browser-webkit` — binary packages.
15
16### Tooling Packages
17
18| Package | Purpose |
19|---------|---------|
20| `html-reporter` | HTML test report viewer |
21| `trace-viewer` | Trace viewer UI |
22| `recorder` | Test recorder |
23| `web` | Shared web UI components |
24| `injected` | Scripts injected into browser pages |
25
26### Component Testing
27
28`playwright-ct-core`, `playwright-ct-react`, `playwright-ct-vue`
29
30### Key Directories
31
32| Directory | Purpose |
33|-----------|---------|
34| `tests/` | All test suites (page, library, playwright-test, mcp, components, etc.) |
35| `docs/src/` | API documentation — **source of truth** for public TypeScript types |
36| `docs/src/api/` | Per-class API reference (`class-page.md`, `class-locator.md`, etc.) |
37| `utils/` | Build scripts, code generation, linting, doc tools |
38| `browser_patches/` | Browser engine patches |
39
40## Build
41
42```bash
43npm run build # Full build
44npm run watch # Watch mode (recommended during development)
45```
46
47Assume watch is running and code is up to date. Generated files (types, channels, validators) are produced by watch automatically.
48
49## Lint and type check
50
51```bash
52npm run flint
53```
54
55Runs all lint checks in parallel: eslint, tsc, doclint, check-deps, generate_channels, generate_types, lint-tests, test-types, lint-packages, code-snippet linting.
56
57**Always run `flint` before committing.** Do not use `tsc --noEmit` or individual lint commands separately.
58
59## Test Commands
60
61| Command | Scope |
62|---------|-------|
63| `npm run ctest <filter>` | Chromium only library tests — **use during development** |
64| `npm run test <filter> -- --project=<chromium,firefix,webkit>` | All library / per project |
65| `npm run ttest <filter>` | Test runner (`tests/playwright-test/`) |
66| `npm run ctest-mcp <filter>` | Chromium only MCP tools (`tests/mcp/`) |
67| `npm run test-mcp <filter> -- --project=<chromium,firefox,webkit>` | MCP tools (`tests/mcp/`) |
68
69
70### Filtering
71
72```bash
73npm run ctest tests/page/locator-click.spec.ts # Specific file
74npm run ctest tests/page/locator-click.spec.ts:12 # Specific location
75npm run ctest -- --grep "should click" # By test name
76npm run ctest-mcp snapshot # By file name part
77```
78
79### Test Directories and Fixtures
80
81| Directory | Import | Key Fixtures | What to Test |
82|-----------|--------|--------------|--------------|
83| `tests/page/` | `import { test, expect } from './pageTest'` | `page`, `server`, `browserName` | User interactions: click, fill, navigate, locators, assertions |
84| `tests/library/` | `import { browserTest, expect } from '../config/browserTest'` | `browser`, `context`, `browserType` | Browser/context lifecycle, cookies, permissions, browser-specific features |
85| `tests/playwright-test/` | `import { test, expect } from './playwright-test-fixtures'` | test runner fixtures | Test runner: reporters, config, annotations, retries |
86| `tests/mcp/` | `import { test, expect } from './fixtures'` | `client`, `server` | MCP tools via `client.callTool()` |
87
88**Decision rule**: Does the test need `browser`/`browserType`/`context` → `tests/library/`. Just needs `page` + `server` → `tests/page/`.
89
90## DEPS System
91
92Import boundaries are enforced via `DEPS.list` files (52+ across the repo), checked by `npm run flint`.
93
94**Key rule**: Client code NEVER imports server code. Server code NEVER imports client code. Communication is only through the protocol.
95When creating or moving files, update the relevant `DEPS.list` to declare allowed imports. Files marked `"strict"` can only import what is explicitly listed.
96
97## Coding Convention
98
99For exported classes:
100- `private _method()` — only used within the class itself
101- `_method()` (no `private`) — used by other code in the same file, but not outside the file
102- `method()` (public) — used in other files
103
104Non-exported classes have no naming convention; they are internal implementation details.
105
106## Commit Convention
107
108Before committing, run `npm run flint` and fix errors.
109
110Semantic commit messages: `label(scope): description`
111
112Labels: `fix`, `feat`, `chore`, `docs`, `test`, `devops`
113
114```bash
115git checkout -b fix-39562
116# ... make changes ...
117git add <changed-files>
118git commit -m "$(cat <<'EOF'
119fix(proxy): handle SOCKS proxy authentication
120
121Fixes: https://github.com/microsoft/playwright/issues/39562
122EOF
123)"
124# **Never `git push` without an explicit instruction to push.**
125git push origin fix-39562
126gh pr create --repo microsoft/playwright --head username:fix-39562 \
127 --title "fix(proxy): handle SOCKS proxy authentication" \
128 --body "$(cat <<'EOF'
129## Summary
130- <describe the change very! briefly>
131
132Fixes https://github.com/microsoft/playwright/issues/39562
133EOF
134)"
135```
136
137Never add Co-Authored-By agents in commit message.
138Never add "Generated with" in commit message.
139Never add test plan to PR description. Keep PR description short — a few bullet points at most.
140Branch naming for issue fixes: `fix-<issue-number>`
141
142**Never amend commits.** Always create a new commit for follow-up changes, even when iterating on an open PR. Amending rewrites history and forces a force-push, losing the incremental review trail. Only amend if the user explicitly says so.
143
144**Never `git push` without an explicit instruction to push.** Applies even when a PR is already open for the branch — additional commits are immediately visible to reviewers. Commit locally, report what was committed, and wait. Only push when the user's message contains "push", "upload", "create PR", "ship it", or equivalent.
145
146## Development Guides
147
148Detailed guides for common development tasks:
149
150- **[Architecture: Client, Server, and Dispatchers](.claude/skills/playwright-dev/library.md)** — package layout, protocol layer, ChannelOwner/SdkObject/Dispatcher base classes, DEPS rules, end-to-end RPC flow, object lifecycle
151- **[Adding and Modifying APIs](.claude/skills/playwright-dev/api.md)** — 6-step process: define docs → implement client → define protocol → implement dispatcher → implement server → write tests
152- **[MCP Tools and CLI Commands](.claude/skills/playwright-dev/tools.md)** — `defineTool()`/`defineTabTool()`, tool capabilities, CLI `declareCommand()`, config options, testing with MCP fixtures
153- **[Vendoring Dependencies](.claude/skills/playwright-dev/vendor.md)** — bundle architecture, esbuild setup, typed wrappers, adding deps to existing bundles
154
microsoft/playwright · .github/copilot-instructions.md
@@ +1 @@
1## PR Review Guidelines
2
3When reviewing pull requests:
4
5- Only comment on semantically meaningful issues: bugs, incorrect logic, security problems, or API contract violations.
6- Skip style, formatting, naming, and whitespace observations unless they cause functional problems.
7- Keep each comment short — one or two sentences maximum.
8- Do not write long descriptions or summaries of what the code does.
9- Do not suggest refactors or improvements unrelated to the PR's stated goal.
10- NEVER produce a review body or top-level PR overview comment. The review body MUST be empty. Put findings only in inline comments on specific lines.
11
@@ −1 +1 @@
1−### Monorepo Packages
1+## PR Review Guidelines
22
3−| Package | npm name | Purpose |
4−|---------|----------|---------|
5−| `playwright-core` | `playwright-core` | Browser automation engine: client, server, dispatchers, protocol |
6−| `playwright` | `playwright` | Test runner + browser automation (public package) |
7−| `playwright-test` | `@playwright/test` | Test runner entry point |
8−| `playwright-client` | `@playwright/client` | Standalone client package |
9−| `protocol` | *(internal)* | RPC protocol definitions (`protocol.yml` → generated `channels.d.ts`) |
3+When reviewing pull requests:
104
11−### Browser Packages
12−
13−`playwright-chromium`, `playwright-firefox`, `playwright-webkit` — per-browser distributions.
14−`playwright-browser-chromium`, `playwright-browser-firefox`, `playwright-browser-webkit` — binary packages.
15−
16−### Tooling Packages
17−
18−| Package | Purpose |
19−|---------|---------|
20−| `html-reporter` | HTML test report viewer |
21−| `trace-viewer` | Trace viewer UI |
22−| `recorder` | Test recorder |
23−| `web` | Shared web UI components |
24−| `injected` | Scripts injected into browser pages |
25−
26−### Component Testing
27−
28−`playwright-ct-core`, `playwright-ct-react`, `playwright-ct-vue`
29−
30−### Key Directories
31−
32−| Directory | Purpose |
33−|-----------|---------|
34−| `tests/` | All test suites (page, library, playwright-test, mcp, components, etc.) |
35−| `docs/src/` | API documentation — **source of truth** for public TypeScript types |
36−| `docs/src/api/` | Per-class API reference (`class-page.md`, `class-locator.md`, etc.) |
37−| `utils/` | Build scripts, code generation, linting, doc tools |
38−| `browser_patches/` | Browser engine patches |
39−
40−## Build
41−
42−```bash
43−npm run build # Full build
44−npm run watch # Watch mode (recommended during development)
45−```
46−
47−Assume watch is running and code is up to date. Generated files (types, channels, validators) are produced by watch automatically.
48−
49−## Lint and type check
50−
51−```bash
52−npm run flint
53−```
54−
55−Runs all lint checks in parallel: eslint, tsc, doclint, check-deps, generate_channels, generate_types, lint-tests, test-types, lint-packages, code-snippet linting.
56−
57−**Always run `flint` before committing.** Do not use `tsc --noEmit` or individual lint commands separately.
58−
59−## Test Commands
60−
61−| Command | Scope |
62−|---------|-------|
63−| `npm run ctest <filter>` | Chromium only library tests — **use during development** |
64−| `npm run test <filter> -- --project=<chromium,firefix,webkit>` | All library / per project |
65−| `npm run ttest <filter>` | Test runner (`tests/playwright-test/`) |
66−| `npm run ctest-mcp <filter>` | Chromium only MCP tools (`tests/mcp/`) |
67−| `npm run test-mcp <filter> -- --project=<chromium,firefox,webkit>` | MCP tools (`tests/mcp/`) |
68−
69−
70−### Filtering
71−
72−```bash
73−npm run ctest tests/page/locator-click.spec.ts # Specific file
74−npm run ctest tests/page/locator-click.spec.ts:12 # Specific location
75−npm run ctest -- --grep "should click" # By test name
76−npm run ctest-mcp snapshot # By file name part
77−```
78−
79−### Test Directories and Fixtures
80−
81−| Directory | Import | Key Fixtures | What to Test |
82−|-----------|--------|--------------|--------------|
83−| `tests/page/` | `import { test, expect } from './pageTest'` | `page`, `server`, `browserName` | User interactions: click, fill, navigate, locators, assertions |
84−| `tests/library/` | `import { browserTest, expect } from '../config/browserTest'` | `browser`, `context`, `browserType` | Browser/context lifecycle, cookies, permissions, browser-specific features |
85−| `tests/playwright-test/` | `import { test, expect } from './playwright-test-fixtures'` | test runner fixtures | Test runner: reporters, config, annotations, retries |
86−| `tests/mcp/` | `import { test, expect } from './fixtures'` | `client`, `server` | MCP tools via `client.callTool()` |
87−
88−**Decision rule**: Does the test need `browser`/`browserType`/`context` → `tests/library/`. Just needs `page` + `server` → `tests/page/`.
89−
90−## DEPS System
91−
92−Import boundaries are enforced via `DEPS.list` files (52+ across the repo), checked by `npm run flint`.
93−
94−**Key rule**: Client code NEVER imports server code. Server code NEVER imports client code. Communication is only through the protocol.
95−When creating or moving files, update the relevant `DEPS.list` to declare allowed imports. Files marked `"strict"` can only import what is explicitly listed.
96−
97−## Coding Convention
98−
99−For exported classes:
100−- `private _method()` — only used within the class itself
101−- `_method()` (no `private`) — used by other code in the same file, but not outside the file
102−- `method()` (public) — used in other files
103−
104−Non-exported classes have no naming convention; they are internal implementation details.
105−
106−## Commit Convention
107−
108−Before committing, run `npm run flint` and fix errors.
109−
110−Semantic commit messages: `label(scope): description`
111−
112−Labels: `fix`, `feat`, `chore`, `docs`, `test`, `devops`
113−
114−```bash
115−git checkout -b fix-39562
116−# ... make changes ...
117−git add <changed-files>
118−git commit -m "$(cat <<'EOF'
119−fix(proxy): handle SOCKS proxy authentication
120−
121−Fixes: https://github.com/microsoft/playwright/issues/39562
122−EOF
123−)"
124−# **Never `git push` without an explicit instruction to push.**
125−git push origin fix-39562
126−gh pr create --repo microsoft/playwright --head username:fix-39562 \
127− --title "fix(proxy): handle SOCKS proxy authentication" \
128− --body "$(cat <<'EOF'
129−## Summary
130−- <describe the change very! briefly>
131−
132−Fixes https://github.com/microsoft/playwright/issues/39562
133−EOF
134−)"
135−```
136−
137−Never add Co-Authored-By agents in commit message.
138−Never add "Generated with" in commit message.
139−Never add test plan to PR description. Keep PR description short — a few bullet points at most.
140−Branch naming for issue fixes: `fix-<issue-number>`
141−
142−**Never amend commits.** Always create a new commit for follow-up changes, even when iterating on an open PR. Amending rewrites history and forces a force-push, losing the incremental review trail. Only amend if the user explicitly says so.
143−
144−**Never `git push` without an explicit instruction to push.** Applies even when a PR is already open for the branch — additional commits are immediately visible to reviewers. Commit locally, report what was committed, and wait. Only push when the user's message contains "push", "upload", "create PR", "ship it", or equivalent.
145−
146−## Development Guides
147−
148−Detailed guides for common development tasks:
149−
150−- **[Architecture: Client, Server, and Dispatchers](.claude/skills/playwright-dev/library.md)** — package layout, protocol layer, ChannelOwner/SdkObject/Dispatcher base classes, DEPS rules, end-to-end RPC flow, object lifecycle
151−- **[Adding and Modifying APIs](.claude/skills/playwright-dev/api.md)** — 6-step process: define docs → implement client → define protocol → implement dispatcher → implement server → write tests
152−- **[MCP Tools and CLI Commands](.claude/skills/playwright-dev/tools.md)** — `defineTool()`/`defineTabTool()`, tool capabilities, CLI `declareCommand()`, config options, testing with MCP fixtures
153−- **[Vendoring Dependencies](.claude/skills/playwright-dev/vendor.md)** — bundle architecture, esbuild setup, typed wrappers, adding deps to existing bundles
5+- Only comment on semantically meaningful issues: bugs, incorrect logic, security problems, or API contract violations.
6+- Skip style, formatting, naming, and whitespace observations unless they cause functional problems.
7+- Keep each comment short — one or two sentences maximum.
8+- Do not write long descriptions or summaries of what the code does.
9+- Do not suggest refactors or improvements unrelated to the PR's stated goal.
10+- NEVER produce a review body or top-level PR overview comment. The review body MUST be empty. Put findings only in inline comments on specific lines.
15411
