Skip to main content

Enterprise-grade BDD test reporting with interactive dashboards, suite management, and comprehensive email integration

Project description

๐Ÿ“Š pytest-bdd-reporter

Enterprise-grade BDD test reporting with interactive dashboards, suite management, and comprehensive email integration.

Python pytest License

๐ŸŽฏ Key Features

  • ๐Ÿ“Š Interactive Dashboards - Professional Robot Framework-style reports
  • ๐Ÿ“ง Universal Email Integration - Text-based reports for all email providers
  • ๐Ÿ“ฆ Suite Management - Organize and run tests by logical suites
  • ๐ŸŽ›๏ธ Status Management - Override test results with interactive UI
  • ๐Ÿ“ฑ Mobile Responsive - Works perfectly on all devices
  • ๐Ÿ” Advanced Filtering - Search, filter, and analyze test results
  • ๐Ÿ“‹ Comprehensive Logging - Capture and display detailed execution logs
  • ๐ŸŽจ Professional Design - Corporate-grade appearance for stakeholders

๐Ÿš€ Quick Start

Installation

pip install pytest-bdd-reporter

Basic Usage

# Run tests with BDD reporting
pytest --bdd-report-dir=reports

# Run specific test suite
pytest --suite=smoke_tests --bdd-report-dir=reports

# Generate email-friendly reports
pytest --bdd-email-report --bdd-report-dir=reports

Generated Reports

After running tests, you'll find these reports in your output directory:

  • bdd_report.html - Interactive main dashboard
  • text_email_report.html - Text-based email report
  • bdd_log.html - Detailed execution logs
  • bdd_report.json - Machine-readable data

๐Ÿ“Š Report Features

Interactive Dashboard

<!-- Enhanced 8-column test table -->
| Test Name | Status | Duration | Suite | Tags | Start Time | Logs | Actions |
|-----------|--------|----------|-------|------|------------|------|---------|
| test_login | PASSED | 0.123s | smoke_tests | auth,critical | 14:30:15 | ๐Ÿ“‹ Logs | ๐Ÿ“„ Details |

Features:

  • Real-time search across all columns
  • Status filtering (Pass/Fail/Skip)
  • Performance indicators (FAST/SLOW)
  • Interactive actions (Copy error, View logs)
  • Suite statistics with logs column

Text Email Reports

Perfect for stakeholder communication with universal email compatibility:

๐Ÿ“ง SUBJECT: smoke_tests Report : 2025:10:13: Total : 10 ; Pass : 9: Fail : 1 ; PassWExcep: 0

๐Ÿ“Š EXECUTIVE SUMMARY
------------------------------
Suite Name      : smoke_tests
Test Date       : 2025-10-13
Total Tests     : 10
Passed Tests    : 9
Failed Tests    : 1
Pass Rate       : 90.0%

๐Ÿ“‹ COMPLETE TEST RESULTS
------------------------------
| # | Test Name                    | Status  | Duration | Suite           | Tags        |
|---|------------------------------|---------|----------|-----------------|-------------|
|  1 | test_user_login              | PASSED  |    0.123s | smoke_tests     | auth        |
|  2 | test_navigation              | FAILED  |    2.456s | smoke_tests     | ui          |

๐Ÿ“ฆ Suite Management

Organize tests into logical suites with setup/teardown support:

Define Test Suites

from pytest_bdd_reporter.suite_manager import suite, suite_setup, suite_teardown

@suite(
    name="smoke_tests",
    description="Critical functionality tests",
    tests=["test_login", "test_navigation"],
    tags=["smoke", "critical"]
)
def smoke_suite_config():
    pass

@suite_setup("smoke_tests")
def setup_smoke_environment():
    print("๐Ÿ”ง Setting up smoke test environment")
    # Initialize test data, start services, etc.

@suite_teardown("smoke_tests")
def cleanup_smoke_environment():
    print("๐Ÿงน Cleaning up smoke test environment")
    # Stop services, clean data, etc.

Run Specific Suites

# List available suites
pytest --list-suites

# Run smoke tests only
pytest --suite=smoke_tests

# Run multiple suites
pytest --suite=smoke_tests,regression_tests

# Run with custom report directory
pytest --suite=smoke_tests --bdd-report-dir=smoke_reports

๐ŸŽ›๏ธ Interactive Status Management

Override test results with the built-in status management panel:

// Available in the web interface
- Override test status (Pass/Fail/Skip)
- Add bug tracking information
- Provide override reasons
- Export updated results

Features:

  • Visual status override with dropdown selection
  • Bug ID assignment with priority levels
  • Reason tracking for audit trails
  • Real-time updates reflected in reports

๐Ÿ“ง Email Integration

Multiple Email Formats

  1. Text-based (Recommended) - Universal compatibility
  2. HTML format - Rich formatting for modern clients
  3. Executive summary - Key metrics only

Email Features

# Email subject format (automatically generated)
"suite_name Report : YYYY:MM:DD: Total : X ; Pass : Y: Fail : Z ; PassWExcep: W"

# Example
"smoke_tests Report : 2025:10:13: Total : 10 ; Pass : 9: Fail : 1 ; PassWExcep: 0"

Copy Options:

  • ๐Ÿ“ง Copy Subject - Email subject line only
  • ๐Ÿ“ Copy Complete Report - Full text report
  • โœ‰๏ธ Open Email Client - Direct email integration
  • ๐Ÿ“Š Copy Summary - Executive summary only

๐Ÿ”ง Configuration

Command Line Options

# Basic reporting
pytest --bdd-report-dir=reports

# Email reports
pytest --bdd-email-report

# Suite selection
pytest --suite=suite1,suite2

# List available suites
pytest --list-suites

# Override test status
pytest --bdd-override-status="test_name:passed:Business approved"

Suite Configuration File

Create suite_config.json for persistent suite definitions:

{
  "smoke_tests": {
    "name": "smoke_tests",
    "description": "Critical functionality tests",
    "tests": ["test_login", "test_navigation"],
    "tags": ["smoke", "critical"],
    "enabled": true,
    "priority": 1
  },
  "regression_tests": {
    "name": "regression_tests",
    "description": "Comprehensive regression testing",
    "tests": ["test_*"],
    "tags": ["regression"],
    "enabled": true,
    "priority": 2
  }
}

๐Ÿ“ฑ Mobile & Responsive Design

All reports are fully responsive and work perfectly on:

  • Desktop browsers (Chrome, Firefox, Safari, Edge)
  • Tablet devices (iPad, Android tablets)
  • Mobile phones (iOS, Android)
  • Print media (PDF generation, printing)

๐ŸŽจ Customization

Report Styling

The reports use professional styling with:

  • Corporate color scheme (Blue, green, red indicators)
  • Clean typography (Arial font family)
  • Responsive layout (CSS Grid and Flexbox)
  • Print-friendly design

Custom Templates

You can customize report templates by modifying:

  • templates/report.html - Main dashboard
  • templates/text_email_report.html - Email reports
  • templates/log.html - Detailed logs

๐Ÿงช Examples

Basic BDD Test

import pytest
from pytest_bdd import scenarios, given, when, then

scenarios('features/login.feature')

@given("I have a user account")
def user_account():
    return {"username": "test_user", "password": "test_pass"}

@when("I attempt to login")
def attempt_login(user_account):
    # Login logic here
    return login(user_account["username"], user_account["password"])

@then("I should be logged in successfully")
def verify_login(attempt_login):
    assert attempt_login.success
    assert attempt_login.user_id is not None

Suite-based Testing

from pytest_bdd_reporter.suite_manager import suite, suite_setup

@suite(
    name="api_tests",
    description="API endpoint testing",
    tests=["test_get_users", "test_create_user", "test_update_user"],
    tags=["api", "integration"]
)
def api_suite():
    pass

@suite_setup("api_tests")
def setup_api_tests():
    # Start test server, initialize database, etc.
    pass

def test_get_users():
    # Test implementation
    pass

๐Ÿ“Š Report Structure

Main Dashboard Sections

  1. Report Summary - Key metrics and suite information
  2. Test Statistics - Pass/fail counts and percentages
  3. Suite Statistics - Breakdown by test suites
  4. Test Details - 8-column detailed test table
  5. Suite Details - Expandable suite information

Email Report Sections

  1. Executive Summary - Key metrics for stakeholders
  2. Failed Tests - Detailed failure information (when applicable)
  3. Complete Test Results - Table format with all tests
  4. Suite Breakdown - Statistics by suite (for multiple suites)
  5. Key Metrics - Performance and success indicators

๐Ÿ” Advanced Features

Search and Filtering

  • Real-time search across test names, suites, and tags
  • Status filtering (All, Pass, Fail, Skip)
  • Suite filtering for focused views
  • Performance filtering (Fast, Slow tests)

Performance Analysis

  • Duration tracking with FAST/SLOW indicators
  • Performance metrics (Average, fastest, slowest tests)
  • Trend analysis across test runs
  • Resource usage monitoring

Integration Support

  • CI/CD pipelines (Jenkins, GitHub Actions, GitLab CI)
  • Bug tracking (Jira, Azure DevOps, GitHub Issues)
  • Notification systems (Slack, Teams, Email)
  • Test management tools integration

๐Ÿ› ๏ธ Development

Requirements

  • Python 3.7+
  • pytest 6.0+
  • pytest-bdd (for BDD scenarios)

Installation for Development

git clone https://github.com/your-repo/pytest-bdd-reporter.git
cd pytest-bdd-reporter
pip install -e .

Running Tests

# Run the test suite
pytest examples/

# Run with reporting
pytest examples/ --bdd-report-dir=test_reports

# Run specific suite
pytest examples/ --suite=demo_suite

๐Ÿ“„ License

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

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

๐Ÿ“ž Support

For questions, issues, or feature requests, please open an issue on GitHub.


pytest-bdd-reporter - Professional BDD test reporting for enterprise teams. ๐Ÿš€

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

pytest_bdd_reporter-1.0.0.tar.gz (77.6 kB view details)

Uploaded Source

Built Distribution

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

pytest_bdd_reporter-1.0.0-py3-none-any.whl (52.7 kB view details)

Uploaded Python 3

File details

Details for the file pytest_bdd_reporter-1.0.0.tar.gz.

File metadata

  • Download URL: pytest_bdd_reporter-1.0.0.tar.gz
  • Upload date:
  • Size: 77.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for pytest_bdd_reporter-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d8e81486f3769cc2e5e8868a7fc688434a6e82a609e873eeea5e5d02802f8a34
MD5 f2d2ca923d3001dfea731f3f3c81f821
BLAKE2b-256 efd747351d6f3c4f6156498ed08efbd8b7d6635c704f41712f7870a673a95924

See more details on using hashes here.

File details

Details for the file pytest_bdd_reporter-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_bdd_reporter-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c31ac14215680c93393306d3d8fa3e3860c67a4c38140af455b9f51427d32a9
MD5 b4a19a0e621cf3aa08afe5a6f7f9c4de
BLAKE2b-256 5a09c2d8f20eaeaa4a5ff93389401d728779f652d28e20c2fff37b201ad9de9a

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