Skip to main content

AI 驱动的自动化测试助手 MCP Server - 生成AC、测试用例、UI/API自动化代码

Project description

AI 测试助手 MCP Server

让 VS Code Copilot / Cursor / Cherry Studio 等编辑器具备 AI 测试生成能力。

✨ 功能(5个技能)

工具名 功能 输出格式
generate_ac 生成验收标准 BDD Given-When-Then
generate_test_cases 生成测试用例 Markdown表格 (P0/P1/P2优先级)
generate_ui_automation 生成UI自动化代码 Python + Selenium + POM
generate_api_automation 生成接口自动化代码 Python + requests + pytest
generate_all 一键生成全部 完整测试资产报告

🚀 安装步骤

1. 安装依赖

pip install "mcp[cli]" openai httpx

2. 获取 API Key(任选一个)

提供商 获取地址 环境变量名
智谱 GLM (推荐) https://open.bigmodel.cn ZHIPU_API_KEY
通义千问 https://dashscope.console.aliyun.com QWEN_API_KEY
DeepSeek https://platform.deepseek.com DEEPSEEK_API_KEY
Kimi https://platform.moonshot.cn KIMI_API_KEY

3. 配置 VS Code

在你的项目根目录创建 .vscode/mcp.json

{
    "servers": {
        "ai-test-assistant": {
            "type": "stdio",
            "command": "python",
            "args": ["你的路径/mcp_server/server.py"],
            "env": {
                "ZHIPU_API_KEY": "你的API Key"
            }
        }
    }
}

4. 启用 MCP

  1. 打开 VS Code 设置,搜索 mcp
  2. 勾选 GitHub > Copilot > Chat: MCP Enabled
  3. 重新加载 VS Code(Ctrl+Shift+P → Reload Window)
  4. 打开 Copilot Chat,点击工具图标 🔧
  5. 勾选 ai-test-assistant

💬 使用示例

在 Copilot Chat 中直接对话:

用户: 作为买家,我希望能够使用优惠券下单,帮我生成AC

用户: 用户登录功能,帮我生成测试用例

用户: 购物车功能,帮我一键生成所有测试资产

🔧 其他编辑器

Cursor

.cursor/mcp.json 中配置(格式同上)

Cherry Studio

在设置 → MCP 服务器中添加:

  • 名称: ai-test-assistant
  • 命令: python
  • 参数: 你的路径/mcp_server/server.py

📝 License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai_test_assistant_mcp-1.0.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai_test_assistant_mcp-1.0.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file ai_test_assistant_mcp-1.0.0.tar.gz.

File metadata

  • Download URL: ai_test_assistant_mcp-1.0.0.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for ai_test_assistant_mcp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 de9f209103b49c0843e8d9cc9edf05f26f2c1a3658090290aa715120f32ac37f
MD5 e6f3d611f8b5bd1b65f198249f6d6eff
BLAKE2b-256 b9e0fa342099c7cc0406f1ac739fd599286c1811fce8e36fce2e044bb4598654

See more details on using hashes here.

File details

Details for the file ai_test_assistant_mcp-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_test_assistant_mcp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 821c10120513f49a6c65c4c3d88b7a543a1236141d79db2365ba1fa2049aca46
MD5 4a537ce94bfd24e93559de8f49f0ca64
BLAKE2b-256 86e84f82a9b54887de1be159de8c99998ded77850e5350899fd93503d2e77f7a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page