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 Workflow

All projects can share one database. Here's how it works:

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

How It Works:

  1. Running Tests - Each project stores its test results in the shared database:

    cd project-a
    pytest  # Stores results tagged with "Project A"
    
    cd ../project-b
    pytest  # Stores results tagged with "Project B"
    
  2. Generating Dashboards - Run from ANY project to generate dashboards with ALL data:

    cd project-a
    test-report generate  # Pulls ALL projects from shared DB
    

    The generate command:

    • โœ… Reads ALL project data from the shared database
    • โœ… Generates a projects landing page showing all projects
    • โœ… Creates overview, history, and run-details dashboards
    • โœ… Data from all projects is preserved and accessible
  3. Viewing Results - The dashboards show aggregated data:

    • Projects Landing Page (index.html) - Lists all projects with health scores
    • Overview Dashboard (overview.html) - Shows metrics across all projects
    • History Dashboard (history.html) - All test runs from all projects
    • Run Details (run-details.html) - Latest run details

Key Benefits:

  • ๐Ÿ”„ Data Persistence - Running test-report generate from one project doesn't lose data from other projects
  • ๐Ÿ“Š Centralized View - See all your test projects in one place
  • ๐ŸŽฏ Project Filtering - Dashboards support filtering by project (future enhancement)
  • ๐Ÿ”’ Concurrent Safe - Multiple projects can run tests simultaneously

โš™๏ธ 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.3.0.tar.gz (49.9 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.3.0-py3-none-any.whl (56.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: test_reporting-1.3.0.tar.gz
  • Upload date:
  • Size: 49.9 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.3.0.tar.gz
Algorithm Hash digest
SHA256 fb629d4ebc1e42f8ca735d10cc5bff04a1c00ca14bd6c0307030ccb362d1c30f
MD5 441e18bd258bc00b36aa9f9421a2bf61
BLAKE2b-256 4d3dca1aa0883ed21f7ce43b49d5021cf5b5987844546b8888107c597a597f47

See more details on using hashes here.

File details

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

File metadata

  • Download URL: test_reporting-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 56.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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2f06562e1cdf06bfe021b95a4a4955267a45c62cfe1a3a20bc2b8f7b17cedb35
MD5 09b7ce6dea51af5b6b5df6b23ca246c6
BLAKE2b-256 04c961ed930ee39737396069161d3f7ed5d9ab0f10f577c1e7f5b2ed0f1b0c25

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