Files
sam-scenarios/cross-module-data-consistency.json
김보곤 158fc30eae feat: Phase 3 정교한 테스트 시나리오 (detail-roundtrip, cross-module, api-health)
- detail-roundtrip: 목록→행클릭→상세페이지→데이터검증→목록복귀→무결성확인 (3그룹, 8페이지)
- cross-module: 판매↔회계 거래처, 판매↔생산 품목 교차 데이터 일관성 검증
- api-health: 28개 주요 페이지 API 상태코드/응답시간/에러율 전수 감사 (3그룹)
- 전체 7/7 PASS 확인
2026-02-12 13:28:38 +09:00

122 lines
8.3 KiB
JSON

{
"id": "cross-module-data-consistency",
"name": "모듈 간 데이터 일관성 검증 (판매↔회계, 판매↔생산)",
"version": "1.0.0",
"auth": {
"role": "admin"
},
"menuNavigation": {
"level1": "판매관리",
"level2": "거래처관리"
},
"screenshotPolicy": {
"captureOnFail": true,
"captureOnPass": false
},
"steps": [
{
"id": 1,
"name": "[판매 > 거래처관리] 페이지 로드 대기",
"action": "wait",
"timeout": 3000
},
{
"id": 2,
"name": "[판매 > 거래처관리] 테이블 로드 대기",
"action": "wait_for_table",
"timeout": 5000
},
{
"id": 3,
"name": "[판매 > 거래처관리] 거래처명 캡처",
"action": "evaluate",
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const R={phase:'CAPTURE_VENDOR'};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 vendorName='';for(let i=1;i<cells.length&&i<6;i++){ const t=cells[i]?.innerText?.trim(); if(t&&t.length>=2&&t.length<=30&&!/^[\\d,.]+$/.test(t)&&!/^\\d{4}[-/]/.test(t)&&!cells[i].querySelector('input[type=\"checkbox\"]')){ vendorName=t;break; }}R.vendorName=vendorName;if(!vendorName){R.warn='거래처명 추출 실패';R.ok=true;return JSON.stringify(R);}if(!window.__CROSS_DATA__)window.__CROSS_DATA__={};window.__CROSS_DATA__.vendorName=vendorName;R.ok=true;return JSON.stringify(R);})()",
"timeout": 10000,
"phase": "CAPTURE_VENDOR"
},
{
"id": 4,
"name": "[회계 > 거래처관리] 메뉴 이동",
"action": "menu_navigate",
"level1": "회계관리",
"level2": "거래처관리",
"timeout": 10000
},
{
"id": 5,
"name": "[회계 > 거래처관리] 페이지 로드 대기",
"action": "wait",
"timeout": 3000
},
{
"id": 6,
"name": "[회계 > 거래처관리] 테이블 로드 대기",
"action": "wait_for_table",
"timeout": 5000
},
{
"id": 7,
"name": "[회계 > 거래처관리] 거래처 존재 확인",
"action": "evaluate",
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const R={phase:'VERIFY_VENDOR_ACC'};await w(2000);const vendorName=window.__CROSS_DATA__?.vendorName;if(!vendorName){R.warn='캡처된 거래처명 없음 (이전 단계 실패)';R.ok=true;return JSON.stringify(R);}R.searchTarget=vendorName;const searchInput=document.querySelector('input[placeholder*=\"검색\"]')||document.querySelector('input[type=\"search\"]')||document.querySelector('input[role=\"searchbox\"]');if(searchInput){ searchInput.focus();await w(200); const nativeSetter=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,'value')?.set; if(nativeSetter)nativeSetter.call(searchInput,vendorName);else searchInput.value=vendorName; searchInput.dispatchEvent(new Event('input',{bubbles:true})); searchInput.dispatchEvent(new Event('change',{bubbles:true})); searchInput.dispatchEvent(new KeyboardEvent('keydown',{key:'Enter',code:'Enter',keyCode:13,bubbles:true})); await w(2500); R.searchUsed=true;}else{R.searchUsed=false;}const rows=Array.from(document.querySelectorAll('table tbody tr')).filter(r=>r.offsetParent!==null);R.rowCount=rows.length;const found=rows.some(r=>r.innerText?.includes(vendorName));R.vendorFound=found;if(!found&&!searchInput){ R.vendorFoundInPage=document.body.innerText.includes(vendorName);}if(!found){R.warn='⚠️ 회계>거래처관리에서 ['+vendorName+'] 미발견 - 모듈 간 데이터 불일치 가능';R.ok=true;}else{R.info='✅ 판매/회계 거래처 데이터 일치 확인: '+vendorName;R.ok=true;}if(searchInput){ const ns=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,'value')?.set; if(ns)ns.call(searchInput,'');else searchInput.value=''; searchInput.dispatchEvent(new Event('input',{bubbles:true})); searchInput.dispatchEvent(new Event('change',{bubbles:true})); searchInput.dispatchEvent(new KeyboardEvent('keydown',{key:'Enter',code:'Enter',keyCode:13,bubbles:true})); await w(1500);}return JSON.stringify(R);})()",
"timeout": 15000,
"phase": "VERIFY_VENDOR_ACC"
},
{
"id": 8,
"name": "[판매 > 단가관리] 메뉴 이동",
"action": "menu_navigate",
"level1": "판매관리",
"level2": "단가관리",
"timeout": 10000
},
{
"id": 9,
"name": "[판매 > 단가관리] 페이지 로드 대기",
"action": "wait",
"timeout": 3000
},
{
"id": 10,
"name": "[판매 > 단가관리] 테이블 로드 대기",
"action": "wait_for_table",
"timeout": 5000
},
{
"id": 11,
"name": "[판매 > 단가관리] 품목명 캡처",
"action": "evaluate",
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const R={phase:'CAPTURE_ITEM'};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 itemName='';for(let i=1;i<cells.length&&i<6;i++){ const t=cells[i]?.innerText?.trim(); if(t&&t.length>=2&&t.length<=30&&!/^[\\d,.]+$/.test(t)&&!/^\\d{4}[-/]/.test(t)&&!cells[i].querySelector('input[type=\"checkbox\"]')){ itemName=t;break; }}R.itemName=itemName;if(!itemName){R.warn='품목명 추출 실패';R.ok=true;return JSON.stringify(R);}if(!window.__CROSS_DATA__)window.__CROSS_DATA__={};window.__CROSS_DATA__.itemName=itemName;R.ok=true;return JSON.stringify(R);})()",
"timeout": 10000,
"phase": "CAPTURE_ITEM"
},
{
"id": 12,
"name": "[생산 > 품목관리] 메뉴 이동",
"action": "menu_navigate",
"level1": "생산관리",
"level2": "품목관리",
"timeout": 10000
},
{
"id": 13,
"name": "[생산 > 품목관리] 페이지 로드 대기",
"action": "wait",
"timeout": 3000
},
{
"id": 14,
"name": "[생산 > 품목관리] 테이블 로드 대기",
"action": "wait_for_table",
"timeout": 5000
},
{
"id": 15,
"name": "[생산 > 품목관리] 품목 존재 확인",
"action": "evaluate",
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const R={phase:'VERIFY_ITEM_PROD'};await w(2000);const itemName=window.__CROSS_DATA__?.itemName;if(!itemName){R.warn='캡처된 품목명 없음 (이전 단계 실패)';R.ok=true;return JSON.stringify(R);}R.searchTarget=itemName;const searchInput=document.querySelector('input[placeholder*=\"검색\"]')||document.querySelector('input[type=\"search\"]')||document.querySelector('input[role=\"searchbox\"]');if(searchInput){ searchInput.focus();await w(200); const nativeSetter=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,'value')?.set; if(nativeSetter)nativeSetter.call(searchInput,itemName);else searchInput.value=itemName; searchInput.dispatchEvent(new Event('input',{bubbles:true})); searchInput.dispatchEvent(new Event('change',{bubbles:true})); searchInput.dispatchEvent(new KeyboardEvent('keydown',{key:'Enter',code:'Enter',keyCode:13,bubbles:true})); await w(2500); R.searchUsed=true;}else{R.searchUsed=false;}const rows=Array.from(document.querySelectorAll('table tbody tr')).filter(r=>r.offsetParent!==null);R.rowCount=rows.length;const found=rows.some(r=>r.innerText?.includes(itemName));R.itemFound=found;if(!found){R.warn='⚠️ 생산>품목관리에서 ['+itemName+'] 미발견 - 모듈 간 데이터 불일치 가능';R.ok=true;}else{R.info='✅ 판매/생산 품목 데이터 일치 확인: '+itemName;R.ok=true;}if(searchInput){ const ns=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,'value')?.set; if(ns)ns.call(searchInput,'');else searchInput.value=''; searchInput.dispatchEvent(new Event('input',{bubbles:true})); searchInput.dispatchEvent(new Event('change',{bubbles:true})); searchInput.dispatchEvent(new KeyboardEvent('keydown',{key:'Enter',code:'Enter',keyCode:13,bubbles:true})); await w(1500);}return JSON.stringify(R);})()",
"timeout": 15000,
"phase": "VERIFY_ITEM_PROD"
}
]
}