@supatest/playwright-reporter
v0.0.7
Published
Supatest Playwright reporter - stream test results to Supatest dashboard
Maintainers
Readme
@supatest/playwright-reporter
Playwright reporter that streams test results to Supatest in real-time. Captures comprehensive test data including steps, errors, attachments, and CI/Git context.
Install
pnpm add -D @supatest/playwright-reporterConfiguration
Add to your playwright.config.ts:
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: [
['@supatest/playwright-reporter', {
apiKey: process.env.SUPATEST_API_KEY,
projectId: process.env.SUPATEST_PROJECT_ID,
}]
]
});Environment Variables
| Variable | Description |
|----------|-------------|
| SUPATEST_API_KEY | Required. Your Supatest API key |
| SUPATEST_PROJECT_ID | Required. Your project identifier for organizing test runs |
| SUPATEST_API_URL | Optional. Custom API endpoint |
| SUPATEST_DRY_RUN | Optional. Set to true to enable dry-run mode |
Features
Test Data Collection
- Test Results: Status, duration, retry info, flaky detection
- Test Steps: Nested step hierarchy with timing and status
- Errors: Source location, stack traces, and failure details
- Console Output: stdout/stderr captured during test execution
- Attachments: Screenshots, videos, and traces metadata
Environment & Context
- OS Info: Platform, release, architecture, CPU count, RAM
- Node.js Version: Runtime environment details
- Playwright Config: Version, workers, retry strategy, parallel mode
- Browser Projects: Browser type, viewport, locale, timezone per project
- Sharding Info: Current shard and total shards
- CI Provider Detection: GitHub Actions, GitLab, Jenkins, CircleCI, Travis, Buildkite, Azure
- Git Context: Branch, commit, message, repository, author
Performance & Reliability
- Non-Blocking Uploads: Test execution continues while uploads happen in background
- Concurrent Uploads: Configurable concurrency control (default: 5 parallel)
- Retry Logic: Exponential backoff with configurable attempts
- Error Handling: Graceful degradation—reporting failures don't block tests
- Signed URL Uploads: Direct S3 uploads via signed URLs from API
Development
Running Tests
Unit Tests:
pnpm test # Run tests in watch mode
pnpm test:run # Run tests once
pnpm test:coverage # Run tests with coverageIntegration Tests:
pnpm test:integration # Build reporter and run full E2E test suiteThis will:
- Build the reporter package (
pnpm build) - Run the Playwright test suite in
reporter-test-suites/playwright-saucedemo/ - Verify data flows to your local API (requires API running on
http://localhost:9090)
Quick Development Loop:
# Terminal 1: Start local API
cd api && pnpm dev
# Terminal 2: Build reporter, run integration tests
cd playwright-reporter
pnpm test:integrationTest Suite Configuration
The integration test suite uses .env configuration:
# reporter-test-suites/playwright-saucedemo/.env
SUPATEST_API_URL=http://localhost:9090
SUPATEST_API_KEY=sk_test_...
SUPATEST_PROJECT_ID=proj_local_swaglabs
SUPATEST_DRY_RUN=falseVerifying Integration Tests
After running pnpm test:integration, you should see:
[supatest] Run <run-id> started (X tests across Y files, Z projects)[supatest] Waiting for N pending uploads...[supatest] Run <run-id> completed: passed/failed
Check your local API dashboard at http://localhost:3000 to see the test results.
