You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ECMS/IntegrationTestCases

70 lines
2.4 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

集成测试用例集Integration Test Cases
1. 说明
本用例集基于《体系结构设计报告》的集成测试计划细化覆盖鉴权链路与五个业务模块端到端。所有URL、字段与流程严格对应现有代码与前端调用。
2. 前置条件
- 后端服务已启动;
- `VUE_APP_BASE_API` 指向后端;
- 数据库有基础数据或可按需构造;
3. 用例列表
3.1 验证码获取
- 用例IDIT-CAP-001
- 步骤GET `/captchaImage`
- 期望:返回 `code=200` 且 `uuid` 非空,`img` 为Base64Redis含对应键值。
3.2 登录成功
- 用例IDIT-AUTH-001
- 前置:从 IT-CAP-001 获取 `uuid` 与正确验证码`code`
- 步骤POST `/login`Body含 `{username,password,code,uuid}`
- 期望:返回 `code=200` 且包含 `token` 字段(键名为后端常量)。
3.3 登录失败(验证码错误)
- 用例IDIT-AUTH-002
- 步骤POST `/login`,验证码错误
- 期望返回非200消息提示。
3.4 未认证访问受限接口
- 用例IDIT-AUTH-003
- 步骤GET `/employee/list` 不带 `Authorization`
- 期望返回401前端应提示重新登录
3.5 部门信息-分页查询
- 用例IDIT-DEPT-001
- 步骤:使用合法 `Authorization`GET `/dept_info/list` 携带查询参数
- 期望:`code=200`,返回 `TableDataInfo``rows` 长度符合分页大小。
3.6 部门信息-新增/详情/更新/删除
- 用例IDIT-DEPT-002
- 步骤:
1) POST `/dept_info` 新增;
2) GET `/dept_info/{id}` 校验详情;
3) PUT `/dept_info` 更新字段;
4) DELETE `/dept_info/{id}` 删除;
- 期望:各步骤 `code=200`,数据与数量变化正确。
3.7 员工信息-分页与CRUD
- 用例IDIT-EMP-001/002
- 步骤:同 IT-DEPT-001/002
- 特别:更新接口为事务方法,构造异常时应回滚。
3.8 员工评价-分页与CRUD
- 用例IDIT-KPI-001/002
- 步骤:同模板执行。
3.9 招人名额-分页与CRUD
- 用例IDIT-HN-001/002
- 步骤:同模板执行,关注 `num` 与 `endtime` 字段类型与格式。
3.10 薪资标准-分页与CRUD
- 用例IDIT-SAL-001/002
- 步骤:同模板执行,关注 `salary` 与 `salaryrange` 精度。
4. 通过标准
- 所有用例均返回 `code=200`(异常用例除外),数据与流程与预期一致;
- 401/错误码在前端被正确处理与提示。