Files
sam-scenarios/batch-create-board.json

280 lines
25 KiB
JSON
Raw Permalink Normal View History

{
"id": "batch-create-board",
"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": "[게시판 > 자유게시판] ts 초기화",
"action": "evaluate",
"script": "(()=>{try{sessionStorage.removeItem('__E2E_TS__');}catch(e){}delete window.__E2E_TS__;return JSON.stringify({ok:true,cleared:true});})()",
"timeout": 3000
},
{
"id": 3,
"name": "[게시판 > 자유게시판] 테이블 로드 대기",
"action": "wait_for_table",
"timeout": 5000
},
{
"id": 4,
"name": "[게시판 > 자유게시판] [CREATE #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:'CREATE_1',ts,n:1};const testTitle='E2E_BATCH_1_'+ts;R.testTitle=testTitle;const btn=Array.from(document.querySelectorAll('button')).find(b=>b.innerText?.trim()==='글쓰기'||/등록|작성/.test(b.innerText?.trim()));if(!btn){R.error='글쓰기 버튼 없음';return JSON.stringify(R);}btn.click();await w(2500);R.url=location.pathname+location.search;const titleInput=document.querySelector('input[placeholder*=\"제목\"]')||document.querySelector('input[type=\"text\"]');if(!titleInput){R.error='제목 입력란 없음';return JSON.stringify(R);}sv(titleInput,testTitle);await w(200);const contentArea=document.querySelector('textarea[placeholder*=\"내용\"]')||document.querySelector('textarea');if(contentArea){sv(contentArea,'E2E 연속 등록 테스트 #1. 자동 삭제 예정.');await w(200);}const submitBtn=Array.from(document.querySelectorAll('button')).find(b=>b.innerText?.trim()==='등록');if(!submitBtn){R.error='등록 버튼 없음';return JSON.stringify(R);}submitBtn.click();await w(5000);R.urlAfter=location.pathname+location.search;const valErrs=Array.from(document.querySelectorAll('[class*=\"error\"],[class*=\"invalid\"],.text-red-500,.text-destructive')).filter(e=>e.offsetParent!==null&&e.innerText?.trim()).map(e=>e.innerText.trim()).slice(0,5);if(valErrs.length)R.validationErrors=valErrs;R.ok=!R.urlAfter.includes('mode=new')&&!location.pathname.endsWith('/new');if(!R.ok)R.error='등록 실패 (url='+R.urlAfter+') errors='+JSON.stringify(valErrs);return JSON.stringify(R);})()",
"timeout": 30000,
"phase": "CREATE"
},
{
"id": 5,
"name": "[게시판 > 자유게시판] [CREATE #1] 생성 후 대기",
"action": "wait",
"timeout": 2000
},
{
"id": 6,
"name": "[게시판 > 자유게시판] [CREATE #1] 목록 복귀",
"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": 7,
"name": "[게시판 > 자유게시판] [CREATE #1] 목록 안정화",
"action": "wait",
"timeout": 1500
},
{
"id": 8,
"name": "[게시판 > 자유게시판] [CREATE #2] 데이터 생성",
"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:'CREATE_2',ts,n:2};const testTitle='E2E_BATCH_2_'+ts;R.testTitle=testTitle;const btn=Array.from(document.querySelectorAll('button')).find(b=>b.innerText?.trim()==='글쓰기'||/등록|작성/.test(b.innerText?.trim()));if(!btn){R.error='글쓰기 버튼 없음';return JSON.stringify(R);}btn.click();await w(2500);R.url=location.pathname+location.search;const titleInput=document.querySelector('input[placeholder*=\"제목\"]')||document.querySelector('input[type=\"text\"]');if(!titleInput){R.error='제목 입력란 없음';return JSON.stringify(R);}sv(titleInput,testTitle);await w(200);const contentArea=document.querySelector('textarea[placeholder*=\"내용\"]')||document.querySelector('textarea');if(contentArea){sv(contentArea,'E2E 연속 등록 테스트 #2. 자동 삭제 예정.');await w(200);}const submitBtn=Array.from(document.querySelectorAll('button')).find(b=>b.innerText?.trim()==='등록');if(!submitBtn){R.error='등록 버튼 없음';return JSON.stringify(R);}submitBtn.click();await w(5000);R.urlAfter=location.pathname+location.search;const valErrs=Array.from(document.querySelectorAll('[class*=\"error\"],[class*=\"invalid\"],.text-red-500,.text-destructive')).filter(e=>e.offsetParent!==null&&e.innerText?.trim()).map(e=>e.innerText.trim()).slice(0,5);if(valErrs.length)R.validationErrors=valErrs;R.ok=!R.urlAfter.includes('mode=new')&&!location.pathname.endsWith('/new');if(!R.ok)R.error='등록 실패 (url='+R.urlAfter+') errors='+JSON.stringify(valErrs);return JSON.stringify(R);})()",
"timeout": 30000,
"phase": "CREATE"
},
{
"id": 9,
"name": "[게시판 > 자유게시판] [CREATE #2] 생성 후 대기",
"action": "wait",
"timeout": 2000
},
{
"id": 10,
"name": "[게시판 > 자유게시판] [CREATE #2] 목록 복귀",
"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": 11,
"name": "[게시판 > 자유게시판] [CREATE #2] 목록 안정화",
"action": "wait",
"timeout": 1500
},
{
"id": 12,
"name": "[게시판 > 자유게시판] [CREATE #3] 데이터 생성",
"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:'CREATE_3',ts,n:3};const testTitle='E2E_BATCH_3_'+ts;R.testTitle=testTitle;const btn=Array.from(document.querySelectorAll('button')).find(b=>b.innerText?.trim()==='글쓰기'||/등록|작성/.test(b.innerText?.trim()));if(!btn){R.error='글쓰기 버튼 없음';return JSON.stringify(R);}btn.click();await w(2500);R.url=location.pathname+location.search;const titleInput=document.querySelector('input[placeholder*=\"제목\"]')||document.querySelector('input[type=\"text\"]');if(!titleInput){R.error='제목 입력란 없음';return JSON.stringify(R);}sv(titleInput,testTitle);await w(200);const contentArea=document.querySelector('textarea[placeholder*=\"내용\"]')||document.querySelector('textarea');if(contentArea){sv(contentArea,'E2E 연속 등록 테스트 #3. 자동 삭제 예정.');await w(200);}const submitBtn=Array.from(document.querySelectorAll('button')).find(b=>b.innerText?.trim()==='등록');if(!submitBtn){R.error='등록 버튼 없음';return JSON.stringify(R);}submitBtn.click();await w(5000);R.urlAfter=location.pathname+location.search;const valErrs=Array.from(document.querySelectorAll('[class*=\"error\"],[class*=\"invalid\"],.text-red-500,.text-destructive')).filter(e=>e.offsetParent!==null&&e.innerText?.trim()).map(e=>e.innerText.trim()).slice(0,5);if(valErrs.length)R.validationErrors=valErrs;R.ok=!R.urlAfter.includes('mode=new')&&!location.pathname.endsWith('/new');if(!R.ok)R.error='등록 실패 (url='+R.urlAfter+') errors='+JSON.stringify(valErrs);return JSON.stringify(R);})()",
"timeout": 30000,
"phase": "CREATE"
},
{
"id": 13,
"name": "[게시판 > 자유게시판] [CREATE #3] 생성 후 대기",
"action": "wait",
"timeout": 2000
},
{
"id": 14,
"name": "[게시판 > 자유게시판] [CREATE #3] 목록 복귀",
"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": 15,
"name": "[게시판 > 자유게시판] [CREATE #3] 목록 안정화",
"action": "wait",
"timeout": 1500
},
{
"id": 16,
"name": "[게시판 > 자유게시판] [VERIFY] 목록 새로고침",
"action": "reload"
},
{
"id": 17,
"name": "[게시판 > 자유게시판] [VERIFY] 테이블 로드 대기",
"action": "wait_for_table",
"timeout": 10000
},
{
"id": 18,
"name": "[게시판 > 자유게시판] [VERIFY] 3건 생성 확인",
"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:'VERIFY_BATCH',expected:3};await w(1000);R.url=location.pathname;const rows=Array.from(document.querySelectorAll('table tbody tr'));R.rowCount=rows.length;let batchRows=rows.filter(r=>r.innerText?.includes('E2E_BATCH_')&&r.innerText?.includes(ts));if(!batchRows.length)batchRows=rows.filter(r=>r.innerText?.includes('E2E_BATCH_'));R.batchCount=batchRows.length;R.batchTexts=batchRows.map(r=>r.innerText?.substring(0,60));R.countMatch=3===0?R.batchCount===0:R.batchCount>=3;if(!R.countMatch){R.row0=rows[0]?.innerText?.substring(0,80);R.bodyHas=document.body.innerText.includes('E2E_BATCH_');R.warn='기대 3건, 실제 '+R.batchCount+'건 rows='+R.rowCount+' body='+R.bodyHas+' row0=['+R.row0+']';}R.ok=R.countMatch;return JSON.stringify(R);})()",
"timeout": 15000,
"phase": "VERIFY"
},
{
"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_BATCH_')&&r.innerText?.includes(ts))||rows.find(r=>r.innerText?.includes('E2E_BATCH_'));if(!targetRow){R.error='E2E_BATCH_+ts 데이터 없음 (ts='+ts+')';R.ok=false;return JSON.stringify(R);}R.targetText=targetRow.innerText?.substring(0,60);targetRow.click();await w(2500);R.detailUrl=location.pathname+location.search;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);let cfm=document.querySelector('[role=\"alertdialog\"] [data-slot=\"alert-dialog-footer\"] button:last-child');if(!cfm){cfm=Array.from(document.querySelectorAll('[role=\"alertdialog\"] button')).find(b=>/삭제/.test(b.innerText?.trim())&&b!==delBtn);}if(!cfm){cfm=Array.from(document.querySelectorAll('button')).find(b=>/확인|삭제/.test(b.innerText?.trim())&&b!==delBtn&&b.offsetParent!==null);}if(cfm){cfm.click();await w(4000);}R.urlAfter=location.pathname+location.search;R.ok=true;return JSON.stringify(R);})()",
"timeout": 30000,
"phase": "DELETE",
"critical": true
},
{
"id": 20,
"name": "[게시판 > 자유게시판] [DELETE #1] 삭제 후 대기",
"action": "wait",
"timeout": 2000
},
{
"id": 21,
"name": "[게시판 > 자유게시판] [DELETE #1] 목록 복귀",
"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": 22,
"name": "[게시판 > 자유게시판] [DELETE #1] 목록 안정화",
"action": "wait",
"timeout": 1500
},
{
"id": 201,
"name": "[게시판 > 자유게시판] [DELETE #2 준비] 페이지 새로고침",
"action": "reload"
},
{
"id": 202,
"name": "[게시판 > 자유게시판] [DELETE #2 준비] 새로고침 대기",
"action": "wait",
"timeout": 1000
},
{
"id": 203,
"name": "[게시판 > 자유게시판] [DELETE #2 준비] 테이블 로드 대기",
"action": "wait_for_table",
"timeout": 10000
},
{
"id": 23,
"name": "[게시판 > 자유게시판] [DELETE #2] 데이터 삭제",
"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_2'};const rows=Array.from(document.querySelectorAll('table tbody tr'));const targetRow=rows.find(r=>r.innerText?.includes('E2E_BATCH_')&&r.innerText?.includes(ts))||rows.find(r=>r.innerText?.includes('E2E_BATCH_'));if(!targetRow){R.error='E2E_BATCH_+ts 데이터 없음 (ts='+ts+')';R.ok=false;return JSON.stringify(R);}R.targetText=targetRow.innerText?.substring(0,60);targetRow.click();await w(2500);R.detailUrl=location.pathname+location.search;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);let cfm=document.querySelector('[role=\"alertdialog\"] [data-slot=\"alert-dialog-footer\"] button:last-child');if(!cfm){cfm=Array.from(document.querySelectorAll('[role=\"alertdialog\"] button')).find(b=>/삭제/.test(b.innerText?.trim())&&b!==delBtn);}if(!cfm){cfm=Array.from(document.querySelectorAll('button')).find(b=>/확인|삭제/.test(b.innerText?.trim())&&b!==delBtn&&b.offsetParent!==null);}if(cfm){cfm.click();await w(4000);}R.urlAfter=location.pathname+location.search;R.ok=true;return JSON.stringify(R);})()",
"timeout": 30000,
"phase": "DELETE",
"critical": true
},
{
"id": 24,
"name": "[게시판 > 자유게시판] [DELETE #2] 삭제 후 대기",
"action": "wait",
"timeout": 2000
},
{
"id": 25,
"name": "[게시판 > 자유게시판] [DELETE #2] 목록 복귀",
"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": 26,
"name": "[게시판 > 자유게시판] [DELETE #2] 목록 안정화",
"action": "wait",
"timeout": 1500
},
{
"id": 204,
"name": "[게시판 > 자유게시판] [DELETE #3 준비] 페이지 새로고침",
"action": "reload"
},
{
"id": 205,
"name": "[게시판 > 자유게시판] [DELETE #3 준비] 새로고침 대기",
"action": "wait",
"timeout": 1000
},
{
"id": 206,
"name": "[게시판 > 자유게시판] [DELETE #3 준비] 테이블 로드 대기",
"action": "wait_for_table",
"timeout": 10000
},
{
"id": 27,
"name": "[게시판 > 자유게시판] [DELETE #3] 데이터 삭제",
"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_3'};const rows=Array.from(document.querySelectorAll('table tbody tr'));const targetRow=rows.find(r=>r.innerText?.includes('E2E_BATCH_')&&r.innerText?.includes(ts))||rows.find(r=>r.innerText?.includes('E2E_BATCH_'));if(!targetRow){R.error='E2E_BATCH_+ts 데이터 없음 (ts='+ts+')';R.ok=false;return JSON.stringify(R);}R.targetText=targetRow.innerText?.substring(0,60);targetRow.click();await w(2500);R.detailUrl=location.pathname+location.search;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);let cfm=document.querySelector('[role=\"alertdialog\"] [data-slot=\"alert-dialog-footer\"] button:last-child');if(!cfm){cfm=Array.from(document.querySelectorAll('[role=\"alertdialog\"] button')).find(b=>/삭제/.test(b.innerText?.trim())&&b!==delBtn);}if(!cfm){cfm=Array.from(document.querySelectorAll('button')).find(b=>/확인|삭제/.test(b.innerText?.trim())&&b!==delBtn&&b.offsetParent!==null);}if(cfm){cfm.click();await w(4000);}R.urlAfter=location.pathname+location.search;R.ok=true;return JSON.stringify(R);})()",
"timeout": 30000,
"phase": "DELETE",
"critical": true
},
{
"id": 28,
"name": "[게시판 > 자유게시판] [DELETE #3] 삭제 후 대기",
"action": "wait",
"timeout": 2000
},
{
"id": 29,
"name": "[게시판 > 자유게시판] [DELETE #3] 목록 복귀",
"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": 30,
"name": "[게시판 > 자유게시판] [DELETE #3] 목록 안정화",
"action": "wait",
"timeout": 1500
},
{
"id": 31,
"name": "[게시판 > 자유게시판] [VERIFY] 목록 새로고침",
"action": "reload"
},
{
"id": 32,
"name": "[게시판 > 자유게시판] [VERIFY] 테이블 로드 대기",
"action": "wait_for_table",
"timeout": 10000
},
{
"id": 33,
"name": "[게시판 > 자유게시판] [VERIFY] 전체 삭제 확인",
"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:'VERIFY_BATCH',expected:0};await w(1000);R.url=location.pathname;const rows=Array.from(document.querySelectorAll('table tbody tr'));R.rowCount=rows.length;let batchRows=rows.filter(r=>r.innerText?.includes('E2E_BATCH_')&&r.innerText?.includes(ts));R.batchCount=batchRows.length;R.batchTexts=batchRows.map(r=>r.innerText?.substring(0,60));R.countMatch=0===0?R.batchCount===0:R.batchCount>=0;if(!R.countMatch){R.row0=rows[0]?.innerText?.substring(0,80);R.bodyHas=document.body.innerText.includes('E2E_BATCH_');R.warn='기대 0건, 실제 '+R.batchCount+'건 rows='+R.rowCount+' body='+R.bodyHas+' row0=['+R.row0+']';}R.ok=R.countMatch;return JSON.stringify(R);})()",
"timeout": 15000,
"phase": "VERIFY"
}
]
}