2026-04-10 21:22:35 +08:00

M5 接口自动化测试框架

快速开始

1. 安装依赖

cd m5-auto-test
pip install -r requirements.txt

2. 配置环境变量(可选)

cp .env.example .env
# 编辑 .env 文件,填写 API_BASE_URL 和认证信息

3. 运行测试

# 运行所有测试
pytest -v

# 生成 HTML 报告
pytest -v --html=reports/report.html

# 使用 Allure可选
pytest -v --alluredir=reports/allure
allure serve reports/allure

4. 查看报告

  • pytest 报告:reports/pytest-report.html
  • 覆盖率报告:reports/coverage/index.html

测试覆盖模块

模块 文件 状态
产品管理 tests/v1/test_products.py ⚠️ 待填充
项目管理 tests/v1/test_projects.py ⚠️ 待填充
文档管理 tests/v1/test_documents.py ⚠️ 待填充
流程管理 tests/v1/test_workflows.py ⚠️ 待填充
报表分析 tests/v1/test_reports.py ⚠️ 待填充

已完成项

  • 项目结构搭建
  • 配置文件
  • 认证/未认证客户端 fixtures
  • 响应验证器
  • 示例测试用例(每个模块 6 个)

待完成项

  • 填充具体接口测试用例100+ API
  • 连接真实 API 环境测试
  • 性能测试(可选)
  • 集成 CI/CD可选

负责人:后端工程师 (backend-dev)
最后更新2026-04-07

Description
PLM plm-test Repository
Readme 90 KiB
Languages
Python 85.8%
Shell 14.2%