Files
sam-docs/dev/dev_plans/flow-tests/items-crud-api-flow.json

375 lines
8.7 KiB
JSON
Raw Normal View History

{
"name": "Items API CRUD Flow Test",
"description": "통합 품목(Items) 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_code": "FLOWTEST-{{$timestamp}}",
"test_name": "플로우테스트_품목_{{$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_items_before",
"name": "2. 품목 목록 조회 (전체)",
"method": "GET",
"endpoint": "/items",
"params": {
"size": "20"
},
"headers": {
"Authorization": "Bearer {{login.token}}"
},
"expect": {
"status": [200],
"jsonPath": {
"$.success": true
}
}
},
{
"id": "list_items_fg",
"name": "3. 품목 목록 조회 (FG 필터)",
"method": "GET",
"endpoint": "/items",
"params": {
"type": "FG",
"size": "10"
},
"headers": {
"Authorization": "Bearer {{login.token}}"
},
"expect": {
"status": [200],
"jsonPath": {
"$.success": true
}
}
},
{
"id": "create_item_fg",
"name": "4. 완제품(FG) 생성",
"method": "POST",
"endpoint": "/items",
"headers": {
"Authorization": "Bearer {{login.token}}"
},
"body": {
"code": "{{test_code}}-FG",
"name": "{{test_name}}_완제품",
"product_type": "FG",
"unit": "EA",
"description": "Flow Test 완제품",
"is_sellable": true,
"is_purchasable": false,
"is_producible": true,
"safety_stock": 10,
"lead_time": 5
},
"expect": {
"status": [200, 201],
"jsonPath": {
"$.success": true,
"$.data.id": "@isNumber"
}
},
"extract": {
"fg_id": "$.data.id",
"fg_code": "$.data.code"
}
},
{
"id": "create_item_pt",
"name": "5. 반제품(PT) 생성",
"method": "POST",
"endpoint": "/items",
"headers": {
"Authorization": "Bearer {{login.token}}"
},
"body": {
"code": "{{test_code}}-PT",
"name": "{{test_name}}_반제품",
"product_type": "PT",
"unit": "EA",
"description": "Flow Test 반제품",
"is_sellable": false,
"is_purchasable": false,
"is_producible": true,
"safety_stock": 20
},
"expect": {
"status": [200, 201],
"jsonPath": {
"$.success": true,
"$.data.id": "@isNumber"
}
},
"extract": {
"pt_id": "$.data.id"
}
},
{
"id": "create_item_rm",
"name": "6. 원자재(RM) 생성",
"method": "POST",
"endpoint": "/items",
"headers": {
"Authorization": "Bearer {{login.token}}"
},
"body": {
"code": "{{test_code}}-RM",
"name": "{{test_name}}_원자재",
"product_type": "RM",
"unit": "KG",
"description": "Flow Test 원자재",
"is_sellable": false,
"is_purchasable": true,
"is_producible": false,
"material_code": "MAT-{{$timestamp}}",
"specification": "100mm x 50mm",
"is_inspection": "Y"
},
"expect": {
"status": [200, 201],
"jsonPath": {
"$.success": true,
"$.data.id": "@isNumber"
}
},
"extract": {
"rm_id": "$.data.id"
}
},
{
"id": "show_item_fg",
"name": "7. 완제품(FG) 단건 조회",
"method": "GET",
"endpoint": "/items/{{create_item_fg.fg_id}}",
"params": {
"item_type": "FG"
},
"headers": {
"Authorization": "Bearer {{login.token}}"
},
"expect": {
"status": [200],
"jsonPath": {
"$.success": true,
"$.data.id": "@isNumber"
}
}
},
{
"id": "show_item_by_code",
"name": "8. Code 기반 품목 조회",
"method": "GET",
"endpoint": "/items/code/{{create_item_fg.fg_code}}",
"headers": {
"Authorization": "Bearer {{login.token}}"
},
"expect": {
"status": [200],
"jsonPath": {
"$.success": true
}
}
},
{
"id": "show_item_with_price",
"name": "9. 단가 포함 품목 조회",
"method": "GET",
"endpoint": "/items/{{create_item_fg.fg_id}}",
"params": {
"item_type": "FG",
"include_price": "true"
},
"headers": {
"Authorization": "Bearer {{login.token}}"
},
"expect": {
"status": [200],
"jsonPath": {
"$.success": true
}
}
},
{
"id": "update_item_fg",
"name": "10. 완제품(FG) 수정",
"method": "PUT",
"endpoint": "/items/{{create_item_fg.fg_id}}",
"headers": {
"Authorization": "Bearer {{login.token}}"
},
"body": {
"item_type": "FG",
"name": "{{test_name}}_완제품_수정됨",
"description": "Flow Test 완제품 - 수정됨",
"safety_stock": 15,
"lead_time": 7
},
"expect": {
"status": [200],
"jsonPath": {
"$.success": true
}
}
},
{
"id": "update_item_rm",
"name": "11. 원자재(RM) 수정",
"method": "PUT",
"endpoint": "/items/{{create_item_rm.rm_id}}",
"headers": {
"Authorization": "Bearer {{login.token}}"
},
"body": {
"item_type": "RM",
"name": "{{test_name}}_원자재_수정됨",
"specification": "150mm x 75mm",
"remarks": "수정된 원자재 비고"
},
"expect": {
"status": [200],
"jsonPath": {
"$.success": true
}
}
},
{
"id": "verify_update",
"name": "12. 수정 확인 - 단건 재조회",
"method": "GET",
"endpoint": "/items/{{create_item_fg.fg_id}}",
"params": {
"item_type": "FG"
},
"headers": {
"Authorization": "Bearer {{login.token}}"
},
"expect": {
"status": [200],
"jsonPath": {
"$.success": true
}
}
},
{
"id": "search_items",
"name": "13. 품목 검색 (키워드)",
"method": "GET",
"endpoint": "/items",
"params": {
"q": "플로우테스트",
"size": "20"
},
"headers": {
"Authorization": "Bearer {{login.token}}"
},
"expect": {
"status": [200],
"jsonPath": {
"$.success": true
}
}
},
{
"id": "delete_item_pt",
"name": "14. 반제품(PT) 단건 삭제",
"method": "DELETE",
"endpoint": "/items/{{create_item_pt.pt_id}}",
"params": {
"item_type": "PT"
},
"headers": {
"Authorization": "Bearer {{login.token}}"
},
"expect": {
"status": [200],
"jsonPath": {
"$.success": true
}
}
},
{
"id": "batch_delete_items",
"name": "15. 품목 일괄 삭제 (FG, RM)",
"method": "DELETE",
"endpoint": "/items/batch",
"headers": {
"Authorization": "Bearer {{login.token}}"
},
"body": {
"item_type": "FG",
"ids": ["{{create_item_fg.fg_id}}"]
},
"expect": {
"status": [200],
"jsonPath": {
"$.success": true
}
}
},
{
"id": "delete_item_rm",
"name": "16. 원자재(RM) 삭제",
"method": "DELETE",
"endpoint": "/items/{{create_item_rm.rm_id}}",
"params": {
"item_type": "RM"
},
"headers": {
"Authorization": "Bearer {{login.token}}"
},
"expect": {
"status": [200],
"jsonPath": {
"$.success": true
}
}
},
{
"id": "verify_cleanup",
"name": "17. 정리 확인 - 목록 재조회",
"method": "GET",
"endpoint": "/items",
"params": {
"q": "FLOWTEST",
"size": "20"
},
"headers": {
"Authorization": "Bearer {{login.token}}"
},
"expect": {
"status": [200],
"jsonPath": {
"$.success": true
}
}
}
]
}