Loading...
Loading...
E2E 시나리오 생성, 실행, 자동수정을 통합 처리하는 스킬. "시나리오 만들어줘", "시나리오 실행", "e2e 실행", "E2E 돌려", "시나리오 돌려", "시나리오 변환", "녹화 변환", "e2e 변환", "codegen 변환", "e2e 생성", "시나리오 생성", "시나리오 검증" 키워드로 트리거.
npx skill4agent add peachsolution/peach-harness peach-e2e-scenario| 모드 | 트리거 | 동작 |
|---|---|---|
| | 생성 + 실행 + 자동수정 루프 |
| | 시나리오 생성만 |
| | 실행 + 자동수정 루프 |
| 용도 | 도구 |
|---|---|
| 시나리오 실행 | |
| 셀렉터 디버깅/DOM 확인 | |
| iframe 디버깅 | |
| 문법 검증 | |
./e2e.sh status./e2e.sh runagent-browser evalagent-browseropen -acd e2e && ./e2e.sh setupsetupcd e2e && ./e2e.sh chrome &sleep 4cd e2e && ./e2e.sh statuscd e2e && ./e2e.sh chromecd e2e && ./e2e.sh status탭 번호는 0번부터 시작.탭은 제외.chrome://가[번호]의 N과 동일. 사용자가 로그인한 탭을 그대로 사용. 환경(local/test/prod) 구분 없음. 탭 번호를 받기 전에는 실행하지 않는다. 민감 세션 작업은 탭 번호를 받아도 사용자 승인 전까지 분석만 수행한다. 탭 드리프트 방지: 사용자가 탭 번호를 응답한 뒤--tab N직후agent-browser tab N로 탭이 맞는지 재검증한다. 예상과 다르면agent-browser eval "document.title + ' | ' + location.href"재출력 후 재선택. 디버깅/재현 시에는./e2e.sh status고정 권장. (상세:E2E_TAB_ID)peach-e2e-browse/references/탭-선택-패턴.md
파일 업로드 시나리오: 시나리오 코드에서또는 file input 조작이 필요하면 OS 네이티브 파일 다이얼로그 차단을 위해page.setInputFiles()방식을 사용한다. CDP Escape /Page.setInterceptFileChooserDialog로는 macOS 네이티브 다이얼로그를 닫을 수 없다. (상세:agent-browser press Escape)peach-e2e-browse/references/SPA-프레임워크-입력패턴.md §3
e2e/시나리오/references/시나리오-생성-패턴.mdreferences/코드패턴.mdreferences/변환규칙.mdreferences/프레임워크-대응.mdnode --check./e2e.sh run./e2e.sh run --tab N 시나리오/경로references/시나리오-생성-패턴.mdreferences/코드패턴.mdreferences/변환규칙.mdreferences/코드패턴.mdchromium.launch()connect()page.goto('/path')page.goto()browser.close()context.close()page.pause()setDialogHandlerprocess.exit(0)waitForTimeoutwaitForEvent('popup')waitForEvent('close')node --checke2e/시나리오/{저장위치}/{카테고리}/{이름}.jscd e2e && ./e2e.sh listcd e2e && ./e2e.sh run --tab N 시나리오/경로❌ 에러:references/자동수정-판단트리.md| 에러 유형 | 처리 방법 |
|---|---|
| 셀렉터 불일치 (timeout, locator not found) | agent-browser eval로 실제 DOM 확인 → 시나리오 셀렉터 수정 |
dialog 자동 닫힘 ( | daemon 잔류 확인 후 kill → |
popup | |
URL 패턴 불일치 ( | 실제 이동 URL 확인 → 패턴 수정 |
타이밍 문제 ( | 고정 대기 → |
| 팝업/탭이 예상보다 일찍 닫힘 → |
| navigation timeout (AJAX submit) | waitForNavigation 제거 또는 waitForURL로 교체 |
| 서버 에러 (500, 네트워크 에러) | 자동수정 불가 → 사용자에게 보고 후 중단 |
1. 에러 메시지 파싱 → 유형 판별
2. agent-browser eval로 실제 DOM/URL 확인
3. 시나리오 스크립트 수정
4. 재실행
5. 여전히 실패? → 1로 돌아감 (최대 3회)
6. 3회 실패 → 에러 이력 요약 → 사용자에게 보고 → peach-e2e-browse 안내E2E_TAB_ID=<id> ./e2e.sh run '시나리오/대상.js'dialog 관련 오류라면 실행 전 반드시 daemon 잔류 확인:bashlsof -iTCP:9222 -sTCP:ESTABLISHED -n -P | awk '/node/{print $2}' | xargs kill -9 2>/dev/null
# CDP 연결 (1회)
agent-browser connect 9222
# 현재 URL 확인
agent-browser eval "location.href"
# 셀렉터 존재 여부
agent-browser eval "document.querySelector('.target') !== null"
# 버튼 목록
agent-browser eval "JSON.stringify(Array.from(document.querySelectorAll('button')).map(function(b){return b.innerText}))"
# 요소 개수
agent-browser eval "document.querySelectorAll('tr').length"iframe 내부 디버깅은 agent-browser로 불가 → playwright-cli fallback:bash./e2e/pwc.sh eval "document.querySelector('iframe[src*=target]').contentDocument.querySelector('#element').innerText"
window.alert/confirmpage.on('dialog', handler)connect.jssetDialogHandler(page, prevHandler, newHandler)page.on('dialog')waitForEvent('popup')connect.jsprocess.exit(0)try/catch/finally + exitCodewaitForTimeoutpage.waitForEvent('dialog')peach-e2e-browse/references/native-dialog-주의사항.mdload + 2초 지연 + 직접 이동 fallbackpeach-e2e-browse/references/외부서비스-링크전환-패턴.md--tab NE2E_TAB_ID# targetId 조회
curl -s http://127.0.0.1:9222/json | jq -r '.[] | select(.type=="page" and (.url|startswith("chrome")|not)) | [.id,.title,.url] | @tsv'
# targetId로 실행
cd e2e && E2E_TAB_ID=<targetId> ./e2e.sh run '시나리오/대상.js'peach-e2e-browse/references/탭-선택-패턴.mdlib/connect.jsconnect()nodebunclick()node --check| 문서 | 용도 | 로드 조건 |
|---|---|---|
| 시나리오 기본 구조 (IIFE, exitCode, 이모지) | create, auto |
| codegen → CDP 변환 규칙 | codegen 입력 시 |
| 레거시/모던 프레임워크 분기 | create, auto |
| 기존 코드 참조 기반 생성 가이드 | create, auto |
| form validation 우회 패턴 | create, auto |
| 에러 유형별 자동수정 전략 | run, auto 실패 시 |
| CDP daemon 문제 해결 | dialog 에러 시 |
| native dialog 처리 메커니즘 | dialog 시나리오 |