08ea5fbe98
添加用户管理视图、API和状态管理文件
313 lines
8.2 KiB
JSON
313 lines
8.2 KiB
JSON
{
|
|
"version": "1.0",
|
|
"description": "测试数据标准格式",
|
|
"test_suites": [
|
|
{
|
|
"name": "用户管理测试",
|
|
"description": "用户管理模块的测试用例",
|
|
"test_cases": [
|
|
{
|
|
"id": "user_login_001",
|
|
"name": "用户登录",
|
|
"description": "验证用户登录功能",
|
|
"priority": "high",
|
|
"enabled": true,
|
|
"endpoint": "/auth/login",
|
|
"method": "POST",
|
|
"data": {
|
|
"username": "admin",
|
|
"password": "admin123"
|
|
},
|
|
"expected": {
|
|
"status_code": 200,
|
|
"response": {
|
|
"code": 200,
|
|
"data": {
|
|
"token": "${token}",
|
|
"user": {
|
|
"username": "admin"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"validations": [
|
|
{
|
|
"rule_type": "status_code",
|
|
"expected_value": 200
|
|
},
|
|
{
|
|
"rule_type": "json_path",
|
|
"path": "code",
|
|
"expected_value": 200
|
|
},
|
|
{
|
|
"rule_type": "json_path",
|
|
"path": "data.token",
|
|
"expected_value": "${token}"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "user_get_list_001",
|
|
"name": "获取用户列表",
|
|
"description": "验证获取用户列表功能",
|
|
"priority": "high",
|
|
"enabled": true,
|
|
"endpoint": "/user/list",
|
|
"method": "GET",
|
|
"params": {
|
|
"page": 1,
|
|
"pageSize": 10
|
|
},
|
|
"expected": {
|
|
"status_code": 200,
|
|
"response": {
|
|
"code": 200,
|
|
"data": {
|
|
"records": [],
|
|
"total": 0
|
|
}
|
|
}
|
|
},
|
|
"validations": [
|
|
{
|
|
"rule_type": "status_code",
|
|
"expected_value": 200
|
|
},
|
|
{
|
|
"rule_type": "json_path",
|
|
"path": "code",
|
|
"expected_value": 200
|
|
}
|
|
],
|
|
"dependencies": ["user_login_001"]
|
|
},
|
|
{
|
|
"id": "user_create_001",
|
|
"name": "创建用户",
|
|
"description": "验证创建用户功能",
|
|
"priority": "high",
|
|
"enabled": true,
|
|
"endpoint": "/user/create",
|
|
"method": "POST",
|
|
"data": {
|
|
"username": "testuser001",
|
|
"password": "Test@123",
|
|
"email": "testuser001@example.com",
|
|
"phone": "13800138000",
|
|
"nickname": "测试用户001",
|
|
"status": 1,
|
|
"roleIds": []
|
|
},
|
|
"expected": {
|
|
"status_code": 200,
|
|
"response": {
|
|
"code": 200,
|
|
"data": {
|
|
"id": "${user_id}",
|
|
"username": "testuser001"
|
|
}
|
|
}
|
|
},
|
|
"validations": [
|
|
{
|
|
"rule_type": "status_code",
|
|
"expected_value": 200
|
|
},
|
|
{
|
|
"rule_type": "json_path",
|
|
"path": "code",
|
|
"expected_value": 200
|
|
},
|
|
{
|
|
"rule_type": "json_path",
|
|
"path": "data.username",
|
|
"expected_value": "testuser001"
|
|
}
|
|
],
|
|
"dependencies": ["user_login_001"]
|
|
},
|
|
{
|
|
"id": "user_update_001",
|
|
"name": "更新用户",
|
|
"description": "验证更新用户功能",
|
|
"priority": "medium",
|
|
"enabled": true,
|
|
"endpoint": "/user/update",
|
|
"method": "PUT",
|
|
"data": {
|
|
"id": "${user_id}",
|
|
"username": "testuser001",
|
|
"nickname": "测试用户001-更新",
|
|
"status": 1
|
|
},
|
|
"expected": {
|
|
"status_code": 200,
|
|
"response": {
|
|
"code": 200
|
|
}
|
|
},
|
|
"validations": [
|
|
{
|
|
"rule_type": "status_code",
|
|
"expected_value": 200
|
|
},
|
|
{
|
|
"rule_type": "json_path",
|
|
"path": "code",
|
|
"expected_value": 200
|
|
}
|
|
],
|
|
"dependencies": ["user_create_001"]
|
|
},
|
|
{
|
|
"id": "user_delete_001",
|
|
"name": "删除用户",
|
|
"description": "验证删除用户功能",
|
|
"priority": "medium",
|
|
"enabled": true,
|
|
"endpoint": "/user/delete/${user_id}",
|
|
"method": "DELETE",
|
|
"expected": {
|
|
"status_code": 200,
|
|
"response": {
|
|
"code": 200
|
|
}
|
|
},
|
|
"validations": [
|
|
{
|
|
"rule_type": "status_code",
|
|
"expected_value": 200
|
|
},
|
|
{
|
|
"rule_type": "json_path",
|
|
"path": "code",
|
|
"expected_value": 200
|
|
}
|
|
],
|
|
"dependencies": ["user_create_001"]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "角色管理测试",
|
|
"description": "角色管理模块的测试用例",
|
|
"test_cases": [
|
|
{
|
|
"id": "role_get_list_001",
|
|
"name": "获取角色列表",
|
|
"description": "验证获取角色列表功能",
|
|
"priority": "high",
|
|
"enabled": true,
|
|
"endpoint": "/role/list",
|
|
"method": "GET",
|
|
"params": {
|
|
"page": 1,
|
|
"pageSize": 10
|
|
},
|
|
"expected": {
|
|
"status_code": 200,
|
|
"response": {
|
|
"code": 200,
|
|
"data": {
|
|
"records": [],
|
|
"total": 0
|
|
}
|
|
}
|
|
},
|
|
"validations": [
|
|
{
|
|
"rule_type": "status_code",
|
|
"expected_value": 200
|
|
},
|
|
{
|
|
"rule_type": "json_path",
|
|
"path": "code",
|
|
"expected_value": 200
|
|
}
|
|
],
|
|
"dependencies": ["user_login_001"]
|
|
},
|
|
{
|
|
"id": "role_create_001",
|
|
"name": "创建角色",
|
|
"description": "验证创建角色功能",
|
|
"priority": "high",
|
|
"enabled": true,
|
|
"endpoint": "/role/create",
|
|
"method": "POST",
|
|
"data": {
|
|
"roleName": "测试角色001",
|
|
"roleCode": "test_role_001",
|
|
"description": "这是一个测试角色",
|
|
"status": 1,
|
|
"sort": 1
|
|
},
|
|
"expected": {
|
|
"status_code": 200,
|
|
"response": {
|
|
"code": 200,
|
|
"data": {
|
|
"id": "${role_id}",
|
|
"roleName": "测试角色001"
|
|
}
|
|
}
|
|
},
|
|
"validations": [
|
|
{
|
|
"rule_type": "status_code",
|
|
"expected_value": 200
|
|
},
|
|
{
|
|
"rule_type": "json_path",
|
|
"path": "code",
|
|
"expected_value": 200
|
|
},
|
|
{
|
|
"rule_type": "json_path",
|
|
"path": "data.roleName",
|
|
"expected_value": "测试角色001"
|
|
}
|
|
],
|
|
"dependencies": ["user_login_001"]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "菜单管理测试",
|
|
"description": "菜单管理模块的测试用例",
|
|
"test_cases": [
|
|
{
|
|
"id": "menu_get_list_001",
|
|
"name": "获取菜单列表",
|
|
"description": "验证获取菜单列表功能",
|
|
"priority": "high",
|
|
"enabled": true,
|
|
"endpoint": "/menu/list",
|
|
"method": "GET",
|
|
"expected": {
|
|
"status_code": 200,
|
|
"response": {
|
|
"code": 200,
|
|
"data": {
|
|
"list": []
|
|
}
|
|
}
|
|
},
|
|
"validations": [
|
|
{
|
|
"rule_type": "status_code",
|
|
"expected_value": 200
|
|
},
|
|
{
|
|
"rule_type": "json_path",
|
|
"path": "code",
|
|
"expected_value": 200
|
|
}
|
|
],
|
|
"dependencies": ["user_login_001"]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
} |