๐Ÿš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more โ†’
Socket
Sign inDemoInstall
Socket

playwright-ci-reporter

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

playwright-ci-reporter

A CI-friendly custom reporter for Playwright tests with enhanced logging.

1.5.3
latest
Source
npm
Version published
Weekly downloads
1.1K
28.46%
Maintainers
1
Weekly downloads
ย 
Created
Source

Playwright CI Reporter

A modern, maintainable custom reporter for Playwright tests that enhances your test output with colorized results, comprehensive metrics, and intelligent failure analysis. Perfect for CI/CD pipelines and local development.

โœจ Features

  • ๐ŸŽจ Smart Colorized Output:

    • โœ… Passed tests (Green)
    • โŒ Failed tests (Red)
    • ๐Ÿ”„ Retry attempts (Yellow)
    • โš ๏ธ Skipped tests (Gray)
    • ๐Ÿš€ Test run status (Bright Magenta)
  • ๐Ÿ“Š Comprehensive Metrics:

    • Total execution time with smart formatting
    • Average test duration analysis
    • Slowest test identification
    • Top slowest tests ranking
    • Pass/fail/skip statistics
  • ๐Ÿ›  Advanced Features:

    • Configurable slow test thresholds
    • Timeout warnings
    • Stack trace controls
    • Retry attempt tracking
    • Manual testing reminders for skipped tests
  • ๐Ÿ“ Intelligent Reporting:

    • Detailed failure analysis
    • Clear error messages
    • Formatted stack traces
    • Test timing insights
    • Skipped test warnings

๐Ÿš€ Installation

Install the package using npm:

npm install playwright-ci-reporter

Usage

Integrate the playwright-ci-reporter into your Playwright configuration file (playwright.config.ts):

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

export default defineConfig({
    testDir: './tests', // Adjust to your test directory
    retries: 2, // Example of using retries
    reporter: [['playwright-ci-reporter']],
    use: {
        trace: 'on-first-retry', // Example: trace only on retries
        video: 'on-first-retry',
        screenshot: 'only-on-failure',
    },
});

๐Ÿ“‹ Output Examples

Successful Run

๐Ÿš€ Starting test run: 3 tests using 2 workers
โœ… Login test passed in 1.23s
โœ… API integration test passed in 2.45s
โš ๏ธ Payment test was skipped

โœ… All 3 tests passed | 1 skipped | โฑ Total: 3.68s

Additional Metrics:
- Average passed test time: 1.84s
- Slowest test took: 2.45s
- Top 3 slowest tests:
  1. API integration test: 2.45s
  2. Login test: 1.23s

โš ๏ธ Warning: 1 test was skipped.
   Please ensure to test the skipped scenarios manually before deployment.

Failed Run

๐Ÿš€ Starting test run: 3 tests using 2 workers
โœ… Login test passed in 1.23s
โŒ API test failed in 2.45s
๐Ÿ”„ Retry attempt for "API test" (failed) in 2.50s
โš ๏ธ Payment test was skipped

โŒ 1 of 3 tests failed | 1 passed | 1 skipped | โฑ Total: 6.18s

Failures:
--- Failure #1 ---
  Test: API test
  Stack Trace:
    at Connection.connect (/src/api/connection.ts:45:7)

๐Ÿค Contributing

We welcome contributions! Here's how you can help:

  • Fork the repository
  • Create your feature branch:
    git checkout -b feature/amazing-feature
    
  • Make your changes and commit them:
    git commit -m 'Add some amazing feature'
    
  • Push to your fork:
    git push origin feature/amazing-feature
    
  • Open a Pull Request

Please ensure your PR:

  • Follows the existing code style
  • Includes appropriate tests
  • Updates documentation as needed
  • Describes the changes made

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Built with Playwright
  • Inspired by the need for better test reporting in CI/CD pipelines
  • Thanks to all contributors who help make this reporter better

Keywords

playwright

FAQs

Package last updated on 28 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts