Fähigkeiten playwright-skill
🎭

playwright-skill

Niedriges Risiko ⚙️ Externe Befehle🌐 Netzwerkzugriff📁 Dateisystemzugriff🔑 Umgebungsvariablen⚡ Enthält Skripte

使用 Playwright 自动化浏览器任务

Auch verfügbar von: lackeyjb

此技能使 Claude Code 能够使用 Playwright 自动化浏览器交互,处理开发服务器检测、测试脚本执行和全面的 Web 测试功能。

Unterstützt: Claude Codex Code(CC)
⚠️ 67 Schlecht
1

Die Skill-ZIP herunterladen

2

In Claude hochladen

Gehe zu Einstellungen → Fähigkeiten → Skills → Skill hochladen

3

Einschalten und loslegen

Teste es

Verwendung von "playwright-skill". Test my local app at localhost:3000

Erwartetes Ergebnis:

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

Verwendung von "playwright-skill". Check responsive design

Erwartetes Ergebnis:

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/

Sicherheitsaudit

Niedriges Risiko
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
Gescannte Dateien
1,811
Analysierte Zeilen
8
befunde
1
Gesamtzahl Audits
Probleme mit mittlerem Risiko (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.
Probleme mit niedrigem Risiko (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.

Risikofaktoren

⚙️ Externe Befehle (1)
🌐 Netzwerkzugriff (1)
📁 Dateisystemzugriff (1)
🔑 Umgebungsvariablen (1)
⚡ Enthält Skripte (1)
Auditiert von: claude

Qualitätsbewertung

38
Architektur
100
Wartbarkeit
87
Inhalt
24
Community
81
Sicherheit
91
Spezifikationskonformität

Was du bauen kannst

Web 开发人员测试

通过自动检测开发服务器并跨多个视口大小运行自动化浏览器测试,在本地测试 Web 应用程序。

QA 自动化

为 Web 应用程序创建端到端测试,验证登录流程,并检查不同设备上的响应式设计。

网页抓取

从需要 JavaScript 渲染的网站提取内容,包括屏幕截图和结构化数据提取。

Probiere diese Prompts

测试本地 Web 应用
测试我的本地 Web 应用程序。首先检测任何运行中的开发服务器,然后验证主页是否正常加载并检查控制台错误。
响应式设计检查
检查我的 Web 应用程序在移动端、平板电脑和桌面端视口上是否美观。在每个尺寸下截取屏幕截图并报告任何布局问题。
登录流程测试
测试 [URL] 上的登录流程。填写凭据,点击登录,然后通过检查仪表板或用户菜单来验证成功认证。
表单提交测试
在 [URL] 上填写并提交联系表单,使用测试数据。验证表单是否成功提交并检查任何验证错误。

Bewährte Verfahren

  • 始终通过常量或环境变量使用参数化 URL 以保持可维护性
  • 将测试脚本写入 /tmp 以保持项目目录整洁
  • 调试时使用可见浏览器模式(headless: false),CI 时切换到无头模式
  • 正确使用 waitForSelector 和 waitForNavigation 处理异步操作

Vermeiden

  • 不要在测试脚本中硬编码凭据 - 请改用环境变量
  • 未经授权不要针对生产网站进行测试
  • 不要仅依赖 sleep/定时器 - 使用适当的等待条件以获得可靠的测试
  • 避免将测试文件写入技能目录 - 始终使用 /tmp

Häufig gestellte Fragen

如何设置 Playwright?
在技能目录中运行 'npm run setup',或者技能会在首次使用时提示您安装。
我可以测试外部网站吗?
可以,但某些网站可能会阻止自动化浏览器。请始终遵守 robots.txt 和网站服务条款。
如何传递自定义请求头?
设置 PW_HEADER_NAME 和 PW_HEADER_VALUE 环境变量,或使用 JSON 格式的 PW_EXTRA_HEADERS 设置多个请求头。
我可以运行无头模式吗?
设置 HEADLESS=false 环境变量以使用可见浏览器模式。默认情况下为无头模式,适用于 CI 环境。
测试脚本保存在哪里?
测试脚本会写入 /tmp/playwright-test-*.js,以避免弄乱您的项目目录。
这适用于 Firefox 和 WebKit 吗?
可以,此技能支持 chromium、firefox 和 webkit 浏览器。使用 'npx playwright install firefox' 安装其他浏览器。

Entwicklerdetails

Dateistruktur