技能 playwright-skill
🎭

playwright-skill

低風險 ⚙️ 外部命令🌐 網路存取📁 檔案系統存取🔑 環境變數⚡ 包含腳本

Automate browser tasks with Playwright

也可從以下取得: lackeyjb

This skill enables Claude Code to automate browser interactions using Playwright, handling dev server detection, test script execution, and comprehensive web testing capabilities.

支援: Claude Codex Code(CC)
📊 71 充足
1

下載技能 ZIP

2

在 Claude 中上傳

前往 設定 → 功能 → 技能 → 上傳技能

3

開啟並開始使用

測試它

正在使用「playwright-skill」。 Test my local app at localhost:3000

預期結果:

Auto-detected dev server on port 3000. Launching browser to test...

Page title: My Web App
Viewport: 1280x720
✓ Page loaded successfully
✓ No console errors detected
✓ Screenshot saved to /tmp/screenshot-2024-01-15.png

正在使用「playwright-skill」。 Check responsive design

預期結果:

Testing across viewports:
- Mobile (375x667): ✓ No layout issues
- Tablet (768x1024): ✓ No layout issues
- Desktop (1280x720): ✓ No layout issues

All viewport tests passed. Screenshots saved to /tmp/

安全審計

低風險
v1 • 2/24/2026

This is a legitimate browser automation skill using the Playwright library. The static analyzer flagged many patterns but most are false positives: shell commands in documentation are usage examples, not dangerous execution; network access is required for browser automation; filesystem access is for writing test scripts to /tmp; environment variables are for configuration. No malicious intent detected.

5
已掃描檔案
1,811
分析行數
8
發現項
1
審計總數
中風險問題 (1)
Shell Command Execution in Documentation
Documentation files contain shell command examples using backticks. These are usage examples for users, not dangerous code execution within the skill itself.
低風險問題 (2)
Environment Variable Configuration
Skill reads configuration from environment variables (PW_HEADER_NAME, HEADLESS, etc.). This is legitimate configuration, not credential access.
Dynamic Script Loading
Skill uses require() to load Playwright and user test scripts. This is the expected mechanism for a scripting skill.

風險因素

⚙️ 外部命令 (1)
🌐 網路存取 (1)
📁 檔案系統存取 (1)
🔑 環境變數 (1)
⚡ 包含腳本 (1)
審計者: claude

品質評分

38
架構
100
可維護性
87
內容
50
社群
81
安全
91
規範符合性

你能建構什麼

Web Developer Testing

Test web applications locally by auto-detecting dev servers and running automated browser tests across multiple viewport sizes.

QA Automation

Create end-to-end tests for web applications, validate login flows, and check responsive design across different devices.

Web Scraping

Extract content from websites that require JavaScript rendering, including screenshots and structured data extraction.

試試這些提示

Test Local Web App
Test my local web application. First detect any running dev servers, then verify the main page loads correctly and check for console errors.
Responsive Design Check
Check if my web application looks good on mobile, tablet, and desktop viewports. Take screenshots at each size and report any layout issues.
Login Flow Test
Test the login flow on [URL]. Fill in the credentials, click login, and verify successful authentication by checking for dashboard or user menu.
Form Submission Test
Fill out and submit the contact form on [URL] with test data. Verify the form submits successfully and check for any validation errors.

最佳實務

  • Always use parameterized URLs via constants or environment variables for maintainability
  • Write test scripts to /tmp to keep project directories clean
  • Use visible browser mode (headless: false) for debugging, switch to headless for CI
  • Handle async operations properly with waitForSelector and waitForNavigation

避免

  • Do not hardcode credentials in test scripts - use environment variables instead
  • Avoid testing against production websites without authorization
  • Do not rely solely on sleep/timers - use proper wait conditions for reliable tests
  • Avoid writing test files to the skill directory - always use /tmp

常見問題

How do I set up Playwright?
Run 'npm run setup' in the skill directory, or the skill will prompt you to install on first use.
Can I test external websites?
Yes, but some sites may block automated browsers. Always respect robots.txt and website terms of service.
How do I pass custom headers?
Set PW_HEADER_NAME and PW_HEADER_VALUE environment variables, or PW_EXTRA_HEADERS for multiple headers in JSON format.
Can I run in headless mode?
Set HEADLESS=false environment variable for visible browser mode. Default is headless for CI environments.
Where do test scripts get saved?
Test scripts are written to /tmp/playwright-test-*.js to avoid cluttering your project directory.
Does this work with Firefox and WebKit?
Yes, the skill supports chromium, firefox, and webkit browsers. Install additional browsers with 'npx playwright install firefox'.

開發者詳情

檔案結構