Files
sam-scenarios/cross-module-data-consistency.json
김보곤 21b272702d refactor: 44개 시나리오 품질 개선 (false positive 제거 + flaky 수정 + E2E_TEST_ 표준화)
Phase 1 - False Positive 제거 (36개):
- R.ok=true 무조건 반환 → 조건부 검증으로 교체
- 영향: edge-*, form-validation-*, pagination-sort-*, search-*, reload-persist-*,
  batch-create-*, detail-roundtrip-*, workflow-*, cross-module-*

Phase 2 - Flaky rows[0] 패턴 수정 (7개):
- detail-verify-acc-sales.json: CAPTURE/READ 스텝 E2E_TEST_ 타겟팅
- vendor-management.json: 행 클릭 E2E_TEST_ 타겟팅
- batch-update-account-sales.json: CAPTURE/SELECT/VERIFY/RESTORE 스텝
- sales-management.json: DELETE fallback 경고 로깅

Phase 3 - E2E_TEST_ 접두사 표준화 (1개):
- employee-register.json: 홍길동→E2E_TEST_사원, EMP2026001→E2E_TEST_EMP001

테스트 결과: 175 PASS / 9 FAIL (숨겨진 실제 버그 5건 노출)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 21:55:15 +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=false;}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=false;}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"
}
]
}