Skip to main content

Beautiful multi-project test reporting dashboard system

Project description

๐Ÿš€ Test Reporting System

A beautiful, multi-project test reporting dashboard system for Playwright/Pytest with shared database support.


โœจ Features

  • ๐Ÿ“Š Beautiful Dashboards - Interactive HTML dashboards with charts and metrics
  • ๐ŸŽฏ Multi-Project Support - Multiple projects share one database
  • ๐Ÿ” Advanced Analytics - Flaky tests, failure patterns, performance tracking
  • ๐Ÿ“ˆ Trend Analysis - Track quality over time
  • ๐ŸŽจ Projects Landing Page - Overview of all your test projects
  • ๐Ÿ”’ Concurrent Safe - SQLite WAL mode for parallel test runs
  • ๐Ÿ“ฆ Easy Integration - Simple pip install and config

๐Ÿš€ Quick Start

Installation

# Install from PyPI
pip install test-reporting

# Or install from source for development
git clone https://github.com/yourusername/test-reporting.git
cd test-reporting
pip install -e .

Setup in Your Test Project

  1. Add to conftest.py:
# conftest.py
pytest_plugins = ['reporting.plugin']
  1. Create reporting.ini:
# reporting.ini
[reporting]
project_name = My Test Project
db_path = test_results.db
dashboard_dir = dashboard
retention_days = 365
  1. Run tests:
pytest
  1. Generate dashboards:
test-report generate
# or
python -m reporting.cli generate
  1. Open dashboards:
test-report open

๐Ÿ“Š Dashboards

Projects Landing Page

  • Overview of all projects
  • Health scores
  • Quick metrics
  • Click to drill down

Overview Dashboard

  • Overall health metrics
  • Module breakdown
  • Failure hotspots
  • Quality trends
  • Flaky tests
  • Performance metrics

Run Details Dashboard

  • Latest test run details
  • Test-by-test breakdown
  • Screenshots and traces
  • Error messages
  • Execution logs

Test History

  • All test runs
  • Search and filter
  • Trend analysis
  • Compare runs

๐ŸŽฏ Multi-Project Setup

Shared Database

All projects can share one database:

workspace/
โ”œโ”€โ”€ shared_test_results.db          โ† Single database
โ”‚
โ”œโ”€โ”€ project-a/
โ”‚   โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ reporting.ini               โ† project_name = Project A
โ”‚
โ”œโ”€โ”€ project-b/
โ”‚   โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ reporting.ini               โ† project_name = Project B
โ”‚
โ””โ”€โ”€ project-c/
    โ”œโ”€โ”€ tests/
    โ””โ”€โ”€ reporting.ini               โ† project_name = Project C

Each project's data is tagged with its project name. The landing page shows all projects.


โš™๏ธ Configuration

reporting.ini

[reporting]
# Required: Unique project identifier
project_name = My Test Project

# Required: Database location (can be shared across projects)
db_path = test_results.db

# Optional: Dashboard output directory (default: dashboard)
dashboard_dir = dashboard

# Optional: Data retention in days (default: 365)
retention_days = 365

Environment Variables (Alternative)

export PROJECT_NAME="My Test Project"
export DB_PATH="test_results.db"

Config file takes precedence if it exists.


๐Ÿ› ๏ธ CLI Commands

# Generate all dashboards
test-report generate

# Generate and open in browser
test-report open

# Show quick stats
test-report stats

# Show suite statistics
test-report suites

# Clean up old data
test-report cleanup

๐Ÿ“ˆ Metrics Tracked

Top 10 Quick Win Metrics:

  1. Retry Analysis - Tests that needed retries
  2. Failure Type Breakdown - Categorized failures
  3. Time to Recovery - How long failures persist
  4. Performance Regressions - Slower tests over time
  5. Failure Correlations - Tests that fail together
  6. Error Message Search - Common error patterns
  7. Test Age Analysis - Old vs new test stability
  8. Soft Fail Analysis - Timeout and flaky patterns
  9. Step-Level Failures - Where tests break
  10. Module Health - Health by test file

Core Metrics:

  • Pass rate (overall and functional)
  • Test duration
  • Flaky test detection
  • Failure hotspots
  • Quality trends
  • Module health

๐Ÿ”’ Concurrency

Uses SQLite WAL mode for safe concurrent writes:

# Multiple projects can run tests simultaneously
Project A โ†’ test_results.db โ† Safe!
Project B โ†’ test_results.db โ† Safe!
Project C โ†’ test_results.db โ† Safe!

๐ŸŽจ Screenshots

Projects Landing Page

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ๐Ÿš€ Test Automation Projects           โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ โœ… Project A                     โ”‚  โ”‚
โ”‚  โ”‚ Health Score: 95%                โ”‚  โ”‚
โ”‚  โ”‚ 120 Tests | 50 Runs              โ”‚  โ”‚
โ”‚  โ”‚ [View Dashboard โ†’]               โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ โš ๏ธ Project B                     โ”‚  โ”‚
โ”‚  โ”‚ Health Score: 78%                โ”‚  โ”‚
โ”‚  โ”‚ 85 Tests | 30 Runs               โ”‚  โ”‚
โ”‚  โ”‚ [View Dashboard โ†’]               โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ”ง Development

Setup for Development

# Clone repo
git clone https://github.com/yourusername/test-reporting.git
cd test-reporting

# Install in editable mode
pip install -e .

# Make changes
# Test in your project

Project Structure

test-reporting/
โ”œโ”€โ”€ reporting/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ plugin.py              # Pytest plugin
โ”‚   โ”œโ”€โ”€ storage.py             # Database operations
โ”‚   โ”œโ”€โ”€ config.py              # Configuration
โ”‚   โ”œโ”€โ”€ cli.py                 # CLI commands
โ”‚   โ”œโ”€โ”€ classifier.py          # Failure classification
โ”‚   โ”œโ”€โ”€ overview_dashboard.py  # Overview dashboard
โ”‚   โ”œโ”€โ”€ dashboard_generator_v2.py  # Run details
โ”‚   โ”œโ”€โ”€ history_dashboard.py   # Test history
โ”‚   โ””โ”€โ”€ projects_dashboard.py  # Projects landing
โ”œโ”€โ”€ setup.py
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ requirements.txt
โ””โ”€โ”€ .gitignore

๐Ÿ“ฆ Requirements

  • Python >= 3.9
  • pytest >= 8.0.0
  • playwright >= 1.40.0 (optional, for web tests)

๐Ÿš€ CI/CD Integration

Jenkins

stage('Run Tests') {
    steps {
        sh 'pytest'
        sh 'test-report generate'
        archiveArtifacts artifacts: 'dashboard/**/*'
    }
}

GitHub Actions

- name: Run Tests
  run: pytest

- name: Generate Reports
  run: test-report generate

- name: Upload Dashboards
  uses: actions/upload-artifact@v2
  with:
    name: test-dashboards
    path: dashboard/

๐Ÿ“ License

MIT License - See LICENSE file


๐Ÿค Contributing

  1. Fork the repo
  2. Create feature branch (git checkout -b feature/amazing-feature)
  3. Make changes
  4. Test thoroughly
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

๐Ÿ“ง Support


๐ŸŽ‰ Credits

Built with โค๏ธ for better test reporting


Happy Testing! ๐Ÿš€๐Ÿ“Šโœจ

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

test_reporting-1.2.2.tar.gz (48.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

test_reporting-1.2.2-py3-none-any.whl (55.2 kB view details)

Uploaded Python 3

File details

Details for the file test_reporting-1.2.2.tar.gz.

File metadata

  • Download URL: test_reporting-1.2.2.tar.gz
  • Upload date:
  • Size: 48.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for test_reporting-1.2.2.tar.gz
Algorithm Hash digest
SHA256 03308a90d9b8929ae24e6de3f76ad554e924fccc70a000e72e21c0f73aafb0a0
MD5 659931537e0bb6e4c1fc78f58d5c6b16
BLAKE2b-256 bd32075651884375408ff0074b03febb9b165b3b1d553193b3cb31a1e1f243fa

See more details on using hashes here.

File details

Details for the file test_reporting-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: test_reporting-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 55.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for test_reporting-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d98b692a09aea235cf1ff910fb41bcf6ad840fb49e7851edbad80c33bb1927e3
MD5 30d71272f84dfd7cd453054d57f99ae8
BLAKE2b-256 f66fde1a70972dc6f63049b89332d7f9519fa0e4901b99161f1400e08c332767

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page