Files
sam-docs/plans/flow-tests/client-group-api-flow.json

194 lines
4.7 KiB
JSON

{
"name": "Client Group API CRUD Flow Test",
"description": "거래처 그룹(Client Group) API 전체 CRUD 플로우 테스트 - 로그인, 목록조회, 생성, 단건조회, 수정, 토글, 삭제",
"version": "1.0",
"config": {
"baseUrl": "",
"timeout": 30000,
"stopOnFailure": true
},
"variables": {
"user_id": "{{$env.FLOW_TESTER_USER_ID}}",
"user_pwd": "{{$env.FLOW_TESTER_USER_PWD}}",
"test_group_name": "테스트그룹_{{$timestamp}}",
"test_group_code": "TG-{{$timestamp}}"
},
"steps": [
{
"id": "login",
"name": "1. 로그인",
"method": "POST",
"endpoint": "/login",
"body": {
"user_id": "{{user_id}}",
"user_pwd": "{{user_pwd}}"
},
"expect": {
"status": [200],
"jsonPath": {
"$.access_token": "@isString"
}
},
"extract": {
"token": "$.access_token"
}
},
{
"id": "list_groups",
"name": "2. 거래처 그룹 목록 조회",
"method": "GET",
"endpoint": "/client-groups",
"headers": {
"Authorization": "Bearer {{login.token}}"
},
"expect": {
"status": [200],
"jsonPath": {
"$.success": true
}
}
},
{
"id": "create_group",
"name": "3. 거래처 그룹 생성",
"method": "POST",
"endpoint": "/client-groups",
"headers": {
"Authorization": "Bearer {{login.token}}"
},
"body": {
"group_code": "{{test_group_code}}",
"group_name": "{{test_group_name}}",
"price_rate": 1.0,
"is_active": true
},
"expect": {
"status": [200, 201],
"jsonPath": {
"$.success": true,
"$.data.id": "@isNumber"
}
},
"extract": {
"group_id": "$.data.id",
"group_name": "$.data.group_name"
}
},
{
"id": "show_group",
"name": "4. 거래처 그룹 단건 조회",
"method": "GET",
"endpoint": "/client-groups/{{create_group.group_id}}",
"headers": {
"Authorization": "Bearer {{login.token}}"
},
"expect": {
"status": [200],
"jsonPath": {
"$.success": true,
"$.data.id": "{{create_group.group_id}}",
"$.data.group_name": "{{test_group_name}}"
}
}
},
{
"id": "update_group",
"name": "5. 거래처 그룹 수정",
"method": "PUT",
"endpoint": "/client-groups/{{create_group.group_id}}",
"headers": {
"Authorization": "Bearer {{login.token}}"
},
"body": {
"group_code": "{{test_group_code}}",
"group_name": "{{test_group_name}}_수정됨",
"price_rate": 1.5
},
"expect": {
"status": [200],
"jsonPath": {
"$.success": true
}
}
},
{
"id": "verify_update",
"name": "6. 수정 확인 조회",
"method": "GET",
"endpoint": "/client-groups/{{create_group.group_id}}",
"headers": {
"Authorization": "Bearer {{login.token}}"
},
"expect": {
"status": [200],
"jsonPath": {
"$.success": true,
"$.data.price_rate": 1.5
}
}
},
{
"id": "toggle_inactive",
"name": "7. 그룹 비활성화 토글",
"method": "PATCH",
"endpoint": "/client-groups/{{create_group.group_id}}/toggle",
"headers": {
"Authorization": "Bearer {{login.token}}"
},
"expect": {
"status": [200],
"jsonPath": {
"$.success": true,
"$.data.is_active": false
}
}
},
{
"id": "toggle_active",
"name": "8. 그룹 활성화 토글",
"method": "PATCH",
"endpoint": "/client-groups/{{create_group.group_id}}/toggle",
"headers": {
"Authorization": "Bearer {{login.token}}"
},
"expect": {
"status": [200],
"jsonPath": {
"$.success": true,
"$.data.is_active": true
}
}
},
{
"id": "delete_group",
"name": "9. 거래처 그룹 삭제",
"method": "DELETE",
"endpoint": "/client-groups/{{create_group.group_id}}",
"headers": {
"Authorization": "Bearer {{login.token}}"
},
"expect": {
"status": [200],
"jsonPath": {
"$.success": true
}
}
},
{
"id": "verify_delete",
"name": "10. 삭제 확인 (404 예상)",
"method": "GET",
"endpoint": "/client-groups/{{create_group.group_id}}",
"headers": {
"Authorization": "Bearer {{login.token}}"
},
"expect": {
"status": [404],
"jsonPath": {
"$.success": false
}
}
}
]
}