113 lines
5.8 KiB
JSON
113 lines
5.8 KiB
JSON
|
|
{
|
||
|
|
"id": "workflow-employee-onboarding",
|
||
|
|
"name": "비즈니스 워크플로우: 사원등록→부서→근태→급여 흐름",
|
||
|
|
"version": "1.0.0",
|
||
|
|
"category": "workflow",
|
||
|
|
"auth": {
|
||
|
|
"role": "admin"
|
||
|
|
},
|
||
|
|
"menuNavigation": {
|
||
|
|
"level1": "인사관리",
|
||
|
|
"level2": "사원관리"
|
||
|
|
},
|
||
|
|
"screenshotPolicy": {
|
||
|
|
"captureOnFail": true,
|
||
|
|
"captureOnPass": false
|
||
|
|
},
|
||
|
|
"steps": [
|
||
|
|
{
|
||
|
|
"id": 1,
|
||
|
|
"name": "[인사 > 사원관리] wait",
|
||
|
|
"action": "wait",
|
||
|
|
"timeout": 3000
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"id": 2,
|
||
|
|
"name": "[인사 > 사원관리] wait_for_table",
|
||
|
|
"action": "wait_for_table",
|
||
|
|
"timeout": 5000
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"id": 3,
|
||
|
|
"name": "[인사 > 사원관리] CAPTURE_EMPLOYEE",
|
||
|
|
"action": "evaluate",
|
||
|
|
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const R={phase:'CAPTURE_EMPLOYEE'};await w(1500);const rows=Array.from(document.querySelectorAll('table tbody tr')).filter(r=>r.offsetParent!==null);R.rowCount=rows.length;if(rows.length===0){R.warn='테이블에 데이터 없음';R.ok=true;return JSON.stringify(R);}const cells=rows[0].querySelectorAll('td');let val='';const indices=[1,2,3];for(const i of indices){ const t=cells[i]?.innerText?.trim(); if(t&&t.length>=2&&t.length<=40&&!/^[\\d,.]+$/.test(t)&&!/^\\d{4}[-/]/.test(t)){val=t;break;}}R.employeeName=val;if(!val){R.warn='employeeName 추출 실패';R.ok=true;return JSON.stringify(R);}if(!window.__WORKFLOW_CTX__)window.__WORKFLOW_CTX__={};window.__WORKFLOW_CTX__.employeeName=val;R.ok=true;R.info='캐처: '+val;return JSON.stringify(R);})()",
|
||
|
|
"phase": "CAPTURE_EMPLOYEE"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"id": 4,
|
||
|
|
"name": "[인사 > 부서관리] 메뉴 이동",
|
||
|
|
"action": "menu_navigate",
|
||
|
|
"level1": "인사관리",
|
||
|
|
"level2": "부서관리",
|
||
|
|
"timeout": 10000
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"id": 5,
|
||
|
|
"name": "[인사 > 부서관리] wait",
|
||
|
|
"action": "wait",
|
||
|
|
"timeout": 3000
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"id": 6,
|
||
|
|
"name": "[인사 > 부서관리] wait_for_table",
|
||
|
|
"action": "wait_for_table",
|
||
|
|
"timeout": 5000
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"id": 7,
|
||
|
|
"name": "[인사 > 부서관리] CHECK_DEPARTMENTS",
|
||
|
|
"action": "evaluate",
|
||
|
|
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const R={phase:'CHECK_DEPARTMENTS'};await w(1500);const rows=Array.from(document.querySelectorAll('table tbody tr')).filter(r=>r.offsetParent!==null);R.rowCount=rows.length;R.ok=true;R.info='테이블 행: '+rows.length;return JSON.stringify(R);})()",
|
||
|
|
"phase": "CHECK_DEPARTMENTS"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"id": 8,
|
||
|
|
"name": "[인사 > 근태관리] 메뉴 이동",
|
||
|
|
"action": "menu_navigate",
|
||
|
|
"level1": "인사관리",
|
||
|
|
"level2": "근태관리",
|
||
|
|
"timeout": 10000
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"id": 9,
|
||
|
|
"name": "[인사 > 근태관리] wait",
|
||
|
|
"action": "wait",
|
||
|
|
"timeout": 3000
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"id": 10,
|
||
|
|
"name": "[인사 > 근태관리] VERIFY_EMPLOYEE_ATTEND",
|
||
|
|
"action": "evaluate",
|
||
|
|
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const R={phase:'VERIFY_EMPLOYEE_ATTEND'};await w(2000);const val=window.__WORKFLOW_CTX__?.employeeName;if(!val){R.warn='컨텍스트에 employeeName 없음';R.ok=true;return JSON.stringify(R);}R.searchTarget=val;const si=document.querySelector('input[placeholder*=\"검색\"]')||document.querySelector('input[type=\"search\"]');if(si){ si.focus();await w(200); const ns=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,'value')?.set; if(ns)ns.call(si,val);else si.value=val; si.dispatchEvent(new Event('input',{bubbles:true})); si.dispatchEvent(new Event('change',{bubbles:true})); await w(2500);}const found=document.body.innerText.includes(val);R.found=found;if(found){R.info='✅ 근태관리에서 ['+val+'] 확인';R.ok=true;}else{R.warn='⚠️ 근태관리에서 ['+val+'] 미발견';R.ok=true;}if(si){ const ns2=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,'value')?.set; if(ns2)ns2.call(si,'');else si.value=''; si.dispatchEvent(new Event('input',{bubbles:true}));await w(1000);}return JSON.stringify(R);})()",
|
||
|
|
"phase": "VERIFY_EMPLOYEE_ATTEND"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"id": 11,
|
||
|
|
"name": "[인사 > 급여관리] 메뉴 이동",
|
||
|
|
"action": "menu_navigate",
|
||
|
|
"level1": "인사관리",
|
||
|
|
"level2": "급여관리",
|
||
|
|
"timeout": 10000
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"id": 12,
|
||
|
|
"name": "[인사 > 급여관리] wait",
|
||
|
|
"action": "wait",
|
||
|
|
"timeout": 3000
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"id": 13,
|
||
|
|
"name": "[인사 > 급여관리] wait_for_table",
|
||
|
|
"action": "wait_for_table",
|
||
|
|
"timeout": 5000
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"id": 14,
|
||
|
|
"name": "[인사 > 급여관리] VERIFY_EMPLOYEE_SALARY",
|
||
|
|
"action": "evaluate",
|
||
|
|
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const R={phase:'VERIFY_EMPLOYEE_SALARY'};await w(2000);const val=window.__WORKFLOW_CTX__?.employeeName;if(!val){R.warn='컨텍스트에 employeeName 없음';R.ok=true;return JSON.stringify(R);}R.searchTarget=val;const si=document.querySelector('input[placeholder*=\"검색\"]')||document.querySelector('input[type=\"search\"]');if(si){ si.focus();await w(200); const ns=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,'value')?.set; if(ns)ns.call(si,val);else si.value=val; si.dispatchEvent(new Event('input',{bubbles:true})); si.dispatchEvent(new Event('change',{bubbles:true})); await w(2500);}const found=document.body.innerText.includes(val);R.found=found;if(found){R.info='✅ 급여관리에서 ['+val+'] 확인';R.ok=true;}else{R.warn='⚠️ 급여관리에서 ['+val+'] 미발견';R.ok=true;}if(si){ const ns2=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,'value')?.set; if(ns2)ns2.call(si,'');else si.value=''; si.dispatchEvent(new Event('input',{bubbles:true}));await w(1000);}return JSON.stringify(R);})()",
|
||
|
|
"phase": "VERIFY_EMPLOYEE_SALARY"
|
||
|
|
}
|
||
|
|
]
|
||
|
|
}
|