From 189376ffad4a9e50ecc1a55a2b5cb6c0d481a500 Mon Sep 17 00:00:00 2001 From: hskwon Date: Mon, 1 Dec 2025 14:01:01 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[flow-tester]=20=ED=92=88=EB=AA=A9?= =?UTF-8?q?=EA=B4=80=EB=A6=AC=20API=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20JSON?= =?UTF-8?q?=20=EC=98=88=EC=A0=9C=203=EA=B0=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - items-crud.json: Faker 기반 CRUD 테스트 (5 steps) - items-search.json: 목록/검색/통계 테스트 (5 steps) - items-bom.json: BOM 관리 테스트 (8 steps) --- database/data/flow-tester/items-bom.json | 144 ++++++++++++++++++++ database/data/flow-tester/items-crud.json | 97 +++++++++++++ database/data/flow-tester/items-search.json | 85 ++++++++++++ 3 files changed, 326 insertions(+) create mode 100644 database/data/flow-tester/items-bom.json create mode 100644 database/data/flow-tester/items-crud.json create mode 100644 database/data/flow-tester/items-search.json diff --git a/database/data/flow-tester/items-bom.json b/database/data/flow-tester/items-bom.json new file mode 100644 index 00000000..51413f01 --- /dev/null +++ b/database/data/flow-tester/items-bom.json @@ -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 + } + ] +} \ No newline at end of file diff --git a/database/data/flow-tester/items-crud.json b/database/data/flow-tester/items-crud.json new file mode 100644 index 00000000..b7988953 --- /dev/null +++ b/database/data/flow-tester/items-crud.json @@ -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 + } + ] +} \ No newline at end of file diff --git a/database/data/flow-tester/items-search.json b/database/data/flow-tester/items-search.json new file mode 100644 index 00000000..4b8959bb --- /dev/null +++ b/database/data/flow-tester/items-search.json @@ -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 + } + } + } + ] +} \ No newline at end of file