Files
sam-scenarios/settings-vacation-policy.json

220 lines
7.4 KiB
JSON
Raw Normal View History

{
"id": "settings-vacation-policy",
"name": "휴가정책 테스트",
"screenshotPolicy": {
"onErrorOnly": true,
"captureOn": [
"error",
"fail",
"timeout",
"404",
"500",
"blocked"
]
},
"description": "설정 > 휴가정책 메뉴의 휴가 정책 조회/수정/저장 기능 테스트",
"baseUrl": "https://dev.codebridge-x.com",
"menuNavigation": {
"level1": "설정",
"level2": "휴가정책",
"expectedUrl": "/settings/leave-policy",
"searchWithinParent": true,
"closeOtherMenus": true
},
"auth": {
"username": "TestUser5",
"password": "password123!"
},
"testData": {
"update": {
"annualLeave": "15",
"halfDayEnabled": true,
"carryOverDays": "5",
"memo": "E2E 테스트 휴가정책"
},
"restore": {
"annualLeave": "15",
"halfDayEnabled": true,
"carryOverDays": "5"
}
},
"steps": [
{
"id": 1,
"name": "메뉴 진입: 설정 > 휴가정책",
"action": "menu_navigate",
"level1": "설정",
"level2": "휴가정책",
"expected": {
"url_contains": "/settings/leave-policy",
"visible": [
"휴가정책",
"휴가"
]
}
},
{
"id": 2,
"name": "URL 검증",
"action": "verify_url",
"expected": {
"url_contains": "/settings/leave-policy"
}
},
{
"id": 3,
"name": "필수 검증 #5: 목업 페이지 감지",
"action": "verify_not_mockup",
"checks": [
"휴가 정책 설정 폼 표시",
"연차 부여 기준 설정 가능",
"저장 버튼 존재"
],
"expected": "정상 페이지 (목업 아님)"
},
{
"id": 4,
"name": "통계 카드 확인",
"action": "evaluate",
"script": "(() => {\n const cards = document.querySelectorAll('[class*=\"card\"], [class*=\"Card\"], [class*=\"stat\"], [class*=\"Stat\"], [class*=\"summary\"]');\n const texts = Array.from(cards).map(c => c.innerText?.substring(0, 30)).filter(Boolean);\n return texts.length > 0 ? 'Stats: ' + texts.length + ' cards found' : 'No stat cards (ok)';\n })()"
},
{
"id": 5,
"name": "휴가 정책 폼 구조 확인",
"action": "evaluate",
"script": "(() => { const inputs = document.querySelectorAll('input:not([type=\"hidden\"]), select, textarea, button[role=\"switch\"]'); const body = document.body.innerText; const keywords = ['연차', '반차', '이월', '휴가', '정책'].filter(k => body.includes(k)); return 'Form elements: ' + inputs.length + ', Keywords: [' + keywords.join(', ') + ']'; })()"
},
{
"id": 6,
"phase": "READ",
"name": "[READ] 현재 정책 값 확인",
"action": "verify_detail",
"checks": [
"연차 부여 기준 표시",
"반차 사용 설정 표시",
"이월 일수 표시"
],
"expected": "현재 정책 값 정상 표시"
},
{
"id": 7,
"phase": "UPDATE",
"name": "[UPDATE] 연차 설정 확인",
"action": "click_if_exists",
"target": "input[type='number'], input[placeholder*='연차'], input[placeholder*='일수']"
},
{
"id": 8,
"phase": "UPDATE",
"name": "[UPDATE] 반차 사용 설정",
"action": "click_if_exists",
"target": "button[role='switch'], [class*='switch'], [class*='Switch'], input[type='checkbox']",
"expected": {
"checkbox_toggled": true
}
},
{
"id": 9,
"phase": "UPDATE",
"name": "[UPDATE] 이월 설정 확인",
"action": "click_if_exists",
"target": "input[placeholder*='이월'], input[name*='carryOver'], input[name*='carry']"
},
{
"id": 10,
"phase": "UPDATE",
"name": "[UPDATE] 필수 검증 #2: 정책 저장",
"action": "click_if_exists",
"target": "저장",
"verify": {
"url_maintained": true,
"no_error_page": true,
"api_call": "PUT /api/v1/settings/vacation-policy",
"toast": "저장|적용|완료|성공"
},
"expected": "휴가 정책 저장 완료"
},
{
"id": 11,
"phase": "UPDATE",
"name": "[UPDATE] 저장 결과 확인",
"action": "verify_detail",
"checks": [
"연차: 15",
"이월 일수: 5"
],
"expected": "수정된 정책 반영"
},
{
"id": 12,
"name": "휴가 유형 관리 확인",
"action": "evaluate",
"script": "(() => { const body = document.body.innerText; const types = ['연차', '병가', '경조사', '출산', '특별'].filter(t => body.includes(t)); const selects = document.querySelectorAll('select, [role=\"combobox\"], [role=\"listbox\"]'); return 'Found vacation types: [' + types.join(', ') + '], selects: ' + selects.length; })()"
},
{
"id": 13,
"phase": "CREATE",
"name": "[CREATE] 휴가 유형 추가 버튼 확인",
"action": "evaluate",
"script": "(() => { const btns = Array.from(document.querySelectorAll('button')).filter(b => ['추가', '등록', '신규'].some(t => b.innerText?.includes(t))); return btns.length > 0 ? '추가 버튼 발견: ' + btns.map(b => b.innerText.trim().substring(0,20)).join(', ') : '추가 버튼 미발견 (ok)'; })()"
},
{
"id": 14,
"name": "페이지네이션 확인",
"action": "evaluate",
"script": "(() => {\n const paginationSels = ['[class*=\"pagination\"]', '[class*=\"Pagination\"]', 'nav[aria-label*=\"page\"]', 'button[aria-label*=\"page\"]', '[class*=\"pager\"]'];\n for (const sel of paginationSels) {\n const el = document.querySelector(sel);\n if (el) return 'Pagination found';\n }\n const pageButtons = Array.from(document.querySelectorAll('button')).filter(b => /^\\d+$/.test(b.innerText?.trim()));\n if (pageButtons.length > 0) return 'Page buttons found: ' + pageButtons.length;\n return 'No pagination (ok - may have single page)';\n })()"
},
{
"id": 15,
"name": "콘솔 에러 확인",
"action": "verify_element",
"target": "body"
},
{
"id": 16,
"name": "정책 적용 대상 확인",
"action": "evaluate",
"script": "(() => { const body = document.body.innerText; const hasDept = body.includes('부서') || body.includes('적용 대상'); const hasRank = body.includes('직급') || body.includes('직책'); return '부서: ' + hasDept + ', 직급: ' + hasRank; })()"
}
],
"expectedAPIs": [
{
"method": "GET",
"endpoint": "/api/v1/settings/vacation-policy",
"description": "휴가 정책 조회"
},
{
"method": "PUT",
"endpoint": "/api/v1/settings/vacation-policy",
"description": "휴가 정책 수정"
},
{
"method": "GET",
"endpoint": "/api/v1/vacation-types",
"description": "휴가 유형 목록 조회"
}
],
"requiredVerifications": [
{
"id": 2,
"name": "저장 버튼",
"steps": [
8
],
"criteria": "API 호출 + 성공 토스트 + 설정 반영"
},
{
"id": 5,
"name": "목업 페이지 감지",
"steps": [
2
],
"criteria": "휴가 정책 폼, 저장 버튼 존재"
}
],
"rollbackPlan": {
"onUpdateFail": "페이지 새로고침으로 원래 값 복원",
"note": "설정 페이지는 수정 후 원복 테스트 권장"
}
}