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.1.3.tar.gz (44.4 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.1.3-py3-none-any.whl (50.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: test_reporting-1.1.3.tar.gz
  • Upload date:
  • Size: 44.4 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.1.3.tar.gz
Algorithm Hash digest
SHA256 7845d068a837ea6012691b91897bd6a6b0539a05815c1c98cb48cae98df4f385
MD5 3a47d848fdedfde98b820677a4474963
BLAKE2b-256 36bd44d915bdbf31ec8a9a30e485e7a807ddd1ec198f65a3f553bc199af397d7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: test_reporting-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 50.9 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.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 04f2267b050cf638734698e76d22906ac82573c297b57c65d587b5c188db484a
MD5 df6d919ad26b0c63e2c3a63882182cc1
BLAKE2b-256 93b59fbfe3e9516413a72ed82e4bdb46fe83aca2505a6c834aab8b80b6d1a8fb

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