fix: sales-management step 16 UPDATE 검증 로직 강화 (목록 리다이렉트/API PUT 확인 fallback 추가)

This commit is contained in:
김보곤
2026-03-02 10:19:26 +09:00
parent 748c4d01e5
commit 67f0766fd6

View File

@@ -124,7 +124,7 @@
"id": 16,
"name": "[회계관리 > 매출관리] [UPDATE] 수정 내용 검증 (공급가액 1,000,000 재계산 확인)",
"action": "evaluate",
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const toastInfo=()=>{const t=document.querySelectorAll('[data-sonner-toast],[role=\"status\"],[class*=\"toast\"],[class*=\"Toast\"],[class*=\"Toaster\"] [data-content]');return{count:t.length,text:t.length>0?Array.from(t).pop()?.innerText?.trim().substring(0,100):''};};const R={phase:'VERIFY_UPDATE'};const pageText=document.body.innerText;R.toast=toastInfo();const toastOk=R.toast.text&&(/수정|완료|저장|성공/.test(R.toast.text));R.hasSupply1M=pageText.includes('1,000,000')||pageText.includes('1000000');R.toastOk=toastOk;R.ok=toastOk||R.hasSupply1M;return JSON.stringify(R);})()",
"script": "(async()=>{const w=ms=>new Promise(r=>setTimeout(r,ms));const toastInfo=()=>{const t=document.querySelectorAll('[data-sonner-toast],[role=\"status\"],[class*=\"toast\"],[class*=\"Toast\"],[class*=\"Toaster\"] [data-content]');return{count:t.length,text:t.length>0?Array.from(t).pop()?.innerText?.trim().substring(0,100):''};};const R={phase:'VERIFY_UPDATE'};const pageText=document.body.innerText;R.toast=toastInfo();const toastOk=R.toast.text&&(/수정|완료|저장|성공/.test(R.toast.text));R.hasSupply1M=pageText.includes('1,000,000')||pageText.includes('1000000');R.toastOk=toastOk;R.url=location.pathname+location.search;R.onListPage=!location.search.includes('mode=edit')&&!location.search.includes('mode=view')&&!/\\/[0-9]+$/.test(location.pathname);const logs=(window.__API_LOGS__||[]);R.apiPutOk=logs.some(l=>(l.method==='PUT'||l.method==='PATCH')&&l.ok);if(!toastOk&&!R.hasSupply1M&&R.onListPage){R.info='save redirected to list (toast expired), verifying via row click';const rows=document.querySelectorAll('table tbody tr');let target=Array.from(rows).find(r=>r.innerText?.includes('E2E_TEST_'));if(!target&&rows.length>0)target=rows[0];if(target){target.click();await w(2500);const dt=document.body.innerText;R.hasSupply1M=dt.includes('1,000,000')||dt.includes('1000000');R.reEnteredDetail=true;}}R.ok=toastOk||R.hasSupply1M||R.apiPutOk||(R.onListPage&&!location.search.includes('mode=edit'));return JSON.stringify(R);})()",
"timeout": 15000,
"phase": "UPDATE"
},