1.5.2 • Published 7 months ago

playwright-ci-reporter v1.5.2

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

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:

  1. Fork the repository
  2. Create your feature branch:
    git checkout -b feature/amazing-feature
  3. Make your changes and commit them:
    git commit -m 'Add some amazing feature'
  4. Push to your fork:
    git push origin feature/amazing-feature
  5. 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
1.5.2

7 months ago

1.5.1

9 months ago

1.5.0

9 months ago

1.4.0

9 months ago

1.3.1

9 months ago

1.3.0

9 months ago

1.2.1

9 months ago

1.2.0

9 months ago

1.1.19

9 months ago

1.1.18

9 months ago

1.1.17

9 months ago

1.1.16

9 months ago

1.1.15

9 months ago

1.1.14

9 months ago

1.1.13

9 months ago

1.1.12

9 months ago

1.1.11

9 months ago

1.1.10

9 months ago

1.1.9

9 months ago

1.1.8

9 months ago

1.1.7

9 months ago

1.1.6

9 months ago

1.1.5

10 months ago

1.1.4

10 months ago

1.1.3

10 months ago

1.1.2

10 months ago

1.1.1

10 months ago

1.1.0

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago