120 lines
5.9 KiB
JSON
120 lines
5.9 KiB
JSON
{
|
|
"id": "workflow-inventory-cycle",
|
|
"name": "비즈니스 워크플로우: 품목→입고→재고→출고 흐름",
|
|
"version": "1.1.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": "[생산 > 품목관리] 페이지 로드 확인",
|
|
"action": "wait_for_element",
|
|
"target": "text=품목기준관리",
|
|
"timeout": 10000
|
|
},
|
|
{
|
|
"id": 3,
|
|
"name": "[생산 > 품목관리] CAPTURE_ITEM",
|
|
"action": "evaluate",
|
|
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const R={phase:'CAPTURE_ITEM'};await w(1500);const pageText=document.body.innerText||'';const hasTitle=pageText.includes('품목기준관리');R.pageLoaded=hasTitle;const categories=['소모품','원자재','부자재','부품','제품'];const found=categories.filter(c=>pageText.includes(c+' 등록'));R.foundCategories=found;if(found.length===0){R.warn='품목 카테고리 없음';R.ok=true;return JSON.stringify(R);}const name=found[0]+' 등록';R.itemName=name;if(!window.__WORKFLOW_CTX__)window.__WORKFLOW_CTX__={};window.__WORKFLOW_CTX__.itemName=found[0];R.ok=true;R.info='캡처: '+name+' ('+found.length+'개 카테고리)';return JSON.stringify(R);})()",
|
|
"phase": "CAPTURE_ITEM"
|
|
},
|
|
{
|
|
"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": "[자재관리 > 입고관리] VERIFY_ITEM_RECEIVING",
|
|
"action": "evaluate",
|
|
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const R={phase:'VERIFY_ITEM_RECEIVING'};await w(2000);const val=window.__WORKFLOW_CTX__?.itemName;if(!val){R.warn='컨텍스트에 itemName 없음';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_ITEM_RECEIVING"
|
|
},
|
|
{
|
|
"id": 8,
|
|
"name": "[자재관리 > 재고현황] 메뉴 이동",
|
|
"action": "menu_navigate",
|
|
"level1": "자재관리",
|
|
"level2": "재고현황",
|
|
"timeout": 10000
|
|
},
|
|
{
|
|
"id": 9,
|
|
"name": "[자재관리 > 재고현황] wait",
|
|
"action": "wait",
|
|
"timeout": 3000
|
|
},
|
|
{
|
|
"id": 10,
|
|
"name": "[자재관리 > 재고현황] wait_for_table",
|
|
"action": "wait_for_table",
|
|
"timeout": 5000
|
|
},
|
|
{
|
|
"id": 11,
|
|
"name": "[자재관리 > 재고현황] VERIFY_ITEM_STOCK",
|
|
"action": "evaluate",
|
|
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const R={phase:'VERIFY_ITEM_STOCK'};await w(2000);const val=window.__WORKFLOW_CTX__?.itemName;if(!val){R.warn='컨텍스트에 itemName 없음';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_ITEM_STOCK"
|
|
},
|
|
{
|
|
"id": 12,
|
|
"name": "[회계 > 출금관리] 메뉴 이동",
|
|
"action": "menu_navigate",
|
|
"level1": "회계관리",
|
|
"level2": "출금관리",
|
|
"timeout": 10000
|
|
},
|
|
{
|
|
"id": 13,
|
|
"name": "[회계 > 출금관리] wait",
|
|
"action": "wait",
|
|
"timeout": 3000
|
|
},
|
|
{
|
|
"id": 14,
|
|
"name": "[회계 > 출금관리] wait_for_table",
|
|
"action": "wait_for_table",
|
|
"timeout": 5000
|
|
},
|
|
{
|
|
"id": 15,
|
|
"name": "[회계 > 출금관리] CHECK_WITHDRAWAL",
|
|
"action": "evaluate",
|
|
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const R={phase:'CHECK_WITHDRAWAL'};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_WITHDRAWAL"
|
|
}
|
|
]
|
|
} |