High-density Playwright reporter for AI coding agents
npm install @looted/agentic-reporterA high-density, token-efficient Playwright reporter designed for autonomous AI coding agents.
- Zero-Latency: Streams to stdout, no file I/O
- Token Efficiency: "Silence on Success" - passing tests emit nothing
- High-Signal: Captures stack traces, console logs, attachments
- Overflow Protection: Truncates after N failures to prevent context exhaustion
- Extensible: Custom hint patterns and output streams
``bash`
npm install @looted/agentic-reporter
`typescript
// playwright.config.ts
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: process.env['AGENTIC_REPORTER']
? [['@looted/agentic-reporter', { maxFailures: 5 }]]
: [['html', { open: 'never' }]],
});
`
| Option | Type | Default | Description |
| ---------------------------- | -------------- | ------- | --------------------------------------------- |
| maxFailures | number/boolean | false | Max failures before stopping execution |maxStackFrames
| | number | 8 | Stack trace depth |maxLogLines
| | number | 5 | Console log lines |maxLogChars
| | number | 500 | Max log characters |includeAttachments
| | boolean | true | Include trace/screenshot paths |checkPreviousReports
| | boolean | false | Prompt to continue if previous failures exist |outputStream
| | WritableStream | stdout | Custom output stream |getReproduceCommand
| | function | - | Custom callback to generate reproduce command |
You can customize the reproduce command output by providing a callback function. This is useful for wrapping the Playwright command in a shell script or custom runner.
`typescript
import { defineConfig } from '@playwright/test';
import { agenticReporter } from '@looted/agentic-reporter';
export default defineConfig({
reporter: [
agenticReporter({
getReproduceCommand: ({ file, line, project }) => {
return ./run-e2e.sh ${file}:${line} --project=${project};`
},
}),
],
});
`xml
File: auth.spec.ts:24
Error Stack:
\\\text
at tests/auth.spec.ts:24:20
\\\
Hint: Selector missing/hidden? Check element visibility.
]]>
``
MIT