{ "id": "search-filter-acc-sales", "name": "검색/필터/페이지네이션 테스트: 매출관리", "version": "1.0.0", "auth": { "role": "admin" }, "menuNavigation": { "level1": "회계관리", "level2": "매출관리" }, "screenshotPolicy": { "captureOnFail": true, "captureOnPass": false }, "steps": [ { "id": 1, "name": "[회계관리 > 매출관리] 페이지 로드 대기", "action": "wait", "timeout": 5000 }, { "id": 2, "name": "[회계관리 > 매출관리] 테이블 로드 대기", "action": "wait_for_table", "timeout": 20000 }, { "id": 3, "name": "[회계관리 > 매출관리] [BASELINE] 초기 행 수 + UI 요소 캡처", "action": "evaluate", "script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const R={phase:'BASELINE'};await w(500);const rows=document.querySelectorAll('table tbody tr');R.initialRowCount=rows.length;window.__E2E_INITIAL_ROWS__=rows.length;const dateInputs=document.querySelectorAll('input[type=\"date\"],button[class*=\"date\"],button[class*=\"Date\"],[class*=\"datepicker\"],[class*=\"DatePicker\"]');R.dateInputCount=dateInputs.length;const searchInputs=document.querySelectorAll('input[type=\"search\"],input[placeholder*=\"검색\"],input[placeholder*=\"search\"]');R.searchInputCount=searchInputs.length;const combos=Array.from(document.querySelectorAll('button[role=\"combobox\"],select')).filter(b=>b.offsetParent!==null);R.comboCount=combos.length;const filterBtns=Array.from(document.querySelectorAll('button')).filter(b=>/검색|조회|필터/.test(b.innerText?.trim()));R.filterBtnCount=filterBtns.length;const pagination=document.querySelectorAll('[class*=\"pagination\"],[class*=\"Pagination\"],nav[aria-label*=\"page\"],button[aria-label*=\"page\"]');R.hasPagination=pagination.length>0;R.ok=R.initialRowCount>0;R.info='초기 행 수: '+R.initialRowCount+', 콤보: '+R.comboCount+', 페이지네이션: '+R.hasPagination;return JSON.stringify(R);})()", "timeout": 10000, "phase": "BASELINE" }, { "id": 4, "name": "[회계관리 > 매출관리] [DATE-FILTER] 날짜 범위 필터 설정", "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 R={phase:'DATE_FILTER'};const dateInputs=Array.from(document.querySelectorAll('input[type=\"date\"]')).filter(i=>i.offsetParent!==null);R.dateInputCount=dateInputs.length;if(dateInputs.length>=1){const today=new Date();const monthAgo=new Date(today);monthAgo.setMonth(monthAgo.getMonth()-1);const fmt=d=>`${d.getFullYear()}-${String(d.getMonth()+1).padStart(2,'0')}-${String(d.getDate()).padStart(2,'0')}`;sv(dateInputs[0],fmt(monthAgo));await w(300);if(dateInputs.length>=2){sv(dateInputs[1],fmt(today));await w(300);}R.dateSet=true;}else{const dateBtns=Array.from(document.querySelectorAll('button')).filter(b=>b.innerText?.includes('날짜')||b.className?.includes('date')||b.className?.includes('Date'));if(dateBtns.length>0){dateBtns[0].click();await w(600);const todayBtn=document.querySelector('[aria-selected=\"true\"],button[name=\"day\"].bg-primary');if(todayBtn){todayBtn.click();await w(300);}R.dateSet=true;}}const searchBtn=Array.from(document.querySelectorAll('button')).find(b=>/검색|조회/.test(b.innerText?.trim())&&b.offsetParent!==null);if(searchBtn){searchBtn.click();await w(2000);}else{await w(1000);}const rows=document.querySelectorAll('table tbody tr');R.filteredRowCount=rows.length;R.ok=true;return JSON.stringify(R);})()", "timeout": 15000, "phase": "FILTER" }, { "id": 5, "name": "[회계관리 > 매출관리] [DATE-FILTER] 결과 확인 후 초기화", "action": "evaluate", "script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const R={phase:'DATE_RESET'};const rows=document.querySelectorAll('table tbody tr');R.afterFilterRows=rows.length;const resetBtn=Array.from(document.querySelectorAll('button')).find(b=>/초기화|리셋|Reset|전체/.test(b.innerText?.trim())&&b.offsetParent!==null);if(resetBtn){resetBtn.click();await w(2000);R.resetClicked=true;}else{const dateInputs=Array.from(document.querySelectorAll('input[type=\"date\"]')).filter(i=>i.offsetParent!==null);dateInputs.forEach(inp=>{inp.value='';inp.dispatchEvent(new Event('change',{bubbles:true}));});await w(500);const searchBtn=Array.from(document.querySelectorAll('button')).find(b=>/검색|조회/.test(b.innerText?.trim()));if(searchBtn){searchBtn.click();await w(2000);}}const rowsAfterReset=document.querySelectorAll('table tbody tr');R.afterResetRows=rowsAfterReset.length;R.ok=true;return JSON.stringify(R);})()", "timeout": 15000, "phase": "FILTER" }, { "id": 6, "name": "[회계관리 > 매출관리] [VENDOR-FILTER] 거래처 필터 선택", "action": "evaluate", "script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const R={phase:'VENDOR_FILTER'};const combos=Array.from(document.querySelectorAll('button[role=\"combobox\"]')).filter(b=>b.offsetParent!==null);const vendorCombo=combos.find(cb=>{const lbl=cb.closest('[class*=field],[class*=Field],[class*=form-item]')?.querySelector('label')?.innerText||'';return lbl.includes('거래처');});const target=vendorCombo||combos[0];if(!target){R.info='거래처 필터 콤보 없음';R.ok=true;return JSON.stringify(R);}target.click();await w(600);const lb=document.querySelector('[role=\"listbox\"]');if(lb){const opts=lb.querySelectorAll('[role=\"option\"]');if(opts.length>0){const vendorOpt=opts[0];R.selectedVendor=vendorOpt.innerText?.trim();window.__E2E_VENDOR__=R.selectedVendor;vendorOpt.click();await w(400);}}else{document.dispatchEvent(new KeyboardEvent('keydown',{key:'Escape',bubbles:true}));await w(200);}const searchBtn=Array.from(document.querySelectorAll('button')).find(b=>/검색|조회/.test(b.innerText?.trim())&&b.offsetParent!==null);if(searchBtn){searchBtn.click();await w(2000);}else{await w(1000);}const rows=document.querySelectorAll('table tbody tr');R.filteredRowCount=rows.length;R.ok=true;return JSON.stringify(R);})()", "timeout": 15000, "phase": "FILTER" }, { "id": 7, "name": "[회계관리 > 매출관리] [VENDOR-FILTER] 모든 행이 해당 거래처인지 확인", "action": "evaluate", "script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const R={phase:'VENDOR_VERIFY'};const vendor=window.__E2E_VENDOR__||'';R.expectedVendor=vendor;const rows=document.querySelectorAll('table tbody tr');R.rowCount=rows.length;if(!vendor||rows.length===0){R.ok=true;R.info='거래처 필터 미적용 또는 결과 없음';return JSON.stringify(R);}let matchCount=0;Array.from(rows).forEach(row=>{if(row.innerText?.includes(vendor))matchCount++;});R.matchCount=matchCount;R.allMatch=matchCount===rows.length;R.ok=R.allMatch!==false;R.info=R.allMatch?'✅ 모든 행('+rows.length+')이 거래처 '+vendor+' 일치':'⚠️ '+matchCount+'/'+rows.length+' 행만 일치';return JSON.stringify(R);})()", "timeout": 10000, "phase": "VERIFY" }, { "id": 8, "name": "[회계관리 > 매출관리] [VENDOR-FILTER] 초기화", "action": "evaluate", "script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const R={phase:'VENDOR_RESET'};const resetBtn=Array.from(document.querySelectorAll('button')).find(b=>/초기화|리셋|Reset|전체/.test(b.innerText?.trim())&&b.offsetParent!==null);if(resetBtn){resetBtn.click();await w(2000);R.resetClicked=true;}else{location.reload();await w(3000);R.reloaded=true;}R.ok=true;return JSON.stringify(R);})()", "timeout": 15000, "phase": "FILTER" }, { "id": 9, "name": "[회계관리 > 매출관리] [VENDOR-FILTER] 초기화 대기", "action": "wait", "timeout": 2000 }, { "id": 10, "name": "[회계관리 > 매출관리] [TYPE-FILTER] 매출유형 필터 선택", "action": "evaluate", "script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const R={phase:'TYPE_FILTER'};const combos=Array.from(document.querySelectorAll('button[role=\"combobox\"]')).filter(b=>b.offsetParent!==null);const typeCombo=combos.find(cb=>{const lbl=cb.closest('[class*=field],[class*=Field],[class*=form-item]')?.querySelector('label')?.innerText||'';return lbl.includes('매출유형')||lbl.includes('유형');});const target=typeCombo||(combos.length>1?combos[1]:null);if(!target){R.info='매출유형 필터 콤보 없음';R.ok=true;return JSON.stringify(R);}target.click();await w(600);const lb=document.querySelector('[role=\"listbox\"]');if(lb){const opts=lb.querySelectorAll('[role=\"option\"]');const typeOpt=Array.from(opts).find(o=>o.innerText?.includes('제품매출'))||opts[0];if(typeOpt){R.selectedType=typeOpt.innerText?.trim();window.__E2E_TYPE__=R.selectedType;typeOpt.click();await w(400);}}else{document.dispatchEvent(new KeyboardEvent('keydown',{key:'Escape',bubbles:true}));await w(200);}const searchBtn=Array.from(document.querySelectorAll('button')).find(b=>/검색|조회/.test(b.innerText?.trim())&&b.offsetParent!==null);if(searchBtn){searchBtn.click();await w(2000);}else{await w(1000);}const rows=document.querySelectorAll('table tbody tr');R.filteredRowCount=rows.length;R.ok=true;return JSON.stringify(R);})()", "timeout": 15000, "phase": "FILTER" }, { "id": 11, "name": "[회계관리 > 매출관리] [TYPE-FILTER] 모든 행이 해당 유형인지 확인", "action": "evaluate", "script": "(async()=>{const R={phase:'TYPE_VERIFY'};const sType=window.__E2E_TYPE__||'';R.expectedType=sType;const rows=document.querySelectorAll('table tbody tr');R.rowCount=rows.length;if(!sType||rows.length===0){R.ok=true;R.info='매출유형 필터 미적용 또는 결과 없음';return JSON.stringify(R);}let matchCount=0;Array.from(rows).forEach(row=>{if(row.innerText?.includes(sType))matchCount++;});R.matchCount=matchCount;R.allMatch=matchCount===rows.length;R.ok=R.allMatch!==false;R.info=R.allMatch?'✅ 모든 행('+rows.length+')이 유형 '+sType+' 일치':'⚠️ '+matchCount+'/'+rows.length+' 행만 일치';return JSON.stringify(R);})()", "timeout": 10000, "phase": "VERIFY" }, { "id": 12, "name": "[회계관리 > 매출관리] [RESET] 전체 필터 초기화", "action": "evaluate", "script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const R={phase:'FULL_RESET'};const resetBtn=Array.from(document.querySelectorAll('button')).find(b=>/초기화|리셋|Reset|전체/.test(b.innerText?.trim())&&b.offsetParent!==null);if(resetBtn){resetBtn.click();await w(2000);R.resetClicked=true;}else{location.reload();await w(3000);R.reloaded=true;}R.ok=true;return JSON.stringify(R);})()", "timeout": 15000, "phase": "FILTER" }, { "id": 13, "name": "[회계관리 > 매출관리] [RESET] 초기화 후 대기", "action": "wait", "timeout": 3000 }, { "id": 14, "name": "[회계관리 > 매출관리] [RESET] 원래 행 수 복귀 확인", "action": "evaluate", "script": "(async()=>{const R={phase:'RESET_VERIFY'};const initialRows=window.__E2E_INITIAL_ROWS__||0;const currentRows=document.querySelectorAll('table tbody tr').length;R.initialRows=initialRows;R.currentRows=currentRows;R.restored=currentRows>=initialRows||Math.abs(currentRows-initialRows)<=2;R.ok=R.restored;R.info=R.restored?'✅ 행 수 복귀 ('+initialRows+' → '+currentRows+')':'⚠️ 행 수 불일치 ('+initialRows+' → '+currentRows+')';return JSON.stringify(R);})()", "timeout": 10000, "phase": "VERIFY" }, { "id": 15, "name": "[회계관리 > 매출관리] [PAGINATION] 페이지네이션 존재 확인", "action": "evaluate", "script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const R={phase:'PAGINATION_CHECK'};const pagBtns=Array.from(document.querySelectorAll('button,a')).filter(b=>{const t=b.innerText?.trim();const ariaLabel=b.getAttribute('aria-label')||'';return(/^[0-9]+$/.test(t)||/다음|next|이전|prev|>|<|>>|<0;if(!R.hasPagination){R.info='페이지네이션 없음 (데이터 적음 가능)';R.ok=true;return JSON.stringify(R);}const firstRowText=document.querySelector('table tbody tr')?.innerText?.substring(0,60)||'';window.__E2E_FIRST_PAGE_TEXT__=firstRowText;const page2Btn=pagBtns.find(b=>b.innerText?.trim()==='2')||pagBtns.find(b=>/다음|next|>/.test(b.innerText?.trim()));if(page2Btn){page2Btn.click();await w(2000);R.navigatedToPage2=true;const newFirstRowText=document.querySelector('table tbody tr')?.innerText?.substring(0,60)||'';R.dataChanged=newFirstRowText!==firstRowText;R.ok=true;R.info=R.dataChanged?'✅ 2페이지 이동 → 데이터 변경됨':'⚠️ 2페이지 이동 → 데이터 동일';}else{R.ok=true;R.info='2페이지 버튼 없음';}return JSON.stringify(R);})()", "timeout": 15000, "phase": "PAGINATION" }, { "id": 16, "name": "[회계관리 > 매출관리] [PAGINATION] 대기", "action": "wait", "timeout": 1000 }, { "id": 17, "name": "[회계관리 > 매출관리] [PAGINATION] 1페이지 복귀", "action": "evaluate", "script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const R={phase:'PAGE1_RETURN'};const page1Btn=Array.from(document.querySelectorAll('button,a')).find(b=>{const t=b.innerText?.trim();const ariaLabel=b.getAttribute('aria-label')||'';return(t==='1'||/이전|prev| 매출관리] [SUMMARY] 필터/검색 테스트 완료", "action": "evaluate", "script": "(async()=>{const R={phase:'SUMMARY'};R.initialRows=window.__E2E_INITIAL_ROWS__||0;R.currentRows=document.querySelectorAll('table tbody tr').length;R.url=location.pathname+location.search;R.ok=true;R.info='검색/필터/페이지네이션 테스트 완료';return JSON.stringify(R);})()", "timeout": 5000, "phase": "VERIFY" } ] }