feat: [flow-tester] 품목관리 API 테스트 JSON 예제 3개 추가
- items-crud.json: Faker 기반 CRUD 테스트 (5 steps) - items-search.json: 목록/검색/통계 테스트 (5 steps) - items-bom.json: BOM 관리 테스트 (8 steps)
This commit is contained in:
144
database/data/flow-tester/items-bom.json
Normal file
144
database/data/flow-tester/items-bom.json
Normal file
@@ -0,0 +1,144 @@
|
||||
{
|
||||
"version": "1.0",
|
||||
"meta": {
|
||||
"name": "Items BOM Test",
|
||||
"description": "BOM management test",
|
||||
"tags": ["items", "bom"]
|
||||
},
|
||||
"config": {
|
||||
"baseUrl": "https://sam.kr/api/v1",
|
||||
"timeout": 30000,
|
||||
"stopOnFailure": false
|
||||
},
|
||||
"variables": {},
|
||||
"steps": [
|
||||
{
|
||||
"id": "create_parent",
|
||||
"name": "Create Parent Item",
|
||||
"method": "POST",
|
||||
"endpoint": "/items",
|
||||
"body": {
|
||||
"code": "{{$faker.itemCode:PROD}}",
|
||||
"name": "{{$faker.productName}}",
|
||||
"item_type": "PRODUCT",
|
||||
"unit": "EA",
|
||||
"unit_price": "{{$faker.price:100000:500000}}"
|
||||
},
|
||||
"expect": {
|
||||
"status": [200, 201]
|
||||
},
|
||||
"extract": {
|
||||
"parentCode": "$.data.code",
|
||||
"parentId": "$.data.id"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "create_child1",
|
||||
"name": "Create Material 1",
|
||||
"dependsOn": ["create_parent"],
|
||||
"method": "POST",
|
||||
"endpoint": "/items",
|
||||
"body": {
|
||||
"code": "{{$faker.itemCode:MAT}}",
|
||||
"name": "Material A",
|
||||
"item_type": "MATERIAL",
|
||||
"unit": "{{$faker.unit}}",
|
||||
"unit_price": "{{$faker.price:1000:10000}}"
|
||||
},
|
||||
"expect": {
|
||||
"status": [200, 201]
|
||||
},
|
||||
"extract": {
|
||||
"child1Code": "$.data.code"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "create_child2",
|
||||
"name": "Create Material 2",
|
||||
"dependsOn": ["create_child1"],
|
||||
"method": "POST",
|
||||
"endpoint": "/items",
|
||||
"body": {
|
||||
"code": "{{$faker.itemCode:PART}}",
|
||||
"name": "Part B",
|
||||
"item_type": "MATERIAL",
|
||||
"unit": "EA",
|
||||
"unit_price": "{{$faker.price:5000:20000}}"
|
||||
},
|
||||
"expect": {
|
||||
"status": [200, 201]
|
||||
},
|
||||
"extract": {
|
||||
"child2Code": "$.data.code"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "add_bom1",
|
||||
"name": "Add BOM Material 1",
|
||||
"dependsOn": ["create_child2"],
|
||||
"method": "POST",
|
||||
"endpoint": "/items/{{create_parent.parentCode}}/bom",
|
||||
"body": {
|
||||
"child_code": "{{create_child1.child1Code}}",
|
||||
"quantity": "{{$faker.number:1:10}}",
|
||||
"unit": "{{$faker.unit}}"
|
||||
},
|
||||
"expect": {
|
||||
"status": [200, 201]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "add_bom2",
|
||||
"name": "Add BOM Material 2",
|
||||
"dependsOn": ["add_bom1"],
|
||||
"method": "POST",
|
||||
"endpoint": "/items/{{create_parent.parentCode}}/bom",
|
||||
"body": {
|
||||
"child_code": "{{create_child2.child2Code}}",
|
||||
"quantity": "{{$faker.number:1:5}}",
|
||||
"unit": "EA"
|
||||
},
|
||||
"expect": {
|
||||
"status": [200, 201]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "get_bom",
|
||||
"name": "Get BOM List",
|
||||
"dependsOn": ["add_bom2"],
|
||||
"method": "GET",
|
||||
"endpoint": "/items/{{create_parent.parentCode}}/bom",
|
||||
"expect": {
|
||||
"status": [200],
|
||||
"jsonPath": {
|
||||
"$.success": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "cleanup_parent",
|
||||
"name": "Delete Parent",
|
||||
"dependsOn": ["get_bom"],
|
||||
"method": "DELETE",
|
||||
"endpoint": "/items/{{create_parent.parentCode}}",
|
||||
"expect": {
|
||||
"status": [200, 204]
|
||||
},
|
||||
"continueOnFailure": true
|
||||
},
|
||||
{
|
||||
"id": "cleanup_children",
|
||||
"name": "Delete Materials",
|
||||
"dependsOn": ["cleanup_parent"],
|
||||
"method": "DELETE",
|
||||
"endpoint": "/items/batch",
|
||||
"body": {
|
||||
"codes": ["{{create_child1.child1Code}}", "{{create_child2.child2Code}}"]
|
||||
},
|
||||
"expect": {
|
||||
"status": [200, 204]
|
||||
},
|
||||
"continueOnFailure": true
|
||||
}
|
||||
]
|
||||
}
|
||||
97
database/data/flow-tester/items-crud.json
Normal file
97
database/data/flow-tester/items-crud.json
Normal file
@@ -0,0 +1,97 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
85
database/data/flow-tester/items-search.json
Normal file
85
database/data/flow-tester/items-search.json
Normal file
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"version": "1.0",
|
||||
"meta": {
|
||||
"name": "Items Search Test",
|
||||
"description": "List, search, pagination test",
|
||||
"tags": ["items", "search", "stats"]
|
||||
},
|
||||
"config": {
|
||||
"baseUrl": "https://sam.kr/api/v1",
|
||||
"timeout": 30000,
|
||||
"stopOnFailure": false
|
||||
},
|
||||
"variables": {
|
||||
"searchKeyword": "part"
|
||||
},
|
||||
"steps": [
|
||||
{
|
||||
"id": "list_items",
|
||||
"name": "List All Items",
|
||||
"method": "GET",
|
||||
"endpoint": "/items",
|
||||
"expect": {
|
||||
"status": [200],
|
||||
"jsonPath": {
|
||||
"$.success": true
|
||||
}
|
||||
},
|
||||
"extract": {
|
||||
"totalCount": "$.meta.total"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "list_paginated",
|
||||
"name": "List with Pagination",
|
||||
"dependsOn": ["list_items"],
|
||||
"method": "GET",
|
||||
"endpoint": "/items?page=1&per_page=10",
|
||||
"expect": {
|
||||
"status": [200],
|
||||
"jsonPath": {
|
||||
"$.success": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "search_keyword",
|
||||
"name": "Search by Keyword",
|
||||
"dependsOn": ["list_paginated"],
|
||||
"method": "GET",
|
||||
"endpoint": "/items/search?keyword={{variables.searchKeyword}}",
|
||||
"expect": {
|
||||
"status": [200],
|
||||
"jsonPath": {
|
||||
"$.success": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "search_type",
|
||||
"name": "Filter by Type",
|
||||
"dependsOn": ["search_keyword"],
|
||||
"method": "GET",
|
||||
"endpoint": "/items/search?item_type=PRODUCT",
|
||||
"expect": {
|
||||
"status": [200],
|
||||
"jsonPath": {
|
||||
"$.success": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "get_stats",
|
||||
"name": "Get Statistics",
|
||||
"dependsOn": ["search_type"],
|
||||
"method": "GET",
|
||||
"endpoint": "/items/stats",
|
||||
"expect": {
|
||||
"status": [200],
|
||||
"jsonPath": {
|
||||
"$.success": true
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user