The modern, beautiful, single-file HTML report formatter for Behave.
Project description
Behave Modern HTML Report
The modern, beautiful, single-file HTML report formatter for Behave. Dark mode, charts, instant search, attachments, zero external requests.
behave-modern-html-report is a drop-in formatter for Behave that produces a single,
self-contained HTML file — everything (CSS, JS, fonts, icons, attachments) is
embedded so the report works offline, on any machine, forever.
Features
- 🌓 Dark / Light / Auto themes, modern Material-3 inspired UI
- 📊 Interactive charts (status pie, duration histogram, slowest scenarios, tag pass rate, timeline) — pure vanilla JS, no Chart.js CDN
- 🏷️ Tag analytics page: per-tag counts, pass rate, duration, and a dedicated chart
- � Gherkin Rules support: scenarios under a
Ruleare grouped and tagged correctly (Behave 1.3.x) - �🔍 Instant client-side search across features, scenarios, steps and tags
- 🎚️ Filter by status with one click
- 📁 Expandable features → scenarios → steps with rich metadata
- 🧯 Modern error viewer with copy-to-clipboard tracebacks
- 🖼️ Attachments: images (with lightbox), JSON, text, binaries
- 🚀 Copy-reproduce-command per scenario (
behave features/example.feature:3) - 📊 Inline step duration bars to spot slow steps at a glance
- ♿ Accessible: keyboard navigation, ARIA labels, reduced-motion support
- 📦 Single HTML file, works offline, no web server, no CDN
- 🧩 Clean architecture — formatter / collector / models / renderer separation, fully testable
- 🛠️ Extensible — custom CSS/JS, custom title/logo/company, JSON sidecar, future plugin system
Installation
pip install behave-modern-html-report
Quick start
In your project's behave.ini (or setup.cfg):
[behave.formatters]
modern = behave_modern_html_report.formatter:ModernHTMLFormatter
Then run:
behave -f modern -o report.html
Open report.html in any browser. Done.
Configuration
All options are read from behave's userdata:
[behave.userdata]
bmr.title = My Awesome Suite
bmr.company = Acme Inc.
bmr.logo = https://example.com/logo.svg
bmr.theme = auto ; auto | dark | light
bmr.json_sidecar = true ; writes report.json next to report.html
bmr.custom_css = path/to/extra.css
bmr.custom_js = path/to/extra.js
Behave 1.3.x and Gherkin Rules compatibility
behave-modern-html-report is tested against Behave 1.3.x and fully supports the Gherkin Rule keyword.
- Scenarios under a
Rulekeep their parent rule name and inherit their Rule tags correctly. - Extended final statuses (
error,hook_error,cleanup_error,xfailed,xpassed,pending_warn) are normalised and displayed in the UI. - Error-like statuses are grouped as failures for feature status and tag analytics.
Feature: Checkout
Rule: Payment required
@payment
Scenario: Card payment succeeds
Given the user has items in cart
When they pay with a valid card
Then the order is confirmed
Attachments from your environment.py
Use the public helper API — no need to reach into the formatter:
from behave_modern_html_report import attach_screenshot, attach_text, log
def after_step(context, step):
if step.status == "failed":
attach_screenshot(context, context.browser, name="failure.png")
attach_text(context, str(step.exception), name="error.txt")
log(f"URL at failure: {context.browser.current_url}")
The helpers also work with Playwright, Selenium, PIL images, bytes, files, and JSON data.
Generate a demo without running Behave
python examples/demo_generator/generate_demo.py
This builds examples/demo_generator/demo-report.html with a realistic-looking suite —
useful for previews, screenshots, and design iteration.
Screenshots
Dashboard view
Features view
Rules view
Scenarios view
Results view
Tags view
Statistics view
Environment view
Architecture
behave events
│
▼
formatter.py ── thin adapter
│
▼
collector.py ── builds the model tree
│
▼
models.py ── pure dataclasses
(Execution → Feature → Rule-aware Scenario → Step)
│
▼
statistics.py ── aggregates counters, durations, buckets
│
▼
renderer.py + templates/ + assets/ ── Jinja2 → single HTML file
The renderer is independent of Behave, so any tool that can produce an
Execution object (e.g. a JSON loader) can use it.
Development
pip install -e ".[dev]"
pytest
ruff check .
Documentation
- Usage — installation, basic configuration, and running.
- Configuration — all reporter options and userdata keys.
- Report views — what each view shows.
- Examples — demo generator and functional Behave project.
- Architecture — how the formatter is structured.
- Contributing — local setup, checks, and conventions.
License
MIT © Mathias Paulenko
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
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 behave_modern_html_report-2.0.0.tar.gz.
File metadata
- Download URL: behave_modern_html_report-2.0.0.tar.gz
- Upload date:
- Size: 644.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1b4e6ea171dc047bf7e3875cba3317756892971029ae835605b8e371a626295
|
|
| MD5 |
ba5b50f9ca08df831a098b34ea9b3492
|
|
| BLAKE2b-256 |
c4c090e02e91600787b381e87ec0d1e10db88b3ce9a9ec497ddf4d6c47ab1c4b
|
Provenance
The following attestation bundles were made for behave_modern_html_report-2.0.0.tar.gz:
Publisher:
release.yml on MathiasPaulenko/behave-modern-html-report
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
behave_modern_html_report-2.0.0.tar.gz -
Subject digest:
a1b4e6ea171dc047bf7e3875cba3317756892971029ae835605b8e371a626295 - Sigstore transparency entry: 2002679162
- Sigstore integration time:
-
Permalink:
MathiasPaulenko/behave-modern-html-report@c6ecf58a43da07c62491d8cfecf79cc2a3b4d5dc -
Branch / Tag:
refs/heads/main - Owner: https://github.com/MathiasPaulenko
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c6ecf58a43da07c62491d8cfecf79cc2a3b4d5dc -
Trigger Event:
push
-
Statement type:
File details
Details for the file behave_modern_html_report-2.0.0-py3-none-any.whl.
File metadata
- Download URL: behave_modern_html_report-2.0.0-py3-none-any.whl
- Upload date:
- Size: 49.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1acf8ad0971ecbce623a9bc81f797ff15788c5d4df10d8ccb07eca399e8e0f83
|
|
| MD5 |
b86684d5c38cccaed360f7f3b2fa1a89
|
|
| BLAKE2b-256 |
c336dfde66b866430d40a4dedf4bfb68afbb968332613578ad1d7a50d38824c8
|
Provenance
The following attestation bundles were made for behave_modern_html_report-2.0.0-py3-none-any.whl:
Publisher:
release.yml on MathiasPaulenko/behave-modern-html-report
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
behave_modern_html_report-2.0.0-py3-none-any.whl -
Subject digest:
1acf8ad0971ecbce623a9bc81f797ff15788c5d4df10d8ccb07eca399e8e0f83 - Sigstore transparency entry: 2002679254
- Sigstore integration time:
-
Permalink:
MathiasPaulenko/behave-modern-html-report@c6ecf58a43da07c62491d8cfecf79cc2a3b4d5dc -
Branch / Tag:
refs/heads/main - Owner: https://github.com/MathiasPaulenko
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c6ecf58a43da07c62491d8cfecf79cc2a3b4d5dc -
Trigger Event:
push
-
Statement type: