Files
sam-manage/database/data/flow-tester/items-crud.json
hskwon 189376ffad feat: [flow-tester] 품목관리 API 테스트 JSON 예제 3개 추가
- items-crud.json: Faker 기반 CRUD 테스트 (5 steps)
- items-search.json: 목록/검색/통계 테스트 (5 steps)
- items-bom.json: BOM 관리 테스트 (8 steps)
2025-12-01 14:05:15 +09:00

97 lines
2.2 KiB
JSON

{
"version": "1.0",
"meta": {
"name": "Items CRUD Test",
"description": "CRUD test with Faker",
"tags": ["items", "crud", "faker"]
},
"config": {
"baseUrl": "https://sam.kr/api/v1",
"timeout": 30000,
"stopOnFailure": false,
"headers": {
"Accept": "application/json",
"Content-Type": "application/json"
}
},
"variables": {},
"steps": [
{
"id": "create_item",
"name": "Create Item",
"method": "POST",
"endpoint": "/items",
"body": {
"code": "{{$faker.itemCode:TEST}}",
"name": "{{$faker.productName}}",
"item_type": "PRODUCT",
"unit": "{{$faker.unit}}",
"unit_price": "{{$faker.price:1000:50000}}",
"description": "{{$faker.sentence}}",
"is_active": true
},
"expect": {
"status": [200, 201],
"jsonPath": {
"$.success": true,
"$.data.code": "@isString"
}
},
"extract": {
"itemCode": "$.data.code",
"itemId": "$.data.id"
}
},
{
"id": "get_item",
"name": "Get Item by Code",
"dependsOn": ["create_item"],
"method": "GET",
"endpoint": "/items/code/{{create_item.itemCode}}",
"expect": {
"status": [200],
"jsonPath": {
"$.success": true
}
}
},
{
"id": "update_item",
"name": "Update Item",
"dependsOn": ["get_item"],
"method": "PUT",
"endpoint": "/items/{{create_item.itemCode}}",
"body": {
"name": "Updated Product",
"unit_price": "{{$faker.price:50000:100000}}"
},
"expect": {
"status": [200],
"jsonPath": {
"$.success": true
}
}
},
{
"id": "delete_item",
"name": "Delete Item",
"dependsOn": ["update_item"],
"method": "DELETE",
"endpoint": "/items/{{create_item.itemCode}}",
"expect": {
"status": [200, 204]
}
},
{
"id": "verify_delete",
"name": "Verify Delete",
"dependsOn": ["delete_item"],
"method": "GET",
"endpoint": "/items/code/{{create_item.itemCode}}",
"expect": {
"status": [404]
},
"continueOnFailure": true
}
]
}