The Playwright Test Results Badge: Monitor Your CI/CD Directly from Chrome
Overview
The Playwright Browser Extension is a lightweight Chrome extension that shows your Playwright CI/CD test status directly from your browser toolbar — no more switching between tabs and dashboards. 100% free & open-source with failed test details, dark mode, GitHub Pages & AWS S3 support, AI-powered setup, and now a fully customizable polling interval (v1.13).
Latest Release Highlights
Set Up With AI — Skip the Steps Below
Using Cursor, GitHub Copilot, Claude, or any AI assistant? Just copy the prompt below and paste it into your AI chat. It will set everything up for you automatically — no manual reading required.
You are an AI coding assistant. I want to set up the Playwright Browser Extension integration in this repository so the Chrome extension can monitor my test results in real time.
Please do the following steps exactly:
## STEP 1 — Create the custom reporter file
Create a file called `generate_summary.js` in the project root with this exact content:
```js
// generate_summary.js
const fs = require('fs');
class SummaryReporter {
onBegin(config, suite) {
this.rootSuite = suite;
}
onEnd(result) {
const summary = {
schemaVersion: 1,
passed: 0,
failed: 0,
flaky: 0,
total: 0,
startTime: new Date().toISOString(),
isSummary: true,
failedTests: []
};
if (this.rootSuite) {
for (const test of this.rootSuite.allTests()) {
const status = test.outcome();
if (status === 'expected') summary.passed++;
if (status === 'unexpected') {
summary.failed++;
summary.failedTests.push(test.title);
}
if (status === 'flaky') summary.flaky++;
}
}
summary.total = summary.passed + summary.failed + summary.flaky;
fs.writeFileSync('test-summary.json', JSON.stringify(summary, null, 2));
console.log('✅ Automatic summary created: test-summary.json');
}
}
module.exports = SummaryReporter;
```
## STEP 2 — Update playwright.config.ts
In `playwright.config.ts`, add `./generate_summary.js` to the reporters array. Keep any existing reporters. Example:
```ts
reporter: [
['./generate_summary.js'],
['list'],
['html'],
],
```
## STEP 3 — First, ask me: "Is your repository public, private, or an organization repo?"
Then apply the correct option below. Do NOT proceed without knowing this.
**Option A — Public Repository (No GitHub Pages needed)**
Use this ONLY if the repo is public. The raw GitHub URL is publicly accessible, so no deployment is needed.
- Create `.github/workflows/playwright.yml` that runs `npx playwright test` and commits `test-summary.json` directly back to the repo using `contents: write` permission and `[skip ci]` to prevent infinite loops.
- NO GitHub Pages setup is needed for public repos.
→ The extension URL will be the Raw GitHub URL of `test-summary.json` in the repo:
`https://raw.githubusercontent.com/USERNAME/REPO/main/test-summary.json`
Ask me for the GitHub username and repo name to build the exact URL.
**Option B — Private or Organization Repository (GitHub Pages deployment required)**
- Create `.github/workflows/playwright.yml` that:
1. Runs `npx playwright test`
3. Deploys the `public/` folder to GitHub Pages using `actions/deploy-pages`
4. Requires permissions: `contents: write`, `pages: write`, `id-token: write`
- Remind me to enable GitHub Pages: repo Settings → Pages → Source: GitHub Actions → Save
This file is served publicly by GitHub Pages even if the repo is private.
Ask me for the GitHub username and repo name to build the exact URL.
**Option C — AWS S3 (Alternative for teams already using AWS)**
→ The extension URL will be the public S3 object URL:
## STEP 4 — When all files are created, end your response with this exact formatted summary:
---
### ✅ Setup Complete — Here's What To Do Next
**Files created/modified:**
- [list each file]
**Your Extension URL:**
[The exact URL to paste — no placeholders. E.g.: https://raw.githubusercontent.com/myuser/myrepo/main/test-summary.json]
**Remaining manual steps:**
1. [e.g., Go to GitHub repo → Settings → Pages → Source: GitHub Actions → Save]
2. [e.g., Push your changes to trigger the first CI run]
3. Open the Chrome extension → click the ⚙️ gear icon → paste the URL above into "Results JSON URL" → click Save
4. Wait for the CI pipeline to finish, then click the extension icon to see your live results
**You're all set! The extension badge will turn green when tests pass and red when they fail.**
---
## IMPORTANT RULES:
- Do NOT modify any existing test files
- Do NOT install new npm packages unless absolutely necessary
- If `generate_summary.js` already exists, check if it matches and skip if identical
- If `playwright.config.ts` already has a reporter array, merge — do not replace
- Always use `if: always()` in CI steps so results upload even when tests fail
What the Extension Does
Live Toolbar Badge
The badge stays visible at all times, providing a quick health check of your project:
Detailed Popup View
Click the extension icon in your browser toolbar to see a comprehensive breakdown:
- Total number of tests executed
- Verified Passed tests
- Failed test counts
- Names of failing tests displayed directly in the popup
- Automated HTML Dashboard generation
- Last updated timestamp and Manual Refresh button
Quick Setup Guide (6 Steps)
Follow these steps to integrate the badge with your Playwright project today.
Step 1: Install Playwright
If you are starting a new project, run: npm init playwright@latest
- Choose TypeScript for the best experience.
- Choose true for "Add a GitHub Actions workflow".
This will create example tests and a default .yml file that you will replace in Step
4.
Step 2: Create the Summary Reporter
Create summary-reporter.js in your project root. This converts heavy reports into a
lightweight 1KB JSON.
const fs = require('fs');
class SummaryReporter {
onBegin(config, suite) {
this.rootSuite = suite;
}
onEnd(result) {
const summary = {
schemaVersion: 1,
passed: 0,
failed: 0,
flaky: 0,
total: 0,
startTime: new Date().toISOString(),
isSummary: true,
failedTests: [] // 👈 NEW: Added array to hold names
};
if (this.rootSuite) {
for (const test of this.rootSuite.allTests()) {
const status = test.outcome();
if (status === 'expected') summary.passed++;
if (status === 'unexpected') {
summary.failed++;
summary.failedTests.push(test.title); // 👈 NEW: Push failing test name
}
if (status === 'flaky') summary.flaky++;
}
}
summary.total = summary.passed + summary.failed + summary.flaky;
fs.writeFileSync('test-summary.json', JSON.stringify(summary, null, 2));
console.log('✅ Automatic summary created: test-summary.json');
}
}
module.exports = SummaryReporter;
Step 3: Configure Playwright
Update your playwright.config.ts to include your new custom reporter.
// ... other imports
reporters: [
['./summary-reporter.js'], // Add this line
['html'], // Keep your existing reporters
['list']
],
Step 4: Create GitHub Actions Workflow
Automate the test run and summary update. Ensure contents: write permission is
enabled.
name: Playwright Tests
on: [push, pull_request]
permissions:
contents: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Run tests
run: npx playwright test
- name: Update test results
if: always()
run: |
git config user.name "Actions Bot"
git config user.email "actions@github.com"
git add test-summary.json
git diff --staged --quiet || git commit -m "chore: update results [skip ci]"
git push
Step 5: Initialize Your Summary
Run your tests locally one time (npx playwright test) to create the
test-summary.json file, then commit and push it to your repository.
Tip: You can use the example tests that come with Playwright to verify the
badge immediately!
Step 6: Connect & Test
Copy the "Raw" URL of your test-summary.json and paste it into the extension
settings.
Monitoring Private Repositories
By design, this extension does not request your GitHub Personal Access Tokens. This keeps your account secure but means it cannot directly access private repository files.
Step-by-Step Configuration
1. Enable GitHub Pages
Go to your repository Settings → Pages. Under "Build and deployment", set the Source to GitHub Actions as shown below.
2. Use the Complete Workflow
Copy and paste this workflow into .github/workflows/playwright.yml. It handles
testing, result commitment, and Pages deployment automatically while generating a beautiful HTML
dashboard.
The workflow above generates an automated dashboard like this:
3. Initialize Your Summary
Run npx playwright test locally, then commit and push the generated
test-summary.json file to GitHub.
4. Connect & Verify
Once the workflow finishes, you can verify the deployment status in your repository settings as shown below:
• ❌ Incorrect:
https://username.github.io/repo/
Alternative: Deploy to AWS S3
If you prefer AWS over GitHub Pages, you can deploy your test results to an S3 bucket. This gives you full control over your infrastructure and works great for teams already using AWS.
Step-by-Step AWS S3 Configuration
1. Create an S3 Bucket
Create a new S3 bucket (e.g., my-test-results) in your preferred AWS region.
2. Configure S3 Bucket Permissions
a) Block Public Access: Go to your bucket → Permissions tab → Block public access → Edit → Uncheck all boxes → Save → Confirm
b) Bucket Policy: Go to Bucket policy → Edit → Paste this policy (replace YOUR-BUCKET-NAME):
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::YOUR-BUCKET-NAME/*"
}
]
}
c) CORS Configuration: Go to CORS configuration → Edit → Paste:
[
{
"AllowedHeaders": ["*"],
"AllowedMethods": ["GET", "HEAD"],
"AllowedOrigins": ["*"],
"ExposeHeaders": [],
"MaxAgeSeconds": 3000
}
]
3. Set Up AWS Credentials in GitHub Secrets
Go to your repository → Settings → Secrets and variables → Actions → New repository secret
Add these three secrets:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_DEFAULT_REGION (e.g., us-east-1)
4. Create AWS S3 Deployment Workflow
Create .github/workflows/playwright.yml with this content:
name: Deploy Test Results to AWS S3
on:
push:
branches: [main]
workflow_dispatch:
jobs:
test-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Install Playwright
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- name: Upload results to AWS S3
if: always()
run: |
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
5. Connect & Monitor
Paste this URL into the extension popup and click Save!
Workflow & Best Practices
The extension is designed to work with any CI tool including GitHub Actions, GitLab CI, Jenkins, and CircleCI.
if: always(). This ensures the summary file is updated even when tests fail, which is
exactly when you need the badge most!
Permissions Explained
- storage: To save your configured JSON URL locally.
- alarms: To handle the configurable background refresh polling (default 1 minute, adjustable up to 1440 minutes in settings).
- file access (optional): Required only if you're monitoring a
test-summary.jsonon your local machine.
Troubleshooting common issues
Check if test-summary.json
exists and contains "isSummary": true. Verify the URL is public or reachable.
Confirm your GitHub Workflow has
contents: write permissions and that [skip ci] is used to avoid
infinite loops.
Boost Your Testing Productivity
Get the extension for free and keep your test health visible at all times.