← Back to Skills Marketplace
carpedx

Playwright 网页自动化工具

by carpe · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
110
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install playwright-web-test
Description
使用 Playwright 对本地网页、静态 HTML 或在线页面执行自动化测试、元素发现、控制台日志采集与截图。
README (SKILL.md)

Playwright Web Test

这是一个面向 ClawHub / OpenClaw 的网页自动化技能,适合以下场景:

  • 打开网页并截图
  • 自动发现按钮、链接、输入框等元素
  • 采集浏览器 console 日志
  • 测试本地静态 HTML 文件
  • 在启动本地服务后执行自动化脚本

推荐触发方式

你可以直接对 agent 说:

  • 打开 http://localhost:5173 并截图
  • 分析这个页面上有哪些按钮和输入框:http://localhost:3000
  • 访问 file:///tmp/demo.html,点击按钮后截图
  • 采集 http://localhost:5173 的 console 日志

目录说明

  • agents/main/agent.yaml:技能入口
  • scripts/run_task.py:统一执行入口
  • scripts/with_server.py:先启动服务再执行自动化
  • examples/:示例脚本

使用建议

  1. 动态页面先等待 networkidle
  2. 优先先做元素发现,再编写精确操作
  3. 需要启动本地服务时,优先使用 with_server.py
  4. 截图输出会使用 MEDIA: 规范,便于网关直接展示

注意事项

  • 需要本地 Python 环境可用
  • 首次运行前需安装 Playwright: python3 -m pip install playwright && python3 -m playwright install chromium
  • 如果目标页面依赖本地服务,请确认端口可访问
Usage Guidance
This package is internally consistent for local/remote page automation, but take these precautions before installing or running it: - Install Playwright and Chromium via the recommended commands in a controlled environment (virtualenv or container). - Be careful when navigating untrusted remote pages: Playwright executes page JavaScript and allows network requests, so visiting unknown URLs can expose sensitive data or cause unexpected network activity. - The repository includes scripts/with_server.py which will run arbitrary shell commands (uses shell=True). Only use with_server.py with trusted commands and inputs; avoid passing untrusted strings to --server to prevent shell injection. - Outputs are written to /tmp by default; if those files may contain sensitive screenshots or logs, set OPENCLAW_OUTPUT_DIR to a secure location. - If you need tighter security, run the skill in an isolated environment (container, VM) and review any commands the agent will execute before allowing agent-driven automation.
Capability Assessment
Purpose & Capability
Skill name/description align with code and instructions: it uses Python + Playwright to open URLs and file:// pages, take screenshots, discover elements, and capture console logs. Declared requirement (python3) matches. Included helper scripts (e.g., with_server.py) are coherent with the stated use case (start local services before automation).
Instruction Scope
Runtime instructions and run_task.py stay within the stated scope: they parse a URL or file:// path, open it in Playwright, capture screenshots/logs, and write outputs to an output directory. A notable implementation detail: scripts/with_server.py spawns arbitrary shell commands (subprocess.Popen(..., shell=True)) to start services and waits for ports — this is consistent with starting local dev servers but is a privileged operation if untrusted inputs are forwarded. The agent entrypoint runs scripts/run_task.py only, not with_server.py, so with_server.py is present but not invoked automatically by the agent entrypoint.
Install Mechanism
No automated install spec is included; SKILL.md instructs the user to pip install Playwright and run playwright install chromium. That manual instruction is expected and avoids the skill fetching arbitrary binaries itself.
Credentials
The skill requests no environment variables or credentials. It writes outputs to OPENCLAW_OUTPUT_DIR or /tmp by default. There are no requests for unrelated secrets or system config paths.
Persistence & Privilege
always is false and the skill does not attempt to modify other skills or system-wide agent configuration. It creates output files under /tmp or OPENCLAW_OUTPUT_DIR, which is appropriate for this functionality.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install playwright-web-test
  3. After installation, invoke the skill by name or use /playwright-web-test
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of playwright-web-test, enabling web automation and testing with Playwright. - Automate testing on local, static, or online web pages. - Discover and inspect UI elements like buttons and input fields. - Capture browser console logs and screenshots. - Supports both direct page access and scenarios requiring local server startup. - Provides clear instructions and script directory structure in SKILL.md.
Metadata
Slug playwright-web-test
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Playwright 网页自动化工具?

使用 Playwright 对本地网页、静态 HTML 或在线页面执行自动化测试、元素发现、控制台日志采集与截图。 It is an AI Agent Skill for Claude Code / OpenClaw, with 110 downloads so far.

How do I install Playwright 网页自动化工具?

Run "/install playwright-web-test" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Playwright 网页自动化工具 free?

Yes, Playwright 网页自动化工具 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Playwright 网页自动化工具 support?

Playwright 网页自动化工具 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Playwright 网页自动化工具?

It is built and maintained by carpe (@carpedx); the current version is v1.0.0.

💬 Comments