测试用例管理服务

MCP Testmo是一个用于Testmo测试用例管理的Model Context Protocol (MCP)服务器,支持AI助手管理测试用例、文件夹和项目。

  • by senahoy
  • Python
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 if413019/testmo-mcp

使用说明

MCP测试

模型上下文协议(MCP)服务器 睾丸主义 测试用例管理。使Claude等AI助手能够在Testmo中管理测试用例、文件夹和项目。

特性

  • 项目管理:列出并查看Testmo项目
  • 文件夹管理:创建、更新、删除和组织测试用例文件夹
  • 测试用例CRUD:测试用例的完整创建、读取、更新、删除操作
  • 批量操作:高效地创建或删除多个测试用例
  • 搜索:按查询、文件夹、标签或状态搜索测试用例
  • 字段映射:优先级、类型、平台和其他自定义字段的内置映射
  • 测试运行:查看测试运行和执行历史记录

安装

使用pip

pip install mcp-testmo

使用uvx

uvx mcp-testmo

来源(发展)

git clone https://github.com/if413019/testmo-mcp.git
cd mcp-testmo
pip install -e ".[dev]"

配置

环境变量

创建 .env 文件或设置环境变量:

# Required
TESTMO_URL=https://your-instance.testmo.net
TESTMO_API_KEY=your-api-key-here

从Testmo获取您的API密钥: 设置>API密钥

Claude桌面配置

添加到您的Claude桌面配置(~/Library/Application Support/Claude/claude_desktop_config.json 在macOS上):

{
  "mcpServers": {
    "mcp-testmo": {
      "command": "uvx",
      "args": ["mcp-testmo"],
      "env": {
        "TESTMO_URL": "https://your-instance.testmo.net",
        "TESTMO_API_KEY": "your-api-key"
      }
    }
  }
}

Claude代码配置

添加到您的项目 .mcp.json:

{
  "mcpServers": {
    "mcp-testmo": {
      "command": "uvx",
      "args": ["mcp-testmo", "--env-file", ".env.testmo"]
    }
  }
}

可用工具

项目

工具 说明
testmo_list_projects 列出所有可访问的项目
testmo_get_project 按ID获取项目详细信息

文件夹

工具 说明
testmo_list_folders 列出所有具有层次结构的文件夹
testmo_get_folder 获取文件夹详细信息
testmo_create_folder 创建新文件夹
testmo_update_folder 更新文件夹名称或父文件夹
testmo_delete_folder 删除文件夹(及其案例)
testmo_find_folder_by_name 按名称查找文件夹

测试用例

工具 说明
testmo_list_cases 列出案例(分页)
testmo_get_all_cases 获取文件夹中的所有案例
testmo_get_case 获取完整的案件详细信息
testmo_create_case 创建单个案例
testmo_create_cases 创建多个案例(最多100个)
testmo_batch_create_cases 创建任意数量的案例
testmo_update_case 更新案例
testmo_delete_case 删除案例
testmo_batch_delete_cases 删除多个案例
testmo_search_cases 使用筛选器搜索

测试运行

工具 说明
testmo_list_runs 列出测试运行
testmo_get_run 获取跑步详情

公用事业

工具 说明
testmo_get_field_mappings 获取字段值映射
testmo_get_web_url 为资源生成web URL

字段映射

服务器包括示例字段映射(为您的Testmo实例自定义这些映射):

项目

  • your-project: 2
  • playground: 6

优先级(custom_priority)

  • Critical52(经济损失、安全漏洞、合规违规)
  • High:1(核心流受阻,无解决方法)
  • Medium:2(功能降级,但存在解决方法)
  • Low:3(美容问题或罕见的边缘病例)

类型(custom_type)

  • Functional: 59
  • Acceptance: 64
  • Security: 55
  • Performance: 57
  • Usability: 53
  • Compatibility: 61
  • Other: 58

平台(configurations)

  • Admin Portal: 4
  • IOS & Android: 5
  • Insti Web: 10

国家(state_id)

  • Draft: 1
  • Review: 2
  • Approved: 3
  • Active: 4
  • Deprecated: 5

标签

  • 领域 (必填,请选择一个): assets-crypto, assets-noncrypto, services-usergrowth, services-platform, wealth-hnwi
  • 层级类型 (必填,请选择一个): ui-verification, e2e, negative
  • 范围 (可选): regression, smoke, sanity
  • 风险 (可选): risk-financial, risk-security, risk-compliance

用法示例

列出项目

Use testmo_list_projects to see available projects

创建测试用例

Use testmo_create_case with project_id=6 and case_data containing:
- name: "User can login with valid credentials"
- folder_id: 173750
- custom_priority: 1 (High)
- custom_type: 59 (Functional)
- custom_creator: 51 (AI Generated)
- custom_milestone_id: "release/5.2.0"
- custom_references: "IUG-1169"
- custom_issues_tags_and_configurations_added: 66 (Yes)
- custom_confluence_url: "https://your-instance.atlassian.net/wiki/..."
- custom_feature: "<pre><code class='editor-gherkin'>...</code></pre>"
- configurations: [5] (iOS & Android)
- tags: ["services-usergrowth", "e2e", "regression"]

搜索测试用例

Use testmo_search_cases with project_id=2 and:
- query: "login"
- tags: ["regression"]
- state_id: 4 (Active)

获取字段映射

Use testmo_get_field_mappings to see all available field values

发展

设置

# Clone the repository
git clone https://github.com/if413019/testmo-mcp.git
cd mcp-testmo

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # or .venv\Scripts\activate on Windows

# Install dependencies
pip install -e ".[dev]"

运行测试

pytest

代码质量

ruff check .
mypy src

许可证

MIT许可证-有关详细信息,请参阅许可证文件。

贡献

  1. 克隆该仓库
  2. 创建要素分支
  3. 进行更改
  4. 运行测试和梳理
  5. 提交拉取请求

相关项目