Skip to main content

Playwright Playwright Reporter

Send your Playwright test results directly to TestPig.io with our dedicated reporter.

Perfect Match

Playwright + TestPig.io = Modern browser test reporting!

Quick Installation ⚡

npm install @testpig/playwright-reporter --save-dev

Configuration 🛠️

Step 1: Add the Reporter to Your Configuration File (Required)

First, add the TestPig.io reporter to your Playwright configuration:

import { defineConfig } from '@playwright/test';

export default defineConfig({
reporter: [
['@testpig/playwright-reporter']
],
// Other Playwright config options...
});

Step 2: Point Reporter to TestPig

Set these environment variables for maximum flexibility:

export TESTPIG_PROJECT_ID=your-project-id
export TESTPIG_RUN_ID=your-run-id # Optional
export TESTPIG_API_KEY=your-api-key

Your Playwright config remains clean with just the reporter definition as shown above.

Method 2: Configuration File Options

Alternatively, specify credentials directly in your playwright.config.ts:

import { defineConfig } from '@playwright/test';

export default defineConfig({
reporter: [
['@testpig/playwright-reporter', {
projectId: 'your-project-id',
runId: 'your-run-id', // Optional
apiKey: 'your-api-key'
}]
],
// Other Playwright config options...
});

Using It Is a Breeze 🌬️

Run your Playwright tests as usual:

npx playwright test

That's it! Your results will magically appear in your TestPig.io dashboard.

Awesome Features You'll Love ❤️

  • Detailed Step Reporting: Every action beautifully documented
  • Visual Evidence: Automatic integration of screenshots and videos
  • Trace Viewer Support: Powerful debugging with trace files
  • Multi-browser Coverage: Comprehensive reporting across all browsers
  • Test Tagging: Organize tests with metadata for better analysis

Configuration Options At-a-Glance 📋

OptionWhat It DoesRequired?
projectIdLinks results to your TestPig.io project✅ Yes
runIdGroups tests under a single run identifier❌ No
apiKeyYour secure access key to TestPig.io✅ Yes
includeAttachmentsInclude screenshots and videos (default: true)❌ No
includeTracesInclude trace files (default: false)❌ No
Want More Options?

Check our Best Practices guide for advanced configuration strategies.

CI/CD Integration

For CI/CD environments, you can set the environment variables in your pipeline configuration:

# Example GitHub Actions configuration
env:
TESTPIG_PROJECT_ID: ${{ secrets.TESTPIG_PROJECT_ID }}
TESTPIG_RUN_ID: ${{ github.ref_name }}
TESTPIG_API_KEY: ${{ secrets.TESTPIG_API_KEY }}

Getting Help

If you encounter issues with the Playwright reporter:

Troubleshooting

If you encounter issues:

  1. Verify your API key is correct
  2. Check your project ID is valid
  3. Ensure your network allows outbound connections to TestPig
  4. Check the Playwright logs for any error messages
  5. Try running with --debug flag for more detailed output

Best Practices

  1. Use environment variables for sensitive information
  2. Set meaningful run IDs for better organization
  3. Consider using CI/CD environment variables for automated runs
  4. Regularly update the reporter package for the latest features and bug fixes
  5. Use the --retries option to handle flaky tests
  6. Configure appropriate timeouts for your test environment