개요
오픈소스 엔드투엔드 테스트 프레임워크로, 자연어로 목표를 기술하면 AI 에이전트가 Web 또는 모바일 앱을 구동하여 작업을 수행합니다. 동일한 테스트에서 로케이터와 어설션을 결합할 수 있으며, 에이전트 작업을 녹화하여 이후 실행 시 모델 호출 없이 재생할 수 있습니다. Playwright 브라우저 또는 iOS/Android 시뮬레이터를 기반으로 하며, SDK, 러너, CLI 및 플러그 가능한 엔진 패키지를 제공합니다.
README 미리보기
\n\n\n \n \n \n \n\n\n# e2e\n\n[e2e](https://tester.army/e2e?utm_source=e2e&utm_medium=github&utm_campaign=readme_intro) is an end-to-end testing framework for web and mobile apps. Describe a goal in natural language and an agent drives the app to reach it. Check the result with locators and assertions in the same test.\n\n```ts\n// tests/checkout.e2e.ts\nimport { test, expect } from 'e2e';\n\ntest('a member upgrades to Pro', async ({ app, agent, screen }) => {\n await app.open('/settings/billing');\n\n await agent.act('upgrade the workspace to the Pro plan');\n await agent.assert('the invoice preview shows a prorated amount');\n\n await expect(screen.getByRole('status')).toContainText('Pro');\n});\n```\n\nAn agent step that a later assertion verifies records its actions, and the\nnext run replays them with no model calls until the app changes. Tests\nwithout agent steps need no model. Bring your own subscription, API key, or\nlocal model.\n\n## Quick start\n\n```bash\nnpx e2e init\n```\n\n`init` asks for an engine, web or mobile, and a model provider, then writes a\nconfig and an example test. The\n[quickstart](https://e2e.tester.army/docs/quickstart) covers the rest.\n\n## Packages\n\n| Package | What it does |\n| --- | --- |\n| [`e2e`](https://www.npmjs.com/package/e2e) | The SDK, runner, and CLI. |\n| [`@e2e-dev/web`](https://www.npmjs.com/package/@e2e-dev/web) | Browser engine: Chromium, Firefox, and WebKit through Playwright. |\n| [`@e2e-dev/mobile`](https://www.npmjs.com/package/@e2e-dev/mobile) | iOS and Android engine: simulators and emulators through agent-device. |\n| [`@e2e-dev/github`](https://www.npmjs.com/package/@e2e-dev/github) | Reporter that posts results as a pull request comment. |\n| [`@e2e-dev/kernel`](https://www.npmjs.com/package/@e2e-dev/kernel) | Kernel hosted browsers for the web engine. |\n| [`@e2e-dev/eas`](https://www.npmjs.com/package/@e2e-dev/eas) | EAS Simulators hosted iOS simulators and Android emulators for the mobile engFAQ (5)
문제 해결e2e 모바일 테스트에서 워커 교체 시 프로바이더 리스 세션의 디바이스 클레임이 해제되는 이유는 무엇인가요?
e2e@0.15.1 / @e2e-dev/mobile@0.9.0에서 실패한 유닛은 워커를 종료시키고, AgentDeviceSurface.dispose()가 sessions.close()를 호출하여 교체 워커가 다시 열기 전에 agent-device 클레임을 해제하므로, 다른 세션이 디바이스를 가로챌 수 있습니다. PR #1209에서 수정되었습니다: 슬롯이 프로바이더 리스를 보유하고 있는 경우, 워커 교체 시 이제 세션과 해당 디바이스 클레임을 열린 상태로 유지하며, release 또는 실행 완료 시에만 닫습니다. npm i @e2e-dev/mobile@nightly e2e@nightly로 수정 사항을 설치하거나, 0.15.1 / 0.9.0 이후의 다음 안정 릴리스로 업그레이드하세요.
방법설정된 API 키에 따라 e2e.config.ts에서 다른 AI 모델을 사용하는 방법은?
내장 폴백 API가 필요하지 않습니다. 대신 e2e.config.ts에서 환경 변수에 대한 단순 조건 표현식을 직접 사용하세요:
export default {
agents: {
default: {
model: process.env.ANTHROPIC_API_KEY
? anthropic('claude-sonnet-5')
: gateway('openai/gpt-6-luna-fast'),
},
},
} satisfies E2EConfig;
그러면 각 머신은 커밋된 설정을 수정하지 않고도 로컬에서 사용 가능한 자격 증명(예: ANTHROPIC_API_KEY 대 AI_GATEWAY_API_KEY)을 기반으로 모델을 선택합니다. 참고: 전용 firstAvailable 코어 API가 제안되었지만, 모델을 리플레이 캐시 키에 포함하면 머신 간 리플레이가 깨지고 설정 로드 시 실패하므로 유지 관리자에 의해 거부되었습니다. 대신, 선택된 모델은 캐시 키를 변경하지 않고 녹화별로 기록됩니다(issue #1192 참조).
문제 해결tester-army e2e에서 모델 비전을 활성화하거나 스크린샷을 잘못된 액션에 귀속시키지 않으면서 단계별 디버그 스크린샷을 캡처하는 방법은?
onStep에서 비동기로 스크린샷을 찍지 마세요. 이는 논블로킹 진행 상황 피드이므로 캡처가 이후 화면에서 이루어질 수 있습니다. 대신: 1) e2e@0.21.2로 업그레이드하고 session.report()를 호출하여 마스킹 처리되고 크기가 제한된 단계별 시맨틱 diff가 포함된 내장 단계-화면 트레이스를 받으세요. 2) agent.act()의 onAction 훅(#1219에서 추가됨)을 사용하세요. 이 훅은 각 액션 후에 await되어 실행되므로, 그 안에서 app.screenshot()을 호출하면 해당 액션과 일치하는 화면이 보장됩니다: await agent.act('Open Settings', { onAction: async () => { await app.screenshot(); } }). 3) 이제 시크릿 입력 후에도 아티팩트 스크린샷이 유지되며(#1218), 기존 마스킹 및 시크릿 오염(secret-taint) 규칙은 계속 적용됩니다. 이 모든 기능은 모델 비전을 활성화하거나 모델에 픽셀을 전송하지 않습니다.
방법How to export a versioned debug report from a hosted e2e session for an external debug viewer?
Use session.report(), shipped in e2e@0.21.2 (PR #1156). After the session closes, it returns the session's stable report-1 document — the same schema built for the hosted trace — containing run/attempt/target identity, final SDK outcome, step timings/status/errors, recorded events, and existing artifact references. It is available for passed, SDK-failed, and timed-out sessions, so consumers can serialize/upload the document and render their own viewer without parsing Markdown, scanning artifact directories, or importing private runner internals. Existing secret redaction and retention policies remain authoritative (late-resolved secret redaction is tracked separately in issue #1157). The broader debug bundle with an artifact manifest and reasoning excerpts was descoped; open a focused issue if your viewer needs evidence that report-1 doesn't carry.
문제 해결비디오 녹화 정리에 실패했는데도 e2e CLI가 code 0으로 종료되고 테스트가 통과했다고 보고하는 이유는 무엇인가요?
e2e 0.21.2에서 CLI는 비디오 클린업 실패(예: CLEANUP_TIMEOUT 'stopping the video timed out')를 실행 실패로 처리하지 않으므로, --video on을 사용한 실행이 테스트는 통과했지만 비디오 아티팩트가 남아 있지 않은 상태로 exit 0으로 종료될 수 있습니다. 우회 방법: (1) exit code 0만 신뢰하지 마세요. CLI를 래핑하여 실행 보고서에서 cleanup: "failed"와 코드가 CLEANUP_TIMEOUT인 secondaryErrors를 확인하고, 비디오 아티팩트가 실제로 존재하는지 확인하세요. (2) 타임아웃 자체를 방지하려면 스크린캐스트 크기를 줄이고(예: 1440x1100에서 960x720으로), 품질을 60으로 낮추고, cleanupTimeout을 30000에서 90000ms로 늘리세요. 실패한 클린업을 실행 결과 또는 종료 상태에 명시적으로 표시하는 수정 작업이 진행 중입니다.