← 返回 Skills 市场
millerallen98

Flexible Web Tester

作者 Allen · GitHub ↗ · v1.0.2 · MIT-0
cross-platform ⚠ suspicious
265
总下载
0
收藏
1
当前安装
3
版本数
在 OpenClaw 中安装
/install flexible-web-tester
功能描述
智能 Web UI 测试工作台,支持 MCP 直接驱动和 Python 脚本驱动双模式,三种测试模式,强制人工确认,安全可控。
使用说明 (SKILL.md)

Flexible Web Tester - 智能 Web UI 测试工作台

阶段 0:MCP 环境自检 (Pre-flight Check) [强制逻辑]

当用户启动此技能时,你必须立即执行以下隐式环境检查:

  1. 检查文件读写能力:尝试列出或读取一个已知存在的本地文件,验证 File System MCP 是否可用
  2. 检查终端执行能力:执行 echo "test"python3 --version 验证 CLI MCP 是否可用
  3. 检查浏览器控制能力:尝试调用 Playwright MCP 列出可用浏览器或获取浏览器状态

判定结果处理:

  • 如果所有三项工具均可用:输出简短的"环境就绪"提示,然后进入阶段 1
  • 如果缺失任何一项工具立即停止工作流,向用户输出以下警告(禁止继续执行任何后续步骤):

⚠️ 环境未就绪:我检测到缺少必要的 MCP 工具:

  • 文件系统访问 (File System MCP):用于读写测试用例和报告
  • 终端命令执行 (CLI MCP):用于运行 Python 测试脚本
  • 浏览器控制 (Playwright MCP):用于操作网页

请在 ~/.openclaw/openclaw.jsonmcpServers 节点中配置以上三项服务后重启 OpenClaw。


阶段 1:欢迎与参数收集

环境检查通过后,输出结构化的欢迎面板并收集参数:

🤖 欢迎使用 Flexible Web Tester (灵活 Web 测试工作台)

我已准备好为你执行 Web UI 自动化测试。请按以下格式提供配置信息:


1️⃣ 测试目标: (请输入目标 URL,例如:https://example.com,或具体的需求描述)

2️⃣ 测试模式:

  • [1] 自由探索:无需用例,给定 URL 后自主漫游、点击、寻找潜在崩溃或报错
  • [2] 需求驱动:给我一段功能需求,我将为你生成测试用例,经确认后执行
  • [3] 用例驱动:直接给我现成的测试步骤,我将严格按步骤执行

3️⃣ 执行引擎:

  • [A] MCP 直接驱动:AI 直接调用浏览器 MCP 进行操作(不生成代码文件)
  • [B] Python 脚本驱动:Agent 先编写 .py 脚本,通过终端执行(适合复杂场景和复用)

4️⃣ 登录处理:

  • [L1] 人工介入:执行到登录页面时暂停,等待你手动登录后继续
  • [L2] 自动填写:提供用户名和密码,我自动完成登录流程

示例回复:测试目标:https://example.com,模式2,引擎B,自动填写,用户名[email protected] 密码123456

等待用户完整回复所有 4 个维度参数后再进入阶段 2。


阶段 2:规划与用例/代码落盘

根据用户提供的参数进行推演和生成:

引擎 A(MCP 直接驱动)

  • 生成自然语言测试步骤,每步包含:操作指令、目标元素、预期结果
  • 步骤示例:
    1. 导航至 https://example.com
    2. 等待页面加载完成
    3. 点击 "登录" 按钮(通过无障碍树定位)
    4. 在用户名输入框填写 [email protected]
    5. 在密码输入框填写 123456
    6. 点击 "提交" 按钮
    7. 验证页面跳转至 Dashboard
    

引擎 B(Python 脚本驱动)

  • 生成带有详尽注释的 Python + Playwright 代码
  • 必须包含:
    • 浏览器启动配置(headless 可选)
    • 显式等待和重试逻辑
    • 断言语句
    • 异常捕获和截图保存
    • main() 入口函数

强制落盘 1(必须执行): 调用 File System MCP,将方案保存到本地。

  • 文件命名规范
    • 引擎 A:{YYYYMMDD}_测试用例.md
    • 引擎 B:{YYYYMMDD}_测试脚本.py
  • 文件路径{工作目录}/{文件名}
  • 文件内容要求
    • 引擎 A:包含详细步骤、预期结果、边界条件说明
    • 引擎 B:包含完整可运行的 Python 代码,顶部注释说明用途

阶段 3:强制人工确认 (安全锁) [绝对禁止跳过]

文件保存后,立即强制暂停,输出以下提示:

📝 方案已生成并保存至本地

📁 文件路径:{工作目录}/{YYYYMMDD}_测试用例.md..._测试脚本.py


请问是否确认执行?

  • 回复「确认」开始执行测试
  • 回复「修改」并说明具体修改意见,我将重新生成方案
  • 回复「取消」终止此次测试

(在收到明确"确认"指令前,我绝不会调用浏览器或终端 MCP 触发实际执行)

绝对禁止事项:

  • 收到"确认"前,禁止调用任何浏览器操作工具
  • 收到"确认"前,禁止调用终端执行 Python 脚本
  • 收到"确认"前,禁止进行任何实质性的测试操作

阶段 4:动态执行与自愈

收到用户明确的「确认」后,按以下流程执行:

引擎 A 执行流程

  1. 调用 Playwright MCP 启动浏览器
  2. 按步骤逐一执行自然语言指令
  3. 每步执行后读取页面状态进行验证

引擎 B 执行流程

  1. 调用 CLI MCP 执行已保存的 Python 脚本
  2. 命令示例:cd {工作目录} && python3 {YYYYMMDD}_测试脚本.py
  3. 捕获脚本输出和返回码

自愈逻辑(通用)

当遇到执行报错时,触发以下自愈策略(最多尝试 2 次):

尝试次数 自愈策略
第 1 次 等待 2-3 秒后重试(应对网络延迟/异步加载)
第 2 次 尝试滚动页面使元素进入可视区域,或关闭弹窗/遮罩层
  • 自愈成功:继续执行后续步骤
  • 自愈失败(2 次后):标记当前步骤为 FAIL,记录失败现场(截图/DOM),继续执行剩余步骤

阶段 5:报告导出

测试执行完成后,强制落盘 2(必须执行):

调用 File System MCP 生成并保存测试报告。

  • 文件命名规范{YYYYMMDD}_测试报告.md
  • 文件路径{工作目录}/{YYYYMMDD}_测试报告.md
  • 报告内容结构
# 📊 Web UI 自动化测试执行报告

## 基础信息
- **测试目标 / URL:** [填写]
- **执行模式:** [自由探索 / 需求驱动 / 用例驱动]
- **执行引擎:** [MCP 直接驱动 / Python 脚本驱动]
- **登录处理:** [人工介入 / 自动填写]
- **执行时间:** [YYYY-MM-DD HH:MM:SS]

## 整体状态
- **结果:** 🟢 PASS / 🔴 FAIL

## 执行明细
| 步骤 | 操作 | 预期结果 | 实际结果 | 状态 |
|------|------|----------|----------|------|
| 1 | ... | ... | ... | ✅ |
| 2 | ... | ... | ... | ❌ |

## 异常诊断(如有 FAIL)
- **失败节点:** [步骤编号]
- **失败原因:** [详细描述]
- **AI 自愈过程:** 
  - 尝试 1:... → 结果 ...
  - 尝试 2:... → 结果 ...
- **失败截图/日志:** [如有]

## 修复建议
[针对发现的 Bug,给出可能的前端修复思路]

## 附件
- 测试方案文件:`{YYYYMMDD}_测试用例.md` 或 `{YYYYMMDD}_测试脚本.py`

向用户发送简短通知:

测试执行完成

📁 测试报告已保存至:{工作目录}/{YYYYMMDD}_测试报告.md

整体结果: 🟢 PASS / 🔴 FAIL(如有失败,请查看报告中的异常诊断部分)


触发场景

当用户提及以下内容时,主动应用此 skill:

  • Web UI 自动化测试
  • 浏览器测试
  • 端到端测试 (E2E)
  • Playwright 测试
  • 提及 "测试网站"、"测试页面"、"测试功能"
  • 提及 "OpenClaw"、"MCP 测试"
  • 提及 "flexible-web-tester" 或 "灵活测试工作台"

工具依赖声明

本技能正常工作需要以下 MCP 工具:

工具类型 用途 必选
File System MCP 读写测试用例、脚本、报告文件
CLI / Terminal MCP 执行 Python 测试脚本
Playwright MCP 控制浏览器、执行网页操作
安全使用建议
This skill appears to do what it says (Web UI testing) but has two practical risks you should consider before installing or using it: - Clarify the preflight file-read: ask (or inspect) which exact file/path the agent will read during the environment check. If unspecified, it could probe arbitrary files — decline or sandbox the skill until that is fixed. - Avoid providing real credentials for 'automatic filling'. If you must use auto-fill, be aware the generated Python script and reports are saved to disk and may contain credentials in plain text; inspect and securely delete or encrypt those files after use. Prefer 'manual intervention' login mode if you want to avoid storing secrets. Additional precautions: - Run the skill in a controlled/sandboxed workspace (an empty directory) so the File System MCP only has access to intended paths. - Review any generated {YYYYMMDD}_测试脚本.py before giving the final '确认' to execute it. - If you need to configure MCP servers, make the changes yourself and avoid copying sensitive tokens into global config files. If the author can update SKILL.md to (1) specify exact safe preflight file(s) or use a synthetic/local only probe, and (2) warn clearly about credential persistence or add an option to avoid embedding secrets in saved files, this would reduce the concerns and raise confidence.
功能分析
Type: OpenClaw Skill Name: flexible-web-tester Version: 1.0.2 The skill is a Web UI testing utility that utilizes Playwright, File System, and CLI MCPs to perform automated testing. It features a structured workflow including environment checks, code generation, and a mandatory human confirmation step (Phase 3) before execution. However, it is classified as suspicious because it possesses high-risk capabilities, specifically the generation and execution of arbitrary Python scripts via the CLI (CLI MCP) and broad file system access, which are necessary for its function but represent a significant attack surface for potential prompt injection. No evidence of intentional malice or data exfiltration was found in SKILL.md or README.md.
能力评估
Purpose & Capability
Name/description match the instructions: a Web UI test tool legitimately needs file-system access (read/write test cases and reports), a CLI to run Python scripts, and browser control (Playwright). Asking the agent to check for those MCP capabilities is coherent with the stated purpose.
Instruction Scope
Pre-flight requires the agent to 'list or read a known existing local file' but does not specify which file or restrict the path — this ambiguity could lead to reading arbitrary user files. The skill mandates writing generated test scripts and reports to disk and explicitly instructs saving Python scripts (which may include credentials). It does enforce a manual confirmation step before executing tests, which reduces risk, but the unspecified preflight file reads and automatic disk writes are concerning.
Install Mechanism
No install spec and no code files are provided, so nothing is downloaded or installed by the skill itself. That lowers the risk of arbitrary code being fetched at install time.
Credentials
The skill does not request platform credentials up front, which is good, but it supports an 'automatic filling' login mode that will embed user-supplied usernames/passwords into generated scripts which the skill then writes to disk. Persisting sensitive credentials in plaintext test scripts/reports is disproportionate unless the user is explicitly warned and given safe storage options. The preflight's unspecified file-read could also access unrelated local data.
Persistence & Privilege
always:false and no requests to change other skills or system-wide configs. The skill does instruct the user how to configure MCP entries in ~/.openclaw/openclaw.json, but it doesn't claim to alter other skills or require permanent elevated privileges.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install flexible-web-tester
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /flexible-web-tester 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.2
更新 description 为更简洁的描述
v1.0.1
添加 README.md 介绍文档
v1.0.0
Flexible Web Tester 1.0.0 初始版本上线: - 支持 Web UI 自动化测试的双驱动模式(MCP 直接驱动与 Python 脚本驱动)。 - 启动时自动自检环境,确保文件系统、终端、浏览器 MCP 均可用,缺失任一即停止流程并告知用户。 - 结构化参数收集,支持多种测试目标与登录处理方式。 - 规划测试方案后,强制本地文件落盘,并在获得用户“确认”前绝不执行实际操作。 - 自动执行测试并内置自愈逻辑,失败节点自动重试与异常记录。 - 测试完成后自动生成结构化执行报告并本地保存。
元数据
Slug flexible-web-tester
版本 1.0.2
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 3
常见问题

Flexible Web Tester 是什么?

智能 Web UI 测试工作台,支持 MCP 直接驱动和 Python 脚本驱动双模式,三种测试模式,强制人工确认,安全可控。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 265 次。

如何安装 Flexible Web Tester?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install flexible-web-tester」即可一键安装,无需额外配置。

Flexible Web Tester 是免费的吗?

是的,Flexible Web Tester 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Flexible Web Tester 支持哪些平台?

Flexible Web Tester 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Flexible Web Tester?

由 Allen(@millerallen98)开发并维护,当前版本 v1.0.2。

💬 留言讨论