mirror of
https://github.com/tester-army/e2e.git
synced 2026-11-21 03:05:26 +08:00
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Oskar Kwaśniewski <oskar@okwasniewski.com>
22 lines
774 B
TypeScript
22 lines
774 B
TypeScript
import type { E2EConfig } from 'e2e';
|
|
import { explore } from 'e2e/runner';
|
|
import { web } from '@e2e-dev/web';
|
|
import { gateway } from 'ai';
|
|
|
|
const config: E2EConfig = {
|
|
agents: { default: { model: gateway('openai/gpt-6-luna-fast') } },
|
|
targets: [{ name: 'web', engine: web(), app: { url: 'http://localhost:3000' } }],
|
|
};
|
|
const controller = new AbortController();
|
|
const result = await explore({
|
|
config,
|
|
goal: 'Explore the checkout flow like a first-time buyer and report anything off',
|
|
maxSteps: 4,
|
|
interruptSignal: controller.signal,
|
|
onEvent(event) {
|
|
if (event.type === 'explore' && event.progress.phase === 'finding') console.log(event.progress.finding.title);
|
|
},
|
|
});
|
|
|
|
console.log(result.status, result.explore.ended, result.explore.findings.length);
|