feat: [flow-tester] API 로그 캡처 및 UI 개선

- ApiLogCapturer 추가: 플로우 실행 중 API 로그 캡처
- resolveBaseUrl() 추가: .env 환경변수 기반 baseUrl 지원
- 실행 상세 페이지: 스텝별 접기/펼치기 기능 (성공=접힘, 실패=펼침)
- JSON 가이드 및 예제 플로우 최신화
- AI 프롬프트 템플릿 업데이트
- bindExpectVariables() 추가: expect jsonPath 값에 변수 바인딩 적용
- areNumericEqual() 추가: 숫자 타입 유연 비교 ("2" == 2)
This commit is contained in:
2025-12-04 15:30:04 +09:00
parent 20cfa01579
commit fe10cae06c
9 changed files with 709 additions and 143 deletions

View File

@@ -409,53 +409,87 @@ class="px-4 py-2 bg-gray-600 hover:bg-gray-700 text-white rounded-lg transition-
]
},
'auth-flow': {
"name": "인증 플로우 테스트",
"description": "로그인, 프로필 조회, 토큰 갱신, 로그아웃 플로우를 테스트합니다.",
"version": "1.0",
"config": {
"baseUrl": "https://sam.kr/api/v1",
"baseUrl": "https://api.sam.kr/api/v1",
"apiKey": "YOUR_API_KEY_HERE",
"timeout": 30000,
"stopOnFailure": true
},
"variables": {
"email": "test@example.com",
"password": "password123"
"user_id": "{{$env.FLOW_TESTER_USER_ID}}",
"user_pwd": "{{$env.FLOW_TESTER_USER_PWD}}"
},
"steps": [
{
"id": "login",
"name": "로그인",
"method": "POST",
"endpoint": "/auth/login",
"body": { "email": "{{variables.email}}", "password": "{{variables.password}}" },
"expect": { "status": [200], "jsonPath": { "$.success": true, "$.data.token": "@isString" } },
"extract": { "accessToken": "$.data.token", "refreshToken": "$.data.refresh_token" }
"endpoint": "/login",
"body": {
"user_id": "{{variables.user_id}}",
"user_pwd": "{{variables.user_pwd}}"
},
"expect": {
"status": [200],
"jsonPath": {
"$.access_token": "@isString"
}
},
"extract": {
"accessToken": "$.access_token",
"refreshToken": "$.refresh_token"
}
},
{
"id": "get_profile",
"name": "프로필 조회",
"dependsOn": ["login"],
"method": "GET",
"endpoint": "/auth/me",
"headers": { "Authorization": "Bearer {{login.accessToken}}" },
"expect": { "status": [200], "jsonPath": { "$.data.email": "{{variables.email}}" } }
"endpoint": "/users/me",
"headers": {
"Authorization": "Bearer {{login.accessToken}}"
},
"expect": {
"status": [200],
"jsonPath": {
"$.success": true
}
}
},
{
"id": "refresh_token",
"name": "토큰 갱신",
"dependsOn": ["get_profile"],
"method": "POST",
"endpoint": "/auth/refresh",
"body": { "refresh_token": "{{login.refreshToken}}" },
"expect": { "status": [200], "jsonPath": { "$.data.token": "@isString" } },
"extract": { "newToken": "$.data.token" }
"endpoint": "/refresh",
"body": {
"refresh_token": "{{login.refreshToken}}"
},
"expect": {
"status": [200],
"jsonPath": {
"$.access_token": "@isString"
}
},
"extract": {
"newToken": "$.access_token"
}
},
{
"id": "logout",
"name": "로그아웃",
"dependsOn": ["refresh_token"],
"method": "POST",
"endpoint": "/auth/logout",
"headers": { "Authorization": "Bearer {{refresh_token.newToken}}" },
"expect": { "status": [200, 204] }
"endpoint": "/logout",
"headers": {
"Authorization": "Bearer {{refresh_token.newToken}}"
},
"expect": {
"status": [200, 204]
}
}
]
},