自主Web UI测试Agent — 告诉Agent测试哪个系统,Agent自主完成探索、用例生成、执行、判定
Project description
AgentForWebUITest
告诉 Agent 测试哪个系统,Agent 自主完成全流程 Web UI 测试
[]
[
]
[
]
⚡ 5 秒安装
pip install agent-for-webui-test && webui-test check
🎯 一句话描述
AI 自主 Web UI 测试 Agent — 从页面探索、用例生成、执行判定到报告输出,全流程无人值守。
🧭 快速了解
| 🔍 自主探索 | 🧪 智能用例 | ⚡ ReAct执行 | 🏗️ TestSuite |
| BFS递归爬取页面 | 5类用例自动生成 | 自愈选择器 | 过滤+依赖编排 |
| API拦截+知识图谱 | P0-P3优先级 | 失败重试 | 8个预置模板 |
🏗️ 架构总览
用户指令 → Strategy → Explorer → Planner → SuiteRunner → 报告
│ │ │
KnowledgeGraph [TestCase] SuiteResult
│ │ │
┌──────┴──────────┴───────────┴──────┐
│ BrowserInterface │
│ AgentBrowser │ PlaywrightBrowser │
│ (Chrome 147) │ (Chromium|FF|WK) │
└─────────────────────────────────────┘
🚀 快速上手
# 1. 安装
pip install agent-for-webui-test
# 2. 自检
webui-test check
# 3. 冒烟测试
webui-test suite https://httpbin.org --preset smoke
# 4. CI 模式
webui-test suite https://example.com --ci --filter "P0+P1"
# Python API
from src.agent import WebUITestAgent
agent = WebUITestAgent()
result = agent.run_with_suite("测试 https://example.com", preset="smoke")
print(f"通过率: {result['suite_summary']['pass_rate']}%")
📊 项目状态
| 迭代 | 内容 | 状态 |
|---|---|---|
| 迭代1 | 自主探索 + 知识图谱 | ✅ |
| 迭代2 | 智能用例生成 (5类) | ✅ |
| 迭代3 | ReAct执行 + 自愈选择器 | ✅ |
| 迭代4 | 智能判定 + 根因分析 | ✅ |
| 迭代5 | TestSuite + CI集成 + 多浏览器 | ✅ |
| 模块 | 文件 | 行数 |
|---|---|---|
| 核心引擎 | 9 | ~4,800 |
| TestSuite | 6 | ~750 |
| 浏览器驱动 | 4 | ~750 |
| 工具 | 5 | ~1,500 |
| 测试 (9用例) | 6 | ~600 |
| 合计 | 29 | ~8,500 |
📚 文档
| 文档 | 说明 |
|---|---|
| 快速上手 | 5分钟从零到使用 |
| 安装指南 | pip + Docker 多路径 |
| 架构文档 | 架构详解 |
| 配置参考 | 完整参数说明 |
| 日志调试 | 日志与调试 |
| 发版清单 | 发布检查 |
🔧 CLI 命令
webui-test check # 环境自检
webui-test test <url> # 完整测试
webui-test explore <url> # 仅探索
webui-test suite <url> # TestSuite 编排
webui-test suite <url> --preset smoke # 冒烟测试
webui-test suite <url> --filter "P0+form" # 过滤执行
webui-test suite <url> --ci # CI模式
webui-test version # 版本信息
🧪 测试
pytest tests/ -v # 9 passed
make test # 等效
版本历史
| 版本 | 日期 | 变更 |
|---|---|---|
| v0.5.0 | 2026-05-07 | TestSuite + CI + 多浏览器 + 文档完善 |
| v0.4.0 | 2026-05-07 | 工程化: pip/CLI/CI/Makefile |
| v0.3.0 | 2026-04-28 | 迭代1-4: 探索/用例/执行/判定 |
| v0.2.0 | 2026-04-26 | 迭代1-2: 探索 + 用例生成 |
| v0.1.0 | 2026-04-26 | 项目初始化 |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
agent_for_webui_test-0.5.2.tar.gz
(102.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_for_webui_test-0.5.2.tar.gz.
File metadata
- Download URL: agent_for_webui_test-0.5.2.tar.gz
- Upload date:
- Size: 102.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96c01a4806eabcd5fc2a3624d7ac56aa3d2f0911411ff03ddca3a6df1c35fdea
|
|
| MD5 |
62325557b33a948143242ba6e3d4e0e7
|
|
| BLAKE2b-256 |
e30b2579f385862611c72e987ba7e2f060b67dfec9370dd3a169d909fe2e4de6
|
File details
Details for the file agent_for_webui_test-0.5.2-py3-none-any.whl.
File metadata
- Download URL: agent_for_webui_test-0.5.2-py3-none-any.whl
- Upload date:
- Size: 97.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a50d7b4a97d21a87ae20780f35dd33da20bd3c87e064d2e8dd0be697c0bfafc
|
|
| MD5 |
1ee9471bc19993c136362381e2a556d5
|
|
| BLAKE2b-256 |
f58038ec84c3057257ed5c2ad035726799790bc57f46e4e1d14c3e627898e2c6
|