A Playwright test reporter for uploading test results to Ibutsu.
- Upload test results and artifacts to Ibutsu server
- Create local archives of test runs (tar.gz format)
- Upload archives to AWS S3
- Automatic artifact collection on test failures:
- Screenshots
- Playwright traces
- Videos
- Console logs
- Error logs
- Configurable via environment variables or
playwright.config.ts - Retry logic for network failures
- Supports multiple operating modes (server, archive, or both)
yarn add playwright-ibutsuOr with npm:
npm install playwright-ibutsuRequired for server upload:
IBUTSU_SERVER- Ibutsu server URL (e.g.,https://ibutsu.example.com)IBUTSU_TOKEN- Authentication token (MUST be set via environment variable for security)
Optional:
IBUTSU_SOURCE- Source identifier for the test runIBUTSU_PROJECT- Project nameIBUTSU_MODE- Operating mode:server,archive, orboth(default:both)IBUTSU_NO_ARCHIVE- Set totrueto disable archive creationIBUTSU_COMPONENT- Component being testedIBUTSU_ENV- Environment identifierAWS_BUCKET- S3 bucket name for archive uploadsAWS_REGION- AWS region (default:us-east-1)AWS_ACCESS_KEY_ID- AWS access keyAWS_SECRET_ACCESS_KEY- AWS secret key
Add the reporter to your playwright.config.ts:
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: [
['playwright-ibutsu', {
// Non-sensitive configuration options
source: 'my-test-suite',
project: 'my-project',
component: 'frontend',
env: 'staging',
mode: 'both', // 'server', 'archive', or 'both'
metadata: {
team: 'qa',
build_id: process.env.BUILD_ID,
},
}],
['html'], // You can use multiple reporters
],
// ... other config
});IMPORTANT SECURITY NOTE: Never put your IBUTSU_TOKEN in the configuration file. Always use environment variables:
export IBUTSU_TOKEN="your-secret-token"
export IBUTSU_SERVER="https://ibutsu.example.com"
npx playwright testexport IBUTSU_MODE=server
export IBUTSU_SERVER=https://ibutsu.example.com
export IBUTSU_TOKEN=your-secret-token
export IBUTSU_SOURCE=my-tests
npx playwright testexport IBUTSU_MODE=archive
export IBUTSU_SOURCE=my-tests
npx playwright testexport IBUTSU_MODE=both
export IBUTSU_SERVER=https://ibutsu.example.com
export IBUTSU_TOKEN=your-secret-token
export AWS_BUCKET=my-test-archives
export AWS_ACCESS_KEY_ID=your-aws-key
export AWS_SECRET_ACCESS_KEY=your-aws-secret
npx playwright testExample GitHub Actions workflow:
name: Playwright Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run Playwright tests
env:
IBUTSU_SERVER: https://ibutsu.example.com
IBUTSU_TOKEN: ${{ secrets.IBUTSU_TOKEN }}
IBUTSU_SOURCE: ${{ github.repository }}
IBUTSU_PROJECT: my-project
run: npx playwright test- Uploads results and artifacts directly to Ibutsu server
- Requires
IBUTSU_SERVERandIBUTSU_TOKEN
- Creates local
.tar.gzarchives containing results and artifacts - Archive structure:
{run-id}.tar.gzcontaining:{run-id}/run.json- Run metadata{run-id}/{result-id}/result.json- Result metadata{run-id}/{result-id}/*- Artifacts (screenshots, traces, logs)
- Uploads to server AND creates local archives
- Archives can be uploaded to S3 if AWS credentials are configured
The reporter automatically collects artifacts from failed tests:
- Screenshots: All images attached to test results
- Traces: Playwright trace files (
.zip) - Videos: Test execution videos (
.webm) - Logs:
- Error logs from test failures
- stdout/stderr output
- Browser console logs
You can also use the reporter programmatically:
import { IbutsuReporter } from 'playwright-ibutsu';
// Create reporter instance
const reporter = new IbutsuReporter({
source: 'my-tests',
project: 'my-project',
mode: 'server',
});See CONTRIBUTING.md for development setup and guidelines.
MIT
- ibutsu-server - The Ibutsu backend server
- pytest-ibutsu - Pytest plugin for Ibutsu
- ibutsu-client-ts - TypeScript client for Ibutsu API