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-api/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: playwright-api
description: Explains how to add playwright API methods.
---

# API

## Adding and modifying APIs
- Before performing the implementation, go over the steps to understand and plan the work ahead. It is important to follow the steps in order, as some of them are prerequisites for others.
- Define (or update) API in `docs/api/class-xxx.md`. For the new methods, params and options use the version from package.json (without -next).
- Watch will kick in and re-generate types for the API
- Implement the new API in `packages/playwright/src/client/xxx.ts`
- Define (or update) channel for the API in `packages/protocol/src/protocol.yml` as needed
- Watch will kick in and re-generate types for protocol channels
- Implement dispatcher handler in `packages/playwright/src/server/dispatchers/xxxDispatcher.ts` as needed
- Handler should just route the call into the corresponding method in `packages/playwright-core/src/server/xxx.ts`
- Place new tests in `tests/page/xxx.spec.ts` or create new test file if needed

# Build
- Assume watch is running and everything is up to date.

# Test
- If your tests are only using page, prefer to place them in `tests/page/xxx.spec.ts` and use page fixture. If you need to use browser context, place them in `tests/library/xxx.spec.ts`.
- Run npm test as `npm run ctest <file>`

# Lint
- In the end lint via `npm run flint`.
12 changes: 12 additions & 0 deletions .claude/skills/playwright-mcp-dev/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ description: Explains how to add and debug playwright MCP tools and CLI commands
in `packages/playwright/src/skill/references/`
- Place new tests in `tests/mcp/cli-<category>.spec.ts`

## Adding CLI options or Config options
When you need to add something to config.

- `packages/playwright/src/mcp/program.ts`
- add CLI option and doc
- `packages/playwright/src/mcp/config.d.ts`
- add and document the option
- `packages/playwright/src/mcp/config.ts`
- modify FullConfig if needed
- and CLIOptions if needed
- add it to configFromEnv

## Building
- Assume watch is running at all times, run lint to see type errors

Expand Down
8 changes: 8 additions & 0 deletions package-lock.json

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

24 changes: 24 additions & 0 deletions packages/devtools/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
27 changes: 27 additions & 0 deletions packages/devtools/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--
Copyright (c) Microsoft Corporation.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html>
<html lang="en" translate="no">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Playwright Remote Control</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
6 changes: 6 additions & 0 deletions packages/devtools/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "@playwright/devtools",
"private": true,
"version": "0.0.0",
"type": "module"
}
Loading
Loading