playwright
Skill1 starsChanged 7 months agoMITView on GitHub
ブラウザ自動操作・E2EテストにPlaywright MCPプラグインを使用。ページナビゲーション、スナップショット取得、要素クリック、フォーム入力、スクリーンショット撮影など。CLIではなくプラグイン経由で操作。
94 other projects use a version of this.
Adopted by
Most recently taken up by
- Pamir-AI/skillstheir own version, first seen Nov 8, 2026
- shetengteng/skillix-hubtheir own version, first seen Nov 8, 2026
- LuisSambrano/antigravity-configtheir own version, first seen Nov 8, 2026
- fmind/dottheir own version, first seen Nov 8, 2026
- fmind/dotfilestheir own version, first seen Nov 8, 2026
- miminashi/pvesetheir own version, first seen Nov 4, 2026
Used with
Projects with it also use develop-web-game, msw and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
hebertzhuSkilldevelop-web-game
Use when building or iterating on a web game and you need a tight implement-test-observe loop; prefer the bundled Playwright client, inspect screenshots and text state, and validate every meaningful change before moving on.
Also in 4 projects that use this
thongdn-itSkillmsw
MSW (Mock Service Worker) best practices for API mocking in tests (formerly test-msw). This skill should be used when setting up MSW, writing request handlers, or mocking HTTP APIs. This skill does NOT cover general testing patterns (use test-vitest or test-tdd skills) or test methodology.
Also in 3 projects that use this
SupabaseSkillreact-hook-form
Correct React Hook Form usage anywhere in the monorepo — data flow, subscriptions,
Also in 3 projects that use this
thongdn-itSkilltailwind
Tailwind CSS v4 performance optimization and best practices guidelines (formerly tailwindcss-v4-style). This skill should be used when writing, reviewing, or refactoring Tailwind CSS v4 code to ensure optimal build performance, minimal CSS output, and correct usage of v4 features. Triggers on tasks involving Tailwind configuration, @theme directive, utility classes, responsive design, dark mode, container queries, or CSS generation optimization.
Also in 5 projects that use this
VercelSkillreact
React renderer for json-render that turns JSON specs into React components. Use when working with @json-render/react, building React UIs from JSON, creating component catalogs, or rendering AI-generated specs.
Also in 6 projects that use this
OpenAISkillweb-perf
Analyzes web performance using Chrome DevTools MCP. Measures Core Web Vitals (FCP, LCP, TBT, CLS, Speed Index), identifies render-blocking resources, network dependency chains, layout shifts, caching issues, and accessibility gaps. Use when asked to audit, profile, debug, or optimize page load performance, Lighthouse scores, or site speed. Biases towards retrieval from current documentation over pre-trained knowledge.
Also in 5 projects that use this
- +1 more from thongdn-it
Other versions94 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 94
- openai/openai-agents-python★ 31ksame name
- openai/skills★ 27ksame name
- prowler-cloud/prowler★ 15ksame name
- hyperdxio/hyperdx★ 10ksame name
- bluesky-social/atproto★ 9.7ksame name
- netease-youdao/LobsterAI★ 6.2ksame name
- Kiln-AI/Kiln★ 5.3ksame name
- freestylefly/wesight★ 969same name
- Gram-ax/gramax★ 609same name
- JetBrains/skills★ 386same name
84 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository66 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- agent-teams-codingSkill
- AI External Brain (Knowledge Base)Skill
- awesome-design-md-jpSkill
- awesome-design-mdSkill
- softbank-invoiceSkill
- claude-for-chromeSkill
- codebase-patrolSkill
- codex-autopilotSkill
- codexSkill
- Context7 Documentation LookupSkill
- design-review-checklistSkill
- detail-design-docSkill
- discord-promotionSkill
- drawioSkill
- e2e-testSkill
- fish-audio-apiSkill
- fish-audio-docsSkill
- fish-audioSkill
- fortress-implementSkill
- fortress-reviewSkill
- freee Developer APISkill
- frontend-skillSkill
- gBizINFO APISkill
- github-cliSkill
- git-worktree-parallelSkill
- google-sheets-apiSkill
- google-sheets-mcpSkill
- graphify-windowsSkill
- issue-autopilot-batchSkill
- issue-flowSkill
- issue-plannerSkill
- Jグランツ APISkill
- Knip - Dead Code DetectionSkill
- liftkitSkill
- llm-vulnerability-testSkill
- MarkItDownSkill
- mba-strategy-consultantSkill
- Obsidian CLI OperationsSkill
- openrouterSkill
- PAY.JP CLI OperationsSkill
- playwright-cliSkill
- qwen-coderSkill
- ryokan-forecastSkill
- security-adversarialSkill
- security-settingsSkill
- skill-improveSkill
- stoic-daily-practiceSkill
- Stripe CLI OperationsSkill
- Stripe PayPay決済Skill
- Supabase CLI OperationsSkill
- tile-terminalsSkill
- timesfmSkill
- ui-ux-pro-maxSkill
- usacon-account-mgmtSkill
- usacon-cliSkill
- usacon-discordSkill
- usacon-partner-registrationSkill
- usaconSkill
- ux-psychologySkill
- The first 60 shown.
The file
Files
Playwright MCPプラグイン ガイド
概要
ブラウザ自動操作・E2EテストにはPlaywright MCPプラグインを使用。
CLIではなく、mcp__plugin_playwright_playwright__* 関数で操作する。
基本操作
ページナビゲーション
mcp__plugin_playwright_playwright__browser_navigate
url: https://example.comページスナップショット(推奨)
スクリーンショットより軽量。要素の ref 属性を取得できる。
mcp__plugin_playwright_playwright__browser_snapshotスクリーンショット撮影
mcp__plugin_playwright_playwright__browser_take_screenshot
filename: "screenshot.png"
# フルページ
mcp__plugin_playwright_playwright__browser_take_screenshot
filename: "full-page.png"
fullPage: true
# 特定要素のみ
mcp__plugin_playwright_playwright__browser_take_screenshot
element: "ログインフォーム"
ref: "e123"
filename: "login-form.png"要素操作
クリック
ref はスナップショットから取得した要素参照。
mcp__plugin_playwright_playwright__browser_click
element: "ログインボタン"
ref: "e45"
# 右クリック
mcp__plugin_playwright_playwright__browser_click
element: "コンテキストメニュー対象"
ref: "e67"
button: "right"
# ダブルクリック
mcp__plugin_playwright_playwright__browser_click
element: "編集対象"
ref: "e89"
doubleClick: trueホバー
mcp__plugin_playwright_playwright__browser_hover
element: "ドロップダウンメニュー"
ref: "e12"テキスト入力
mcp__plugin_playwright_playwright__browser_type
element: "メールアドレス入力欄"
ref: "e34"
text: "test@example.com"
# 入力後にEnterキーを押す
mcp__plugin_playwright_playwright__browser_type
element: "検索ボックス"
ref: "e56"
text: "検索キーワード"
submit: trueフォーム一括入力
mcp__plugin_playwright_playwright__browser_fill_form
fields: [
{"name": "メールアドレス", "type": "textbox", "ref": "e10", "value": "test@example.com"},
{"name": "パスワード", "type": "textbox", "ref": "e11", "value": "password123"},
{"name": "利用規約同意", "type": "checkbox", "ref": "e12", "value": "true"}
]ドロップダウン選択
mcp__plugin_playwright_playwright__browser_select_option
element: "都道府県選択"
ref: "e78"
values: ["福井県"]ドラッグ&ドロップ
mcp__plugin_playwright_playwright__browser_drag
startElement: "ドラッグ元"
startRef: "e90"
endElement: "ドロップ先"
endRef: "e91"待機・同期
時間待機
mcp__plugin_playwright_playwright__browser_wait_for
time: 3テキスト出現待ち
mcp__plugin_playwright_playwright__browser_wait_for
text: "ログイン完了"テキスト消失待ち
mcp__plugin_playwright_playwright__browser_wait_for
textGone: "読み込み中..."キーボード操作
キー押下
mcp__plugin_playwright_playwright__browser_press_key
key: "Enter"
# 特殊キー例
# ArrowUp, ArrowDown, ArrowLeft, ArrowRight
# Escape, Tab, Backspace, Delete
# Control+A, Control+C, Control+Vタブ操作
タブ一覧
mcp__plugin_playwright_playwright__browser_tabs
action: "list"新規タブ
mcp__plugin_playwright_playwright__browser_tabs
action: "new"タブ切り替え
mcp__plugin_playwright_playwright__browser_tabs
action: "select"
index: 1タブを閉じる
mcp__plugin_playwright_playwright__browser_tabs
action: "close"
index: 0デバッグ・確認
コンソールメッセージ取得
mcp__plugin_playwright_playwright__browser_console_messages
level: "error" # error, warning, info, debugネットワークリクエスト確認
mcp__plugin_playwright_playwright__browser_network_requests
includeStatic: false # 静的リソースを除外JavaScript実行
mcp__plugin_playwright_playwright__browser_evaluate
function: "() => document.title"
# 要素に対して実行
mcp__plugin_playwright_playwright__browser_evaluate
element: "入力フィールド"
ref: "e45"
function: "(element) => element.value"ダイアログ操作
ダイアログ処理(alert, confirm, prompt)
# 承認
mcp__plugin_playwright_playwright__browser_handle_dialog
accept: true
# 拒否
mcp__plugin_playwright_playwright__browser_handle_dialog
accept: false
# promptに入力
mcp__plugin_playwright_playwright__browser_handle_dialog
accept: true
promptText: "入力テキスト"ファイルアップロード
mcp__plugin_playwright_playwright__browser_file_upload
paths: ["/path/to/file.pdf"]ブラウザ制御
ブラウザを閉じる
mcp__plugin_playwright_playwright__browser_closeウィンドウリサイズ
mcp__plugin_playwright_playwright__browser_resize
width: 1920
height: 1080戻る
mcp__plugin_playwright_playwright__browser_navigate_backブラウザインストール(エラー時)
mcp__plugin_playwright_playwright__browser_installトラブルシューティング: Playwrightバージョン差でブラウザが起動できない
症状
browser_navigate 等で以下のようなエラーが出てブラウザが起動できない。
Failed to initialize browser: browserType.launch: Executable doesn't exist at ...\ms-playwright\chromium-1200\...\chrome.exe
Please run: npx playwright install原因(重要)
Playwright は 「Playwrightのバージョンごとに決まった browser revision」 を要求する。 そのため、以下がズレると ms-playwright 配下に必要な revision の実体が無く 起動に失敗する。
- Claude Code の Playwright プラグイン(
/pluginでインストールしたもの) - プロジェクトの Playwright(
node_modules/playwright/@playwright/test) - グローバルの @playwright/mcp(
npm -gで入っているPlaywright)
※ エラーメッセージに出る chromium-1200 などの数字が「必要な revision」。
切り分け手順(Windows)
- [1] 要求されているrevisionを確認
- エラーメッセージのパス(例:
...\ms-playwright\chromium-1200\...)が最優先。
- エラーメッセージのパス(例:
- [2] ms-playwright に実体があるか確認
- 既定パス:
C:\Users\<User>\AppData\Local\ms-playwright\ chromium-1200/webkit-2227/firefox-1497のようなフォルダが存在するか。
- 既定パス:
- [3] どのPlaywrightが使われているか確認
- プロジェクト側:
node -e "console.log(require('playwright/package.json').version)"node -e "console.log(require('playwright-core/package.json').version)"
- グローバル側(例: @playwright/mcp):
npm root -gで場所を出し、その配下の@playwright/mcp/node_modules/playwright*/package.jsonを確認。
- 注意:
playwrightとplaywright-coreがズレると、CLIが参照するbrowsers.jsonが古くなり、インストールされるrevisionが意図とズレる。
- プロジェクト側:
解決策(推奨順)
- [A] そのPlaywrightに対応した CLI で install する
- プロジェクトのPlaywrightを入れたい場合:
npx playwright install(ただしnpxの解決が怪しい時は下記)node node_modules/playwright/cli.js install chromiumnode node_modules/@playwright/test/cli.js install chromium
- グローバル
@playwright/mcp側を入れたい場合:node "<npm -g root>\@playwright\mcp\node_modules\playwright\cli.js" install chromium
- プロジェクトのPlaywrightを入れたい場合:
- [B] 手動で browser revision を入れる(最終手段)
- Claude Code の Playwright プラグインが特定revision(例:
chromium-1200)を要求し、 かつ通常のplaywright installで入らない/入れられない場合。 - Chromium(win64)の例:
- ダウンロードURL:
https://cdn.playwright.dev/dbazure/download/playwright/builds/chromium/<REVISION>/chromium-win64.zip
- 展開先:
C:\Users\<User>\AppData\Local\ms-playwright\chromium-<REVISION>\
- ダウンロードURL:
- ポイント:
- エラーに出ているパスと同じフォルダ構造になるように解凍する。
chrome.exeの場所まで一致しないと起動できない。
- Claude Code の Playwright プラグインが特定revision(例:
判断基準(どれを入れるべき?)
- Claude Code の MCP操作で落ちているなら、まずは エラーメッセージが要求する revision を ms-playwright に用意する(プラグイン側の要求が最優先)。
- プロジェクトのPlaywrightテストが落ちているなら、プロジェクト側の
playwright installを優先。
再発防止
- Playwrightを更新したら、同じ環境で必ず
playwright installを実行してブラウザ実体を揃える。 - 複数のPlaywrightが共存している場合(Claude Codeプラグイン/グローバル/プロジェクト)、 「どのPlaywrightが要求するrevisionか」→「そのCLIでinstall」 の順で対処する。
既知の制約事項(E2Eテスト時の注意)
| 操作 | 制約 | 代替手段 |
input[type="file"] | MCP経由ではファイル添付操作不可(#1641教訓) | ユーザー手動確認に委任 |
| ファイルダウンロード | Blob URL + <a download> のOS保存はMCP検証不能 | browser_evaluate 内で fetch(apiUrl) → ステータス・Content-Type・サイズ検証。または playwright-cli run-code で waitForEvent('download') |
| ファイルアップロード | browser_file_upload は一部環境で不安定 | playwright-cli upload を使用 |
教訓(#1669): ファイルDL系E2Eで「不可」としてSKIPし続けた結果、Excelエクスポートバグが本番まで検出されなかった。
browser_evaluate+fetch()でAPIレベルのテストを必ず実施すること。
典型的なテストフロー
1. browser_navigate でページにアクセス
↓
2. browser_wait_for で読み込み待ち(または time: 2-3秒)
↓
3. browser_snapshot でページ構造取得(ref値を確認)
↓
4. browser_click / browser_type で操作
↓
5. browser_snapshot で結果確認
↓
6. browser_take_screenshot で証跡保存(必要に応じて)Tips
- snapshot vs screenshot: 操作には
snapshotを使用(ref取得のため)。視覚的証跡にはscreenshot - ref の取得:
snapshotの YAML出力から[ref=e123]形式で確認 - 待機の重要性: SPAでは画面遷移後に
wait_forで要素出現を待つ - エラー時:
browser_installでブラウザを再インストール - Playwright更新後に起動できない:
Executable doesn't exist at ...ms-playwright\\chromium-XXXX...は revision 不一致の典型。まずエラーのchromium-XXXXを ms-playwright に揃える。
関連スキル
e2e-test- E2Eテストの計画・実行・検証プロセス(テスト設計のメタスキル)usacon- Usaconプロジェクト固有のE2Eテスト実務(テストアカウント、URL等)
改訂履歴
| 日付 | 変更内容 |
| 2025-12 (推定) | 初版作成 |
| 2026-02 (推定) | Playwrightバージョン差トラブルシューティング追加 |
| 2026-03-04 | 関連スキル・改訂履歴セクション追加 |
| 2026-04-03 | 既知の制約事項セクション追加(ファイルDL/UL不可、fetch()代替パターン) |
参考
- Playwright公式: https://playwright.dev/
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

