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.
๐ฏ 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 dashboardtext_email_report.html- Text-based email reportbdd_log.html- Detailed execution logsbdd_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
- Text-based (Recommended) - Universal compatibility
- HTML format - Rich formatting for modern clients
- 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 dashboardtemplates/text_email_report.html- Email reportstemplates/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
- Report Summary - Key metrics and suite information
- Test Statistics - Pass/fail counts and percentages
- Suite Statistics - Breakdown by test suites
- Test Details - 8-column detailed test table
- Suite Details - Expandable suite information
Email Report Sections
- Executive Summary - Key metrics for stakeholders
- Failed Tests - Detailed failure information (when applicable)
- Complete Test Results - Table format with all tests
- Suite Breakdown - Statistics by suite (for multiple suites)
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8e81486f3769cc2e5e8868a7fc688434a6e82a609e873eeea5e5d02802f8a34
|
|
| MD5 |
f2d2ca923d3001dfea731f3f3c81f821
|
|
| BLAKE2b-256 |
efd747351d6f3c4f6156498ed08efbd8b7d6635c704f41712f7870a673a95924
|
File details
Details for the file pytest_bdd_reporter-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pytest_bdd_reporter-1.0.0-py3-none-any.whl
- Upload date:
- Size: 52.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c31ac14215680c93393306d3d8fa3e3860c67a4c38140af455b9f51427d32a9
|
|
| MD5 |
b4a19a0e621cf3aa08afe5a6f7f9c4de
|
|
| BLAKE2b-256 |
5a09c2d8f20eaeaa4a5ff93389401d728779f652d28e20c2fff37b201ad9de9a
|