Files
sam-scenarios/reload-persist-acc-deposit.json
김보곤 23827c257d refactor: 비표준 포맷 13개 시나리오 Format A 통일
- actions 배열(Format B) → 단일 action(Format A) 변환
- fill_form fields: target 키 → name 키 수정
- verify_detail checks: 객체 배열 → 문자열 배열 수정
- 전체 13개 시나리오 E2E 테스트 PASS 확인
2026-02-28 17:21:01 +09:00

129 lines
11 KiB
JSON

{
"id": "reload-persist-acc-deposit",
"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": "[회계관리 > 입금관리] [CREATE] 데이터 생성",
"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__||(()=>{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{localStorage.setItem('__E2E_TS__',ts);sessionStorage.setItem('__E2E_TS__',ts);}catch(e){}const R={phase:'CREATE',ts};const btn=Array.from(document.querySelectorAll('button')).find(b=>/입금.*등록|입금등록|등록/.test(b.innerText?.trim()));if(!btn){R.error='등록 버튼 없음';return JSON.stringify(R);}btn.click();await w(2500);R.url=location.pathname+location.search;const formArea=document.querySelector('main')||document.querySelector('[class*=\"content\"]')||document.body;const combos=Array.from(formArea.querySelectorAll('button[role=\"combobox\"]')).filter(b=>b.offsetParent!==null&&!b.closest('nav,[class*=sidebar],[class*=Sidebar]'));R.comboCount=combos.length;for(let i=0;i<combos.length;i++){document.body.click();await w(200);combos[i].scrollIntoView({block:'center'});combos[i].click();await w(700);const lb=document.querySelector('[role=\"listbox\"]');if(lb){const opt=lb.querySelector('[role=\"option\"]');if(opt){opt.click();await w(500);}}else{document.dispatchEvent(new KeyboardEvent('keydown',{key:'Escape',bubbles:true}));await w(200);}}await w(500);const dateButtons=Array.from(formArea.querySelectorAll('button')).filter(b=>b.innerText?.trim()==='날짜 선택'&&b.offsetParent!==null);R.dateButtonCount=dateButtons.length;for(const db of dateButtons){db.scrollIntoView({block:'center'});await w(200);db.click();await w(600);if(!document.querySelector('table[class*=\"rdp\"],.rdp-month,[role=\"grid\"]')){db.click();await w(800);}const today=document.querySelector('[aria-selected=\"true\"]')||document.querySelector('button[name=\"day\"].bg-primary')||document.querySelector('.rdp-day_today button')||Array.from(document.querySelectorAll('button[name=\"day\"],td[role=\"gridcell\"] button,.rdp-day button')).find(b=>b.getAttribute('aria-selected')==='true'||b.classList.contains('bg-primary')||b.tabIndex===0)||document.querySelector('button[name=\"day\"]')||document.querySelector('td[role=\"gridcell\"] button');if(today){today.click();await w(400);}else{document.dispatchEvent(new KeyboardEvent('keydown',{key:'Escape',bubbles:true}));await w(300);}}await w(300);const nameInput=document.querySelector('input[placeholder*=\"입금자명\"]')||document.querySelector('input[placeholder*=\"입금자\"]');if(nameInput){sv(nameInput,'E2E_TEST_입금자_'+ts);await w(200);}R.nameFound=!!nameInput;const amtInput=document.querySelector('input[placeholder*=\"입금금액\"]')||document.querySelector('input[inputmode=\"numeric\"]')||document.querySelector('input[type=\"number\"]');if(amtInput){sv(amtInput,'50000');await w(200);}const noteInput=document.querySelector('input[placeholder*=\"적요\"]')||document.querySelector('textarea[placeholder*=\"적요\"]');if(noteInput){sv(noteInput,'E2E_TEST_입금_'+ts);await w(200);}R.noteFound=!!noteInput;if(nameInput&&!nameInput.value?.includes('E2E_TEST_')){sv(nameInput,'E2E_TEST_입금자_'+ts);await w(200);}if(noteInput&&!noteInput.value?.includes('E2E_TEST_')){sv(noteInput,'E2E_TEST_입금_'+ts);await w(200);}const submitBtn=Array.from(document.querySelectorAll('button')).find(b=>/^등록$|^저장$/.test(b.innerText?.trim())&&b.offsetParent!==null);if(!submitBtn){R.error='등록 버튼 없음';return JSON.stringify(R);}submitBtn.click();await w(3000);R.urlAfter=location.pathname+location.search;R.navigatedBack=!location.search.includes('mode=new');if(R.navigatedBack){R.ok=true;}else{const _t=document.querySelector('[class*=\"toast\"],[class*=\"Toastify\"],[role=\"alert\"]');const _al=window.__API_LOGS__||[];const _ps=_al.some(l=>l.method==='POST'&&l.ok);R.hasToast=!!_t;R.hasPostSuccess=_ps;if(_ps||_t){R.ok=true;R.warn='등록 성공(API/토스트 확인) but 리다이렉트 미동작';}else{R.ok=false;R.error='등록 실패 (API POST 없음, url='+R.urlAfter+')';}}return JSON.stringify(R);})()",
"timeout": 30000,
"phase": "CREATE"
},
{
"id": 4,
"name": "[회계관리 > 입금관리] [CREATE] 생성 후 대기",
"action": "wait",
"timeout": 3000
},
{
"id": 5,
"name": "[회계관리 > 입금관리] [CREATE] 목록 복귀",
"action": "evaluate",
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const onForm=location.search.includes('mode=new')||location.search.includes('mode=edit')||location.search.includes('mode=view')||new RegExp('/(new|[0-9]+|[0-9a-f]{8,})$').test(location.pathname);if(onForm){const btn=Array.from(document.querySelectorAll('button,a')).find(b=>/목록|취소|뒤로/.test(b.innerText?.trim()));if(btn){btn.click();await w(2000);}else{history.back();await w(2000);}}return JSON.stringify({url:location.pathname+location.search});})()",
"timeout": 10000,
"phase": "CREATE"
},
{
"id": 6,
"name": "[회계관리 > 입금관리] [CREATE] 목록 안정화",
"action": "wait",
"timeout": 2000
},
{
"id": 7,
"name": "[회계관리 > 입금관리] [VERIFY] 새로고침 전 데이터 확인",
"action": "evaluate",
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const ts=window.__E2E_TS__||(()=>{try{return localStorage.getItem('__E2E_TS__')}catch(e){return null}})()||'E2E_TEST_';const R={phase:'VERIFY'};await w(500);const rows=document.querySelectorAll('table tbody tr');R.rowCount=rows.length;const found=Array.from(rows).find(r=>r.innerText?.includes(ts))||Array.from(rows).find(r=>r.innerText?.includes('E2E_TEST_'));R.found=!!found;R.ok=R.found;R.ts=ts;if(found)R.foundText=found.innerText?.substring(0,80);if(!found){R.error='E2E_TEST_ 데이터 없음';R.firstRow=rows[0]?.innerText?.substring(0,80)||'(empty)';}return JSON.stringify(R);})()",
"timeout": 10000,
"phase": "VERIFY"
},
{
"id": 8,
"name": "[회계관리 > 입금관리] [RELOAD] 페이지 새로고침",
"action": "reload",
"timeout": 10000
},
{
"id": 9,
"name": "[회계관리 > 입금관리] [RELOAD] 새로고침 후 대기",
"action": "wait",
"timeout": 5000
},
{
"id": 10,
"name": "[회계관리 > 입금관리] [RELOAD] SPA 안정화 대기",
"action": "wait",
"timeout": 5000
},
{
"id": 11,
"name": "[회계관리 > 입금관리] [VERIFY] 새로고침 후 데이터 유지 확인",
"action": "evaluate",
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const ts=window.__E2E_TS__||(()=>{try{return localStorage.getItem('__E2E_TS__')}catch(e){return null}})()||'E2E_TEST_';const R={phase:'VERIFY'};await w(500);const rows=document.querySelectorAll('table tbody tr');R.rowCount=rows.length;const found=Array.from(rows).find(r=>r.innerText?.includes(ts))||Array.from(rows).find(r=>r.innerText?.includes('E2E_TEST_'));R.found=!!found;R.ok=R.found;R.ts=ts;if(found)R.foundText=found.innerText?.substring(0,80);if(!found){R.error='E2E_TEST_ 데이터 없음';R.firstRow=rows[0]?.innerText?.substring(0,80)||'(empty)';}return JSON.stringify(R);})()",
"timeout": 10000,
"phase": "VERIFY"
},
{
"id": 12,
"name": "[회계관리 > 입금관리] [DELETE] 테스트 데이터 삭제",
"action": "evaluate",
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const ts=window.__E2E_TS__||(()=>{try{return localStorage.getItem('__E2E_TS__')}catch(e){return null}})()||'E2E_TEST_';const R={phase:'DELETE'};const rows=Array.from(document.querySelectorAll('table tbody tr'));const row=rows.find(r=>r.innerText?.includes(ts))||rows.find(r=>r.innerText?.includes('E2E_TEST_'));if(!row){R.error='E2E_TEST_ 행 없음 (ts='+ts+')';R.ok=false;return JSON.stringify(R);}R.targetText=row.innerText?.substring(0,60);row.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 cfm=Array.from(document.querySelectorAll('[role=\"alertdialog\"] button,[role=\"dialog\"] button,button')).find(b=>/확인|삭제|예|Yes/.test(b.innerText?.trim())&&b!==delBtn&&b.offsetParent!==null);if(cfm){cfm.click();await w(3000);}R.ok=true;return JSON.stringify(R);})()",
"timeout": 30000,
"phase": "DELETE",
"critical": true
},
{
"id": 13,
"name": "[회계관리 > 입금관리] [DELETE] 삭제 후 대기",
"action": "wait",
"timeout": 3000
},
{
"id": 14,
"name": "[회계관리 > 입금관리] [DELETE] 목록 복귀",
"action": "evaluate",
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const onForm=location.search.includes('mode=new')||location.search.includes('mode=edit')||location.search.includes('mode=view')||new RegExp('/(new|[0-9]+|[0-9a-f]{8,})$').test(location.pathname);if(onForm){const btn=Array.from(document.querySelectorAll('button,a')).find(b=>/목록|취소|뒤로/.test(b.innerText?.trim()));if(btn){btn.click();await w(2000);}else{history.back();await w(2000);}}return JSON.stringify({url:location.pathname+location.search});})()",
"timeout": 10000,
"phase": "DELETE"
},
{
"id": 15,
"name": "[회계관리 > 입금관리] [DELETE] 목록 안정화",
"action": "wait",
"timeout": 2000
},
{
"id": 16,
"name": "[회계관리 > 입금관리] [VERIFY] 삭제 확인",
"action": "evaluate",
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const ts=window.__E2E_TS__||(()=>{try{return localStorage.getItem('__E2E_TS__')}catch(e){return null}})();const R={phase:'VERIFY_DELETE'};await w(500);const rows=document.querySelectorAll('table tbody tr');R.rowCount=rows.length;R.ts=ts||'(no ts)';if(!ts){R.ok=true;R.skipped='no ts available';return JSON.stringify(R);}const found=Array.from(rows).find(r=>r.innerText?.includes(ts));R.stillExists=!!found;R.ok=!found;if(found)R.error='삭제된 데이터(ts='+ts+')가 여전히 존재';return JSON.stringify(R);})()",
"timeout": 10000,
"phase": "VERIFY"
}
]
}