npm package: @kubaszy/playwright-test-manager-reporter
Description: Official Playwright test reporter for Playwright Test Manager
Author: kubaszy
Latest version: 1.0.0

# @playwright-test-manager/reporter

Official Playwright test reporter for Playwright Test Manager - track your test results, identify flaky tests, and monitor test performance over time.

## Installation

npm install --save-dev @playwright-test-manager/reporter


## Quick Start

### 1. Get Your API Key

1. Sign up at [Playwright Test Manager](https://your-app-url.com)
2. Create a project
3. Copy your API key from project settings

### 2. Configure Playwright

Add the reporter to your `playwright.config.ts`:

import { defineConfig } from '@playwright/test';

export default defineConfig({
reporter: [
['list'], // Keep default console output
['@playwright-test-manager/reporter', {
apiKey: 'your-api-key-here',
apiUrl: 'https://backend-production-34fb.up.railway.app', // optional
}]
],
// ... rest of your config
});


### 3. Run Your Tests


Your test results will be automatically uploaded to Playwright Test Manager! 🎉

## Configuration Options

| Option | Type | Required | Default | Description |
|--------|------|----------|---------|-------------|
| `apiKey` | `string` | ✅ Yes | - | Your project API key |
| `apiUrl` | `string` | ❌ No | Production URL | Custom backend URL |
| `enabled` | `boolean` | ❌ No | `true` | Enable/disable reporter |

## Features

- 📊 **Test History** - Track test results over time
- 🔍 **Flaky Test Detection** - Automatically identify unreliable tests
- 📈 **Performance Monitoring** - Monitor test duration trends
- 🌳 **Branch Tracking** - Compare results across branches
- 🚀 **CI/CD Integration** - Works with GitHub Actions, GitLab CI, CircleCI, and more

## CI/CD Setup

The reporter automatically detects CI environments and captures metadata:

### GitHub Actions

name: Run Playwright tests
run: npx playwright test
env:
PTM_API_KEY: ${{ secrets.PTM_API_KEY }}

Update your `playwright.config.ts`:

reporter: [
['@playwright-test-manager/reporter', {
apiKey: process.env.PTM_API_KEY || '',
}]
]


## Example Output
🎭 Playwright Test Manager Reporter initialized
Run ID: 550e8400-e29b-41d4-a716-446655440000
API URL: https://backend-production-34fb.up.railway.app
Branch: main

🚀 Starting test run 550e8400-e29b-41d4-a716-446655440000
✅ Login test (1234ms)
✅ Dashboard test (2345ms)
❌ Profile test (3456ms)

📤 Sending 3 test results...
✅ Sent 3 test results

✨ Test run completed successfully!
Total: 3 tests
Passed: 2 ✅
Failed: 1 ❌
Skipped: 0 ⏭️
Duration: 7.04s
View results: https://your-app-url.com/runs/550e8400-e29b-41d4-a716-446655440000


## Troubleshooting

### Reporter not sending results

1. Check your API key is correct
2. Verify backend URL is accessible
3. Check console output for error messages

### Results not appearing in dashboard

1. Ensure you're logged into the correct project
2. Check project API key matches the one in config
3. Verify network connectivity to backend

## Support

- 📖 [Documentation](https://github.com/kubaszy/PlaywrightTestManager)
- 🐛 [Report Issues](https://github.com/kubaszy/PlaywrightTestManager/issues)
- 💬 [Discussions](https://github.com/kubaszy/PlaywrightTestManager/discussions)

## License

MIT © kubaszy