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>
This commit is contained in:
김보곤
2026-02-19 21:55:15 +09:00
parent 1e60fa41a4
commit 21b272702d
44 changed files with 170 additions and 243 deletions

View File

@@ -140,7 +140,7 @@
"id": 19,
"name": "[회계관리 > 입금관리] [DELETE #1] 데이터 삭제",
"action": "evaluate",
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const sv=(el,v)=>{const p=el.tagName==='TEXTAREA'?HTMLTextAreaElement.prototype:HTMLInputElement.prototype;const ns=Object.getOwnPropertyDescriptor(p,'value')?.set;if(ns)ns.call(el,v);else el.value=v;el.dispatchEvent(new Event('input',{bubbles:true}));el.dispatchEvent(new Event('change',{bubbles:true}));};const ts=window.__E2E_TS__||sessionStorage.getItem('__E2E_TS__')||(()=>{const n=new Date();const p=v=>v.toString().padStart(2,'0');return n.getFullYear()+p(n.getMonth()+1)+p(n.getDate())+'_'+p(n.getHours())+p(n.getMinutes())+p(n.getSeconds());})();window.__E2E_TS__=ts;try{sessionStorage.setItem('__E2E_TS__',ts);}catch(e){}const R={phase:'DELETE_1'};const rows=Array.from(document.querySelectorAll('table tbody tr'));const targetRow=rows.find(r=>r.innerText?.includes('E2E_TEST_')&&r.innerText?.includes(ts))||rows.find(r=>r.innerText?.includes('E2E_TEST_입금'));if(!targetRow){R.error='E2E_TEST_ 데이터 없음 (ts='+ts+')';R.ok=false;return JSON.stringify(R);}R.targetText=targetRow.innerText?.substring(0,60);targetRow.click();await w(2500);const delBtn=Array.from(document.querySelectorAll('button')).find(b=>b.innerText?.trim()==='삭제');if(!delBtn){R.error='삭제 버튼 없음';R.ok=false;return JSON.stringify(R);}delBtn.click();await w(1000);const confirmBtn=Array.from(document.querySelectorAll('[role=\"alertdialog\"] button,[role=\"dialog\"] button,button')).find(b=>/확인|삭제|예|Yes/.test(b.innerText?.trim())&&b!==delBtn&&b.offsetParent!==null);if(confirmBtn){confirmBtn.click();await w(3000);}R.urlAfter=location.pathname+location.search;R.ok=true;return JSON.stringify(R);})()",
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const sv=(el,v)=>{const p=el.tagName==='TEXTAREA'?HTMLTextAreaElement.prototype:HTMLInputElement.prototype;const ns=Object.getOwnPropertyDescriptor(p,'value')?.set;if(ns)ns.call(el,v);else el.value=v;el.dispatchEvent(new Event('input',{bubbles:true}));el.dispatchEvent(new Event('change',{bubbles:true}));};const ts=window.__E2E_TS__||sessionStorage.getItem('__E2E_TS__')||(()=>{const n=new Date();const p=v=>v.toString().padStart(2,'0');return n.getFullYear()+p(n.getMonth()+1)+p(n.getDate())+'_'+p(n.getHours())+p(n.getMinutes())+p(n.getSeconds());})();window.__E2E_TS__=ts;try{sessionStorage.setItem('__E2E_TS__',ts);}catch(e){}const R={phase:'DELETE_1'};const rows=Array.from(document.querySelectorAll('table tbody tr'));const targetRow=rows.find(r=>r.innerText?.includes('E2E_TEST_')&&r.innerText?.includes(ts))||rows.find(r=>r.innerText?.includes('E2E_TEST_입금'));if(!targetRow){R.error='E2E_TEST_ 데이터 없음 (ts='+ts+')';R.ok=false;return JSON.stringify(R);}R.targetText=targetRow.innerText?.substring(0,60);targetRow.click();await w(2500);const delBtn=Array.from(document.querySelectorAll('button')).find(b=>b.innerText?.trim()==='삭제');if(!delBtn){R.error='삭제 버튼 없음';R.ok=false;return JSON.stringify(R);}delBtn.click();await w(1000);const confirmBtn=Array.from(document.querySelectorAll('[role=\"alertdialog\"] button,[role=\"dialog\"] button,button')).find(b=>/확인|삭제|예|Yes/.test(b.innerText?.trim())&&b!==delBtn&&b.offsetParent!==null);if(confirmBtn){confirmBtn.click();await w(3000);}R.urlAfter=location.pathname+location.search;R.deleted=!document.body.innerText?.includes(R.targetText?.substring(0,20));R.ok=R.deleted!==false;return JSON.stringify(R);})()",
"timeout": 30000,
"phase": "DELETE",
"critical": true
@@ -165,30 +165,12 @@
"action": "wait",
"timeout": 1500
},
{
"id": 100,
"name": "[회계관리 > 입금관리] [DELETE #2] 전 입금관리 복귀",
"action": "navigate",
"target": "/accounting/deposits"
},
{
"id": 101,
"name": "[회계관리 > 입금관리] [DELETE #2] 전 테이블 대기",
"action": "wait_for_table",
"timeout": 10000
},
{
"id": 110,
"name": "[회계관리 > 입금관리] [DELETE #2] 전 안정화 대기",
"action": "wait",
"duration": 2000
},
{
"id": 23,
"name": "[회계관리 > 입금관리] [DELETE #2] 데이터 삭제",
"action": "evaluate",
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const ts=window.__E2E_TS__||sessionStorage.getItem('__E2E_TS__')||'';const R={phase:'DELETE_2',ts};const findRow=()=>{const rows=Array.from(document.querySelectorAll('table tbody tr'));return rows.find(r=>r.innerText?.includes('E2E_TEST_입금'))||rows.find(r=>r.innerText?.includes('E2E_TEST_'));};let targetRow=findRow();R.attempt1=!!targetRow;R.rowCount1=document.querySelectorAll('table tbody tr').length;if(!targetRow){R.pagination=true;const allBtns=Array.from(document.querySelectorAll('nav button,[class*=\"pagination\"] button,[class*=\"Pagination\"] button'));const pageBtns=allBtns.filter(b=>/^[0-9]+$/.test(b.innerText?.trim()));R.pageBtnCount=pageBtns.length;for(const btn of pageBtns){const txt=btn.innerText?.trim();if(txt==='1')continue;btn.click();await w(2000);targetRow=findRow();if(targetRow){R.foundOnPage=txt;break;}}if(!targetRow){const nextBtns=[...document.querySelectorAll('button[aria-label*=\"다음\"],button[aria-label*=\"Next\"],button[aria-label*=\"next\"]'),...allBtns.filter(b=>/^[>›»]$/.test(b.innerText?.trim()))];R.nextBtnCount=nextBtns.length;for(let pg=0;pg<5&&!targetRow;pg++){const nb=nextBtns.find(b=>!b.disabled&&b.offsetParent!==null);if(!nb)break;nb.click();await w(2000);targetRow=findRow();if(targetRow){R.foundViaNext=pg+1;break;}}}}if(!targetRow){R.url=location.href;R.rowCount=document.querySelectorAll('table tbody tr').length;R.row0=document.querySelector('table tbody tr')?.innerText?.substring(0,80);R.bodyHasE2E=document.body.innerText.includes('E2E_TEST_');R.error='E2E_TEST_ 없음 rows='+R.rowCount+' pg='+R.pageBtnCount+' next='+R.nextBtnCount+' body='+R.bodyHasE2E+' url='+location.pathname;R.ok=false;return JSON.stringify(R);}R.targetText=targetRow.innerText?.substring(0,60);targetRow.click();await w(2500);const delBtn=Array.from(document.querySelectorAll('button')).find(b=>b.innerText?.trim()==='삭제');if(!delBtn){R.error='삭제 버튼 없음';R.ok=false;return JSON.stringify(R);}delBtn.click();await w(1000);const confirmBtn=Array.from(document.querySelectorAll('[role=\"alertdialog\"] button,[role=\"dialog\"] button,button')).find(b=>/확인|삭제|예|Yes/.test(b.innerText?.trim())&&b!==delBtn&&b.offsetParent!==null);if(confirmBtn){confirmBtn.click();await w(3000);}R.urlAfter=location.pathname+location.search;R.ok=true;return JSON.stringify(R);})()",
"timeout": 45000,
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const sv=(el,v)=>{const p=el.tagName==='TEXTAREA'?HTMLTextAreaElement.prototype:HTMLInputElement.prototype;const ns=Object.getOwnPropertyDescriptor(p,'value')?.set;if(ns)ns.call(el,v);else el.value=v;el.dispatchEvent(new Event('input',{bubbles:true}));el.dispatchEvent(new Event('change',{bubbles:true}));};const ts=window.__E2E_TS__||sessionStorage.getItem('__E2E_TS__')||(()=>{const n=new Date();const p=v=>v.toString().padStart(2,'0');return n.getFullYear()+p(n.getMonth()+1)+p(n.getDate())+'_'+p(n.getHours())+p(n.getMinutes())+p(n.getSeconds());})();window.__E2E_TS__=ts;try{sessionStorage.setItem('__E2E_TS__',ts);}catch(e){}const R={phase:'DELETE_2'};const rows=Array.from(document.querySelectorAll('table tbody tr'));const targetRow=rows.find(r=>r.innerText?.includes('E2E_TEST_')&&r.innerText?.includes(ts))||rows.find(r=>r.innerText?.includes('E2E_TEST_입금'));if(!targetRow){R.error='E2E_TEST_ 데이터 없음 (ts='+ts+')';R.ok=false;return JSON.stringify(R);}R.targetText=targetRow.innerText?.substring(0,60);targetRow.click();await w(2500);const delBtn=Array.from(document.querySelectorAll('button')).find(b=>b.innerText?.trim()==='삭제');if(!delBtn){R.error='삭제 버튼 없음';R.ok=false;return JSON.stringify(R);}delBtn.click();await w(1000);const confirmBtn=Array.from(document.querySelectorAll('[role=\"alertdialog\"] button,[role=\"dialog\"] button,button')).find(b=>/확인|삭제|예|Yes/.test(b.innerText?.trim())&&b!==delBtn&&b.offsetParent!==null);if(confirmBtn){confirmBtn.click();await w(3000);}R.urlAfter=location.pathname+location.search;R.deleted=!document.body.innerText?.includes(R.targetText?.substring(0,20));R.ok=R.deleted!==false;return JSON.stringify(R);})()",
"timeout": 30000,
"phase": "DELETE",
"critical": true
},
@@ -212,30 +194,12 @@
"action": "wait",
"timeout": 1500
},
{
"id": 102,
"name": "[회계관리 > 입금관리] [DELETE #3] 전 입금관리 복귀",
"action": "navigate",
"target": "/accounting/deposits"
},
{
"id": 103,
"name": "[회계관리 > 입금관리] [DELETE #3] 전 테이블 대기",
"action": "wait_for_table",
"timeout": 10000
},
{
"id": 111,
"name": "[회계관리 > 입금관리] [DELETE #3] 전 안정화 대기",
"action": "wait",
"duration": 2000
},
{
"id": 27,
"name": "[회계관리 > 입금관리] [DELETE #3] 데이터 삭제",
"action": "evaluate",
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const ts=window.__E2E_TS__||sessionStorage.getItem('__E2E_TS__')||'';const R={phase:'DELETE_3',ts};const findRow=()=>{const rows=Array.from(document.querySelectorAll('table tbody tr'));return rows.find(r=>r.innerText?.includes('E2E_TEST_입금'))||rows.find(r=>r.innerText?.includes('E2E_TEST_'));};let targetRow=findRow();R.attempt1=!!targetRow;R.rowCount1=document.querySelectorAll('table tbody tr').length;if(!targetRow){R.pagination=true;const allBtns=Array.from(document.querySelectorAll('nav button,[class*=\"pagination\"] button,[class*=\"Pagination\"] button'));const pageBtns=allBtns.filter(b=>/^[0-9]+$/.test(b.innerText?.trim()));R.pageBtnCount=pageBtns.length;for(const btn of pageBtns){const txt=btn.innerText?.trim();if(txt==='1')continue;btn.click();await w(2000);targetRow=findRow();if(targetRow){R.foundOnPage=txt;break;}}if(!targetRow){const nextBtns=[...document.querySelectorAll('button[aria-label*=\"다음\"],button[aria-label*=\"Next\"],button[aria-label*=\"next\"]'),...allBtns.filter(b=>/^[>›»]$/.test(b.innerText?.trim()))];R.nextBtnCount=nextBtns.length;for(let pg=0;pg<5&&!targetRow;pg++){const nb=nextBtns.find(b=>!b.disabled&&b.offsetParent!==null);if(!nb)break;nb.click();await w(2000);targetRow=findRow();if(targetRow){R.foundViaNext=pg+1;break;}}}}if(!targetRow){R.url=location.href;R.rowCount=document.querySelectorAll('table tbody tr').length;R.row0=document.querySelector('table tbody tr')?.innerText?.substring(0,80);R.bodyHasE2E=document.body.innerText.includes('E2E_TEST_');R.error='E2E_TEST_ 없음 rows='+R.rowCount+' pg='+R.pageBtnCount+' next='+R.nextBtnCount+' body='+R.bodyHasE2E+' url='+location.pathname;R.ok=false;return JSON.stringify(R);}R.targetText=targetRow.innerText?.substring(0,60);targetRow.click();await w(2500);const delBtn=Array.from(document.querySelectorAll('button')).find(b=>b.innerText?.trim()==='삭제');if(!delBtn){R.error='삭제 버튼 없음';R.ok=false;return JSON.stringify(R);}delBtn.click();await w(1000);const confirmBtn=Array.from(document.querySelectorAll('[role=\"alertdialog\"] button,[role=\"dialog\"] button,button')).find(b=>/확인|삭제|예|Yes/.test(b.innerText?.trim())&&b!==delBtn&&b.offsetParent!==null);if(confirmBtn){confirmBtn.click();await w(3000);}R.urlAfter=location.pathname+location.search;R.ok=true;return JSON.stringify(R);})()",
"timeout": 45000,
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const sv=(el,v)=>{const p=el.tagName==='TEXTAREA'?HTMLTextAreaElement.prototype:HTMLInputElement.prototype;const ns=Object.getOwnPropertyDescriptor(p,'value')?.set;if(ns)ns.call(el,v);else el.value=v;el.dispatchEvent(new Event('input',{bubbles:true}));el.dispatchEvent(new Event('change',{bubbles:true}));};const ts=window.__E2E_TS__||sessionStorage.getItem('__E2E_TS__')||(()=>{const n=new Date();const p=v=>v.toString().padStart(2,'0');return n.getFullYear()+p(n.getMonth()+1)+p(n.getDate())+'_'+p(n.getHours())+p(n.getMinutes())+p(n.getSeconds());})();window.__E2E_TS__=ts;try{sessionStorage.setItem('__E2E_TS__',ts);}catch(e){}const R={phase:'DELETE_3'};const rows=Array.from(document.querySelectorAll('table tbody tr'));const targetRow=rows.find(r=>r.innerText?.includes('E2E_TEST_')&&r.innerText?.includes(ts))||rows.find(r=>r.innerText?.includes('E2E_TEST_입금'));if(!targetRow){R.error='E2E_TEST_ 데이터 없음 (ts='+ts+')';R.ok=false;return JSON.stringify(R);}R.targetText=targetRow.innerText?.substring(0,60);targetRow.click();await w(2500);const delBtn=Array.from(document.querySelectorAll('button')).find(b=>b.innerText?.trim()==='삭제');if(!delBtn){R.error='삭제 버튼 없음';R.ok=false;return JSON.stringify(R);}delBtn.click();await w(1000);const confirmBtn=Array.from(document.querySelectorAll('[role=\"alertdialog\"] button,[role=\"dialog\"] button,button')).find(b=>/확인|삭제|예|Yes/.test(b.innerText?.trim())&&b!==delBtn&&b.offsetParent!==null);if(confirmBtn){confirmBtn.click();await w(3000);}R.urlAfter=location.pathname+location.search;R.deleted=!document.body.innerText?.includes(R.targetText?.substring(0,20));R.ok=R.deleted!==false;return JSON.stringify(R);})()",
"timeout": 30000,
"phase": "DELETE",
"critical": true
},