npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

playwright-enhanced-reporter

v2.1.0

Published

A comprehensive, enterprise-grade HTML reporter for Playwright with advanced analytics, trends, filtering, pagination, and export capabilities

Readme

Playwright Enhanced Reporter

A comprehensive, feature-rich HTML reporter for Playwright with analytics, charts, and BDD-style UI. This package provides detailed test execution reports with collapsible sections, dark mode, responsive design, and advanced metrics.

Features

  • 🎯 Beautiful HTML Reports - Clean, professional test execution reports
  • 📊 Rich Analytics - Pass rates, duration metrics, browser performance
  • 📈 Interactive Charts - Visual representation of test data using Chart.js
  • 🌙 Dark Mode Support - Toggle between light and dark themes
  • 📱 Responsive Design - Works perfectly on desktop and mobile
  • 🏷️ Allure-style Annotations - Support for severity, feature, and epic annotations
  • 🔍 Detailed Test Information - Including spec file paths for easy debugging
  • 📊 Error Categorization - Automatic categorization of test failures
  • 🎨 Customizable - Configurable options for title, output, and theme

Installation

npm install playwright-enhanced-reporter

Usage

Basic Configuration

Add the reporter to your playwright.config.ts:

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

export default defineConfig({
  reporter: [
    ['playwright-enhanced-reporter']
  ],
  // ... other config
});

Advanced Configuration

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

export default defineConfig({
  reporter: [
    ['playwright-enhanced-reporter', {
      outputDir: './test-results/reports',
      outputFile: 'enhanced-report.html',
      title: 'My Test Results',
      includeCharts: true,
      includeTrends: true,
      openReport: false,
      theme: 'auto' // 'light', 'dark', or 'auto'
    }]
  ],
  // ... other config
});

Configuration Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | outputDir | string | './test-results/reports' | Directory for output files | | outputFile | string | 'enhanced-report.html' | Name of the HTML report file | | title | string | 'Enhanced Test Report' | Title displayed in the report | | includeCharts | boolean | true | Include interactive charts | | includeTrends | boolean | true | Generate trends data | | openReport | boolean | false | Auto-open report after test run | | theme | string | 'auto' | Default theme ('light', 'dark', 'auto') |

Allure-style Annotations

Enhance your tests with metadata using Playwright annotations:

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

test('user login', async ({ page }) => {
  // Add severity annotation
  test.info().annotations.push({ type: 'severity', description: 'critical' });
  
  // Add feature annotation
  test.info().annotations.push({ type: 'feature', description: 'Authentication' });
  
  // Add epic annotation
  test.info().annotations.push({ type: 'epic', description: 'User Management' });
  
  // Your test code here
});

Supported Annotations

  • severity: critical, high, medium, low, normal
  • feature: Any string describing the feature being tested
  • epic: Any string describing the epic or larger feature set

Report Features

Overview Section

  • Total test count with pass/fail breakdown
  • Browser performance metrics
  • Execution time and duration information
  • Interactive pie charts for test results

Performance Metrics

  • Pass rate percentage
  • Average test duration
  • Tests per second
  • Success/failure trends

Test Details Table

  • Test name and status
  • Browser information
  • Spec file path (for easy debugging)
  • Execution duration
  • Severity and feature tags
  • Error messages for failed tests

Interactive Features

  • Collapsible panels for better organization
  • Dark/light mode toggle with persistence
  • Smooth scrolling navigation
  • Responsive design for all screen sizes

Generated Files

The reporter generates several files:

  • enhanced-report.html - Main interactive HTML report
  • detailed-report.json - Raw test data in JSON format
  • trends.json - Historical test execution data (if enabled)

Examples

Multiple Reporters

You can use this reporter alongside other Playwright reporters:

export default defineConfig({
  reporter: [
    ['list'],
    ['html'],
    ['playwright-enhanced-reporter', {
      outputDir: './reports',
      title: 'CI Test Results'
    }],
    ['junit', { outputFile: './reports/junit.xml' }]
  ],
});

CI/CD Integration

The reporter works great in CI/CD environments:

export default defineConfig({
  reporter: [
    ['playwright-enhanced-reporter', {
      outputDir: process.env.CI ? './test-results' : './reports',
      title: process.env.CI ? 'CI Test Report' : 'Local Test Report',
      theme: 'auto'
    }]
  ],
});

Development

Building from Source

git clone https://github.com/KVN0907/playwright-enhanced-reporter.git
cd playwright-enhanced-reporter
npm install
npm run build

Running Tests

npm test

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

MIT - See LICENSE file for details.

Changelog

1.0.1

  • Initial release
  • Basic HTML report generation
  • Interactive charts and analytics
  • Dark mode support
  • Responsive design
  • Allure-style annotations
  • Spec file path tracking

Support


Made with ❤️ for the Playwright testing community