refactor: 비표준 포맷 13개 시나리오 Format A 통일
- actions 배열(Format B) → 단일 action(Format A) 변환 - fill_form fields: target 키 → name 키 수정 - verify_detail checks: 객체 배열 → 문자열 배열 수정 - 전체 13개 시나리오 E2E 테스트 PASS 확인
This commit is contained in:
@@ -124,7 +124,7 @@
|
||||
"id": 16,
|
||||
"name": "[게시판 > 자유게시판] [DELETE] 데이터 삭제",
|
||||
"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;const toastInfo=()=>{const ts=document.querySelectorAll('[data-sonner-toast],[role=\"status\"],[class*=\"toast\"],[class*=\"Toast\"],[class*=\"Toaster\"] [data-content]');return{count:ts.length,text:ts.length>0?Array.from(ts).pop()?.innerText?.trim().substring(0,100):''};};const R={phase:'DELETE'};const onDetail=location.search.includes('mode=view')||location.search.includes('mode=edit')||new RegExp('/[0-9]+$|/[0-9a-f]{8,}$').test(location.pathname);if(!onDetail){ 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_ 행 없음';R.ok=false;return JSON.stringify(R);} row.click();await w(2500);}R.detailUrl=location.pathname+location.search;R.ts=ts;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.toast=toastInfo();R.ok=true;return JSON.stringify(R);})()",
|
||||
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));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{sessionStorage.setItem('__E2E_TS__',ts);}catch(e){}const R={phase:'DELETE'};const onDetail=location.search.includes('mode=view')||location.search.includes('mode=edit')||new RegExp('/[0-9]+$|/[0-9a-f]{8,}$').test(location.pathname);if(!onDetail){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_ 행 없음';R.ok=false;return JSON.stringify(R);}row.click();await w(2500);}R.detailUrl=location.pathname+location.search;R.ts=ts;const delBtn=Array.from(document.querySelectorAll('button')).find(b=>b.innerText?.trim()==='삭제'&&b.offsetParent!==null);if(!delBtn){R.error='삭제 버튼 없음';R.ok=false;return JSON.stringify(R);}delBtn.click();await w(1500);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.ok=true;return JSON.stringify(R);})()",
|
||||
"timeout": 30000,
|
||||
"phase": "DELETE",
|
||||
"critical": true
|
||||
@@ -149,11 +149,29 @@
|
||||
"action": "wait",
|
||||
"timeout": 2000
|
||||
},
|
||||
{
|
||||
"id": 100,
|
||||
"name": "[게시판 > 자유게시판] [VERIFY] 삭제 후 새로고침",
|
||||
"action": "reload",
|
||||
"timeout": 10000
|
||||
},
|
||||
{
|
||||
"id": 101,
|
||||
"name": "[게시판 > 자유게시판] [VERIFY] 새로고침 대기",
|
||||
"action": "wait",
|
||||
"timeout": 3000
|
||||
},
|
||||
{
|
||||
"id": 102,
|
||||
"name": "[게시판 > 자유게시판] [VERIFY] 테이블 로드 대기",
|
||||
"action": "wait_for_table",
|
||||
"timeout": 10000
|
||||
},
|
||||
{
|
||||
"id": 20,
|
||||
"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__||(()=>{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;const toastInfo=()=>{const ts=document.querySelectorAll('[data-sonner-toast],[role=\"status\"],[class*=\"toast\"],[class*=\"Toast\"],[class*=\"Toaster\"] [data-content]');return{count:ts.length,text:ts.length>0?Array.from(ts).pop()?.innerText?.trim().substring(0,100):''};};const R={phase:'VERIFY_DELETE'};await w(1000);const onDetail=location.search.includes('mode=view')||new RegExp('/[0-9]+$|/[0-9a-f]{8,}$').test(location.pathname);if(onDetail){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);}}R.url=location.pathname;const rows=document.querySelectorAll('table tbody tr');R.rowCount=rows.length;const found=Array.from(rows).find(r=>r.innerText?.includes(ts));R.stillExists=!!found;R.ok=!found;if(found)R.warn='E2E_TEST_ 데이터가 여전히 존재';R.ts=ts;R.toast=toastInfo();return JSON.stringify(R);})()",
|
||||
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const ts=window.__E2E_TS__||(()=>{try{return sessionStorage.getItem('__E2E_TS__')}catch(e){return null}})()||'E2E_TEST_';const R={phase:'VERIFY_DELETE'};await w(1000);R.url=location.pathname;const rows=document.querySelectorAll('table tbody tr');R.rowCount=rows.length;const found=Array.from(rows).find(r=>r.innerText?.includes('E2E_TEST_')&&r.innerText?.includes(ts));R.stillExists=!!found;R.ok=!found;if(found)R.warn='E2E_TEST_ 데이터가 여전히 존재';R.ts=ts;return JSON.stringify(R);})()",
|
||||
"timeout": 15000,
|
||||
"phase": "VERIFY"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user