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.
下載技能 ZIP
在 Claude 中上傳
前往 設定 → 功能 → 技能 → 上傳技能
開啟並開始使用
測試它
正在使用「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/
安全審計
低風險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.
中風險問題 (1)
低風險問題 (2)
風險因素
⚙️ 外部命令 (1)
🌐 網路存取 (1)
📁 檔案系統存取 (1)
🔑 環境變數 (1)
⚡ 包含腳本 (1)
品質評分
你能建構什麼
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 my local web application. First detect any running dev servers, then verify the main page loads correctly and check for console errors.
Check if my web application looks good on mobile, tablet, and desktop viewports. Take screenshots at each size and report any layout issues.
Test the login flow on [URL]. Fill in the credentials, click login, and verify successful authentication by checking for dashboard or user menu.
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