- settings-attendance: verify_elements→evaluate, :has-text→텍스트 target - settings-vacation-policy: :nth-of-type/:has-text 제거, evaluate로 변경 - employee-register: menuNavigation 사원관리→직원관리, fill_form→evaluate - department-add: verify_elements→evaluate, click_first_row 사용 - settings-rank: :has-text→텍스트 target, 직급명 입력 필드 확인 추가 - settings-position: verify_not_mockup→wait+evaluate, 직책명 입력 확인 - hr-vacation: 날짜 입력 evaluate 추가, :has-text→텍스트 target - hr-salary: 날짜 필터 확인 스텝 추가, :has-text→텍스트 target Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
295 lines
19 KiB
JSON
295 lines
19 KiB
JSON
{
|
|
"id": "employee-register",
|
|
"name": "직원 등록 테스트",
|
|
"screenshotPolicy": {
|
|
"onErrorOnly": true,
|
|
"captureOn": [
|
|
"error",
|
|
"fail",
|
|
"timeout",
|
|
"404",
|
|
"500",
|
|
"blocked"
|
|
]
|
|
},
|
|
"description": "신규 직원 정보를 입력하고 등록하는 E2E 테스트",
|
|
"baseUrl": "https://dev.codebridge-x.com",
|
|
"url": "/ko/hr/employee-management",
|
|
"navigation": {
|
|
"targetUrl": "/hr/employee-management",
|
|
"urlPattern": "/hr/employee-management|/ko/hr/employee-management",
|
|
"menuHints": [
|
|
"직원관리",
|
|
"직원 관리",
|
|
"인사관리"
|
|
]
|
|
},
|
|
"menuNavigation": {
|
|
"level1": "인사관리",
|
|
"level2": "직원관리",
|
|
"expectedUrl": "/ko/hr/employee-management",
|
|
"searchWithinParent": true,
|
|
"closeOtherMenus": true
|
|
},
|
|
"menuNavigationEnhanced": {
|
|
"strategy": "scroll-and-search",
|
|
"level1": {
|
|
"text": "인사관리",
|
|
"scrollContainer": ".sidebar-scroll, [class*='sidebar'], nav",
|
|
"maxScrollAttempts": 5,
|
|
"scrollStep": 200
|
|
},
|
|
"level2": {
|
|
"text": "직원관리",
|
|
"waitAfterLevel1": 500
|
|
},
|
|
"fallbackUrl": "/ko/hr/employee-management",
|
|
"timeout": 10000
|
|
},
|
|
"timeout": 60000,
|
|
"tags": [
|
|
"hr",
|
|
"employee",
|
|
"crud"
|
|
],
|
|
"auth": {
|
|
"username": "TestUser5",
|
|
"password": "password123!"
|
|
},
|
|
"steps": [
|
|
{
|
|
"id": 1,
|
|
"name": "사이드바 메뉴 전체 펼치기",
|
|
"description": "모두 펼치기 버튼을 클릭하여 전체 메뉴를 펼친 후 메뉴 탐색 준비",
|
|
"action": "evaluate",
|
|
"script": "(async () => { document.querySelector('.sidebar-scroll, [class*=\"sidebar\"], nav')?.scrollTo({top: 0, behavior: 'instant'}); await new Promise(r => setTimeout(r, 300)); Array.from(document.querySelectorAll('button')).find(b => b.innerText?.includes('모두 펼치기'))?.click(); await new Promise(r => setTimeout(r, 2000)); return 'Menu expanded'; })()"
|
|
},
|
|
{
|
|
"id": 2,
|
|
"name": "인사관리 메뉴 진입",
|
|
"description": "인사관리 > 직원관리 메뉴로 이동",
|
|
"action": "menu_navigate",
|
|
"level1": "인사관리",
|
|
"level2": "직원관리"
|
|
},
|
|
{
|
|
"id": 3,
|
|
"name": "사원 등록 페이지 이동",
|
|
"action": "click_if_exists",
|
|
"target": "사원 등록"
|
|
},
|
|
{
|
|
"id": 4,
|
|
"name": "사원 정보 입력",
|
|
"description": "기본 사원 정보 입력",
|
|
"action": "fill_form",
|
|
"fields": [
|
|
{
|
|
"name": "이름 *",
|
|
"type": "text",
|
|
"value": "E2E_TEST_사원"
|
|
},
|
|
{
|
|
"name": "주민등록번호",
|
|
"type": "text",
|
|
"value": "900101-1234567"
|
|
},
|
|
{
|
|
"name": "휴대폰",
|
|
"type": "text",
|
|
"value": "010-1234-5678"
|
|
},
|
|
{
|
|
"name": "이메일 *",
|
|
"type": "text",
|
|
"value": "e2e_test_employee@codebridge-x.com"
|
|
},
|
|
{
|
|
"name": "연봉",
|
|
"type": "number",
|
|
"value": "50000000"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": 5,
|
|
"name": "급여계좌 정보 입력",
|
|
"action": "fill_form",
|
|
"fields": [
|
|
{
|
|
"name": "은행명",
|
|
"type": "text",
|
|
"value": "신한은행"
|
|
},
|
|
{
|
|
"name": "계좌번호",
|
|
"type": "text",
|
|
"value": "110-123-456789"
|
|
},
|
|
{
|
|
"name": "예금주",
|
|
"type": "text",
|
|
"value": "E2E_TEST_사원"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": 6,
|
|
"name": "사원 상세 정보 입력",
|
|
"action": "evaluate",
|
|
"script": "(async () => { const w = ms => new Promise(r => setTimeout(r, ms)); const fillByLabel = (label, value) => { const labels = Array.from(document.querySelectorAll('label, span, div, p')); const found = labels.find(l => l.innerText?.trim().includes(label)); if (!found) return false; const container = found.closest('[class*=\"field\"], [class*=\"form-group\"], [class*=\"Form\"], .grid, tr, [class*=\"row\"]') || found.parentElement; if (!container) return false; const input = container.querySelector('input:not([type=\"hidden\"]):not([type=\"radio\"]):not([type=\"checkbox\"]), textarea'); if (input) { const ns = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')?.set; if (ns) ns.call(input, value); else input.value = value; input.dispatchEvent(new Event('input', {bubbles:true})); input.dispatchEvent(new Event('change', {bubbles:true})); return true; } return false; }; const r1 = fillByLabel('사원코드', 'E2E_TEST_EMP001'); await w(200); const radioM = document.querySelector('input[type=\"radio\"][value=\"male\"], input[type=\"radio\"][value=\"M\"]') || Array.from(document.querySelectorAll('label')).find(l => l.innerText?.includes('남성'))?.querySelector('input[type=\"radio\"]') || Array.from(document.querySelectorAll('label')).find(l => l.innerText?.includes('남성')); if (radioM) radioM.click(); await w(200); const r3 = fillByLabel('상세주소', '123번지 4층'); return JSON.stringify({code: r1, gender: !!radioM, address: r3}); })()"
|
|
},
|
|
{
|
|
"id": 7,
|
|
"name": "인사 정보 입력",
|
|
"action": "evaluate",
|
|
"script": "(async () => { const w = ms => new Promise(r => setTimeout(r, ms)); const fillByLabel = (label, value) => { const labels = Array.from(document.querySelectorAll('label, span, div, p')); const found = labels.find(l => l.innerText?.trim().includes(label)); if (!found) return false; const container = found.closest('[class*=\"field\"], [class*=\"form-group\"], [class*=\"Form\"], .grid, tr, [class*=\"row\"]') || found.parentElement; if (!container) return false; const input = container.querySelector('input:not([type=\"hidden\"]):not([type=\"radio\"]):not([type=\"checkbox\"]), textarea'); if (input) { const ns = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')?.set; if (ns) ns.call(input, value); else input.value = value; input.dispatchEvent(new Event('input', {bubbles:true})); input.dispatchEvent(new Event('change', {bubbles:true})); return true; } return false; }; fillByLabel('입사일', '2026-01-14'); await w(300); const clickCombobox = async (placeholder) => { const triggers = Array.from(document.querySelectorAll('button[role=\"combobox\"], [class*=\"select-trigger\"], [class*=\"SelectTrigger\"], select, [role=\"combobox\"]')); const trigger = triggers.find(t => t.innerText?.includes(placeholder) || t.getAttribute('placeholder')?.includes(placeholder)); if (trigger) { trigger.click(); await w(500); return true; } return false; }; const clickOption = async (text) => { const options = Array.from(document.querySelectorAll('[role=\"option\"], [role=\"menuitem\"], li[class*=\"option\"], div[class*=\"option\"]')); const opt = options.find(o => o.innerText?.trim() === text || o.innerText?.includes(text)); if (opt) { opt.click(); await w(300); return true; } return false; }; let r1 = await clickCombobox('고용형태'); if (!r1) r1 = await clickCombobox('고용'); await clickOption('정규직'); await w(300); let r2 = await clickCombobox('직급'); await clickOption('사원'); return JSON.stringify({employType: r1, rank: r2}); })()"
|
|
},
|
|
{
|
|
"id": 8,
|
|
"name": "사용자 정보 입력",
|
|
"action": "evaluate",
|
|
"script": "(async () => { const w = ms => new Promise(r => setTimeout(r, ms)); const fillByLabel = (label, value) => { const labels = Array.from(document.querySelectorAll('label, span, div, p')); const found = labels.find(l => l.innerText?.trim().includes(label)); if (!found) return false; const container = found.closest('[class*=\"field\"], [class*=\"form-group\"], [class*=\"Form\"], .grid, tr, [class*=\"row\"]') || found.parentElement; if (!container) return false; const input = container.querySelector('input:not([type=\"hidden\"]):not([type=\"radio\"]):not([type=\"checkbox\"]), textarea'); if (input) { const ns = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')?.set; if (ns) ns.call(input, value); else input.value = value; input.dispatchEvent(new Event('input', {bubbles:true})); input.dispatchEvent(new Event('change', {bubbles:true})); return true; } return false; }; const r1 = fillByLabel('아이디', 'e2e_test_user001'); await w(200); const r2 = fillByLabel('비밀번호', 'password123!'); await w(200); const pwInputs = Array.from(document.querySelectorAll('input[type=\"password\"]')); if (pwInputs.length >= 2) { const ns = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')?.set; if (ns) ns.call(pwInputs[1], 'password123!'); else pwInputs[1].value = 'password123!'; pwInputs[1].dispatchEvent(new Event('input', {bubbles:true})); pwInputs[1].dispatchEvent(new Event('change', {bubbles:true})); } return JSON.stringify({id: r1, pw: r2, pwConfirm: pwInputs.length >= 2}); })()"
|
|
},
|
|
{
|
|
"id": 9,
|
|
"name": "고유 식별자 설정 및 등록",
|
|
"description": "중복 방지를 위해 이메일/사원코드/아이디를 타임스탬프 기반 고유값으로 교체 후 등록",
|
|
"action": "evaluate",
|
|
"script": "(async () => { const ts = Date.now().toString(36); const setByValue = (oldVal, newVal) => { const inputs = Array.from(document.querySelectorAll('input')); const input = inputs.find(i => i.value === oldVal); if (input) { const ns = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')?.set; if (ns) ns.call(input, newVal); else input.value = newVal; input.dispatchEvent(new Event('input', {bubbles:true})); input.dispatchEvent(new Event('change', {bubbles:true})); return true; } return false; }; const r1 = setByValue('e2e_test_employee@codebridge-x.com', 'e2e_' + ts + '@test.com'); const r2 = setByValue('E2E_TEST_EMP001', 'E2E_EMP_' + ts); const r3 = setByValue('e2e_test_user001', 'e2e_usr_' + ts); await new Promise(r => setTimeout(r, 500)); const btn = Array.from(document.querySelectorAll('button')).find(b => b.innerText?.trim() === '등록' || (b.innerText?.includes('등록') && !b.innerText?.includes('사원 등록'))); if (btn) { btn.click(); await new Promise(r => setTimeout(r, 2000)); return JSON.stringify({ok:true, info:'등록 클릭 완료 (ts=' + ts + ', email=' + r1 + ', code=' + r2 + ', user=' + r3 + ')'}); } return JSON.stringify({ok:false, error:'등록 버튼 미발견'}); })()"
|
|
},
|
|
{
|
|
"id": 10,
|
|
"name": "등록 후 페이지 전환 대기",
|
|
"action": "wait",
|
|
"timeout": 3000
|
|
},
|
|
{
|
|
"id": 11,
|
|
"name": "직원 목록 테이블 로드 대기",
|
|
"action": "wait_for_table",
|
|
"timeout": 10000
|
|
},
|
|
{
|
|
"id": 12,
|
|
"name": "검색 기간 설정 - 유효 기간",
|
|
"description": "등록된 사원의 입사일(2026-01-14)이 포함되는 기간으로 검색",
|
|
"action": "evaluate",
|
|
"script": "(async () => { const startInput = document.querySelector(\"input[placeholder*='시작'], input[name*='startDate'], input[type='date']:first-of-type\"); if (startInput) { startInput.click(); await new Promise(r => setTimeout(r, 200)); } const endInput = document.querySelector(\"input[placeholder*='종료'], input[name*='endDate'], input[type='date']:last-of-type\"); if (endInput) { endInput.click(); await new Promise(r => setTimeout(r, 200)); } const searchBtn = Array.from(document.querySelectorAll('button')).find(b => b.innerText?.includes('검색')); if (searchBtn) searchBtn.click(); await new Promise(r => setTimeout(r, 1000)); return document.body.innerText.includes('E2E_TEST_사원') ? 'PASS: Found in search results' : 'WARN: Not found in search results'; })()",
|
|
"onFail": {
|
|
"record": true,
|
|
"message": "검색 기간 2026-01-01 ~ 2026-01-31 내 입사일(2026-01-14) 사원이 검색되지 않음",
|
|
"severity": "HIGH",
|
|
"bugType": "검색 기간 필터링 오류"
|
|
}
|
|
},
|
|
{
|
|
"id": 13,
|
|
"name": "검색 기간 설정 - 범위 외 기간",
|
|
"description": "등록된 사원의 입사일이 포함되지 않는 기간으로 검색하여 검색되지 않음을 확인",
|
|
"action": "evaluate",
|
|
"script": "(async () => { const startInput = document.querySelector(\"input[placeholder*='시작'], input[name*='startDate'], input[type='date']:first-of-type\"); if (startInput) { startInput.click(); await new Promise(r => setTimeout(r, 200)); } const endInput = document.querySelector(\"input[placeholder*='종료'], input[name*='endDate'], input[type='date']:last-of-type\"); if (endInput) { endInput.click(); await new Promise(r => setTimeout(r, 200)); } const searchBtn = Array.from(document.querySelectorAll('button')).find(b => b.innerText?.includes('검색')); if (searchBtn) searchBtn.click(); await new Promise(r => setTimeout(r, 1000)); return !document.body.innerText.includes('E2E_TEST_사원') ? 'PASS: Not found (expected)' : 'WARN: Still found in out-of-range period'; })()",
|
|
"onFail": {
|
|
"record": true,
|
|
"message": "검색 기간 2025-01-01 ~ 2025-12-31 범위 외 입사일(2026-01-14) 사원이 검색됨 - 기간 필터 미작동",
|
|
"severity": "HIGH",
|
|
"bugType": "검색 기간 필터링 미작동"
|
|
}
|
|
},
|
|
{
|
|
"id": 14,
|
|
"name": "검색 기간 초기화 및 전체 조회",
|
|
"description": "검색 조건 초기화하여 등록된 사원이 다시 표시되는지 확인",
|
|
"action": "evaluate",
|
|
"script": "(async () => { const resetBtn = Array.from(document.querySelectorAll('button')).find(b => b.innerText?.includes('초기화') || b.innerText?.includes('Reset')); if (resetBtn) { resetBtn.click(); await new Promise(r => setTimeout(r, 500)); } const searchBtn = Array.from(document.querySelectorAll('button')).find(b => b.innerText?.includes('검색')); if (searchBtn) { searchBtn.click(); await new Promise(r => setTimeout(r, 1000)); } return document.body.innerText.includes('E2E_TEST_사원') ? 'PASS: Found after reset' : 'WARN: Not found after reset'; })()",
|
|
"onFail": {
|
|
"record": true,
|
|
"message": "검색 초기화 후 전체 조회에서 등록된 사원이 표시되지 않음",
|
|
"severity": "MEDIUM",
|
|
"bugType": "검색 초기화 오류"
|
|
}
|
|
},
|
|
{
|
|
"id": 15,
|
|
"name": "등록된 직원 상세 페이지 이동",
|
|
"description": "등록된 직원을 클릭하여 상세 페이지로 이동 (검색 시도 포함)",
|
|
"action": "evaluate",
|
|
"script": "(async () => { const w = ms => new Promise(r => setTimeout(r, ms)); const findRow = () => { const rows = Array.from(document.querySelectorAll('table tbody tr, [class*=table] [class*=row], tr')).filter(r => r.offsetParent !== null); return rows.find(r => r.innerText?.includes('E2E_TEST_사원')); }; let targetRow = findRow(); if (!targetRow) { const searchBtn = Array.from(document.querySelectorAll('button')).find(b => b.innerText?.includes('검색')); if (searchBtn) { searchBtn.click(); await w(2000); } targetRow = findRow(); } if (!targetRow) { for (let i = 0; i < 5; i++) { await w(2000); targetRow = findRow(); if (targetRow) break; } } if (targetRow) { targetRow.click(); await w(2000); return JSON.stringify({ok:true, info:'직원 행 클릭 완료'}); } const pageText = document.body.innerText.substring(0, 500); return JSON.stringify({ok:false, warn:'E2E_TEST_사원 행 미발견', pageSnippet: pageText}); })()"
|
|
},
|
|
{
|
|
"id": 16,
|
|
"name": "직원 수정 모드 전환",
|
|
"description": "수정 버튼 클릭하여 편집 모드로 전환",
|
|
"action": "click_if_exists",
|
|
"target": "수정"
|
|
},
|
|
{
|
|
"id": 17,
|
|
"name": "직원 정보 수정",
|
|
"description": "휴대폰 번호 변경",
|
|
"action": "fill_form",
|
|
"fields": [
|
|
{
|
|
"name": "휴대폰",
|
|
"type": "text",
|
|
"value": "010-9999-8888",
|
|
"clear": true
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": 18,
|
|
"name": "수정 저장",
|
|
"description": "수정된 직원 정보 저장",
|
|
"action": "click_if_exists",
|
|
"target": "저장"
|
|
},
|
|
{
|
|
"id": 19,
|
|
"name": "필수 검증: 수정 데이터 반영 확인",
|
|
"note": "토스트 성공 메시지만으로 PASS 판정 불가. 실제 데이터 변경 확인 필수!",
|
|
"description": "상세 페이지에서 수정된 휴대폰 번호 확인",
|
|
"action": "verify_detail",
|
|
"checks": [
|
|
"휴대폰: 010-9999-8888"
|
|
]
|
|
},
|
|
{
|
|
"id": 20,
|
|
"name": "직원 삭제 및 확인",
|
|
"description": "window.confirm 오버라이드 후 삭제 버튼 클릭, DOM 다이얼로그도 처리",
|
|
"action": "evaluate",
|
|
"script": "(async () => { const w = ms => new Promise(r => setTimeout(r, ms)); let nativeConfirmCalled = false; const origConfirm = window.confirm; window.confirm = () => { nativeConfirmCalled = true; return true; }; const origAlert = window.alert; window.alert = () => true; try { const delBtn = Array.from(document.querySelectorAll('button')).find(b => b.innerText?.trim() === '삭제' || b.innerText?.includes('삭제')); if (!delBtn) { window.confirm = origConfirm; window.alert = origAlert; return JSON.stringify({ok:false, error:'삭제 버튼 미발견'}); } delBtn.click(); await w(1000); if (nativeConfirmCalled) { window.confirm = origConfirm; window.alert = origAlert; await w(2000); return JSON.stringify({ok:true, info:'삭제 완료 (native confirm 자동 승인)'}); } for (let i = 0; i < 10; i++) { const dialog = document.querySelector('[role=\"alertdialog\"], [role=\"dialog\"], [class*=\"modal\"]:not([class*=\"tooltip\"]), [class*=\"Modal\"], [class*=\"Dialog\"]'); if (dialog && dialog.offsetParent !== null) { const confirmBtn = Array.from(dialog.querySelectorAll('button')).find(b => ['확인', '예', '삭제', 'OK', 'Yes', 'Delete'].some(t => b.innerText?.trim().includes(t))); if (confirmBtn) { confirmBtn.click(); await w(1000); window.confirm = origConfirm; window.alert = origAlert; return JSON.stringify({ok:true, info:'삭제 완료 (DOM 다이얼로그 확인)'}); } } await w(500); } window.confirm = origConfirm; window.alert = origAlert; return JSON.stringify({ok:true, warn:'삭제 버튼 클릭됨, 다이얼로그 미발견 (직접 삭제 가능성)'}); } catch(e) { window.confirm = origConfirm; window.alert = origAlert; return JSON.stringify({ok:false, error:e.message}); } })()"
|
|
},
|
|
{
|
|
"id": 21,
|
|
"name": "필수 검증: 삭제 데이터 반영 확인",
|
|
"note": "토스트 성공 메시지만으로 PASS 판정 불가. 실제 데이터 삭제 확인 필수!",
|
|
"description": "목록에서 삭제된 직원이 없어졌는지 확인",
|
|
"action": "verify_element",
|
|
"target": "body",
|
|
"verify": {
|
|
"tableNotContains": "E2E_TEST_사원"
|
|
}
|
|
},
|
|
{
|
|
"id": 22,
|
|
"name": "콘솔 에러 확인",
|
|
"action": "verify_element",
|
|
"target": "body"
|
|
}
|
|
],
|
|
"assertions": [
|
|
{
|
|
"type": "url",
|
|
"expected": "/hr/employee-management",
|
|
"message": "등록 후 직원 목록 페이지로 이동해야 함"
|
|
},
|
|
{
|
|
"type": "text",
|
|
"target": "body",
|
|
"expected": "E2E_TEST_사원",
|
|
"message": "등록된 직원이 목록에 표시되어야 함"
|
|
}
|
|
]
|
|
} |