Changelog¶
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased]¶
1.4.0 — 2026-10-05¶
Fixed¶
behave-trace runnow uses the scoped formatter class name (behave_trace.formatter:TraceFormatter), so it works on projects without a[behave.formatters]registration inbehave.ini.- Toggling auto-run during a test run no longer clears the "Running" indicator
in the viewer (the
stateSSE event now includes therunningflag). - Background steps duplicated in
scenario.backgroundnow reflect real execution results instead of stayinguntested, and each scenario gets its own copy. - Scenario names passed to
--nameare regex-escaped, so "Re-run failed" and "Run selected" work with names containing metacharacters. attach_domno longer injects<base>before the<!DOCTYPE>declaration.attach_screenshotdetects the real MIME type (PNG/JPEG/GIF/WebP) instead of always reportingimage/png.- The viewer's snapshot diff now bails out on very large snapshots instead of freezing the tab (LCS matrix is O(m×n)).
formatDurationin the viewer handles durations ≥ 1 hour.- Attachments or log lines produced in
after_scenariono longer leak into the next scenario's first step.
Changed¶
- Alpine.js is now vendored locally (
assets/js/vendor/) instead of loaded from a CDN — the viewer works offline and without unpinned dependencies. - Removed the dead
[project.entry-points."behave.formatters"]section; Behave does not discover entry points. - Added missing CSS classes for
untested/running/infostates.
1.3.1 — 2026-08-06¶
Fixed¶
- Unified author email in package metadata.
- Updated version test for v1.3.1.
1.3.0 — 2026-08-05¶
Added¶
- Port conflict detection: pre-check port availability before binding the server, raising a clear error instead of hanging on Windows.
- Improved serializer with better error handling and edge-case coverage.
- Enhanced collector with more robust attachment and log flushing.
- Additional test coverage for server API, CLI integration, attachments, and edge cases.
Fixed¶
- Windows port hang:
ThreadingHTTPServercould block indefinitely when the port was already in use. Now detected upfront with aconnect_exprobe. - Minor fixes in formatter, runner, and watcher for robustness.
Changed¶
- Viewer JS improvements for smoother UI interactions.
- CLI app refinements for better error reporting.
1.2.1 — 2026-08-04¶
Fixed¶
ruff formatissues inbehave_trace/collector.pyandbehave_trace/viewer/server.py.tests/test_cli.py::TestRunExceptionSafetynow avoids hanging onsignal.pause()on Linux.
1.2.0 — 2026-08-04¶
Added¶
- Live progress updates via Server-Sent Events while running Behave from the viewer.
- Visual DOM diff with before/after snapshots and highlighted added/removed elements.
- Collapse/Expand all buttons for the feature tree.
- Scenario sorting by name, duration, or status with persistence in
localStorage. - Feature → Scenario breadcrumb with clickable feature in the detail panel.
- Filter counters, timeline hover preview, and other UI polish.
1.0.0 — 2025-08-03¶
Added¶
- Trace formatter (
behave_trace.formatter:TraceFormatter) — captures Behave execution events (features, scenarios, steps, statuses, durations, errors) into a structuredTracemodel. - Collector (
Collector) — accumulates events from Behave's formatter API intoTrace,Feature,Scenario,Stepdataclasses with computed stats. - Serializer (
Serializer) — JSON serialization/deserialization for trace files with full round-trip fidelity. - Attachment API (
attach_screenshot,attach_dom,attach_text,attach_network,log) — high-level helpers for capturing screenshots, DOM snapshots, text snippets, network requests, and log lines fromenvironment.pyhooks. - CLI (
behave-trace) —showsubcommand that loads a trace file, starts a local HTTP server, and opens the viewer in a browser (Chrome app mode preferred, falls back to default browser).runsubcommand that executes Behave with the trace formatter and opens the viewer, with optional--watchmode for automatic re-execution on file changes. - Viewer server (
ViewerServer) — stdlib-onlyThreadingHTTPServerserving static assets and/api/traceendpoint with gzip compression and path traversal protection. - Viewer frontend — single-page application with Alpine.js (CDN, no build step), dark theme, Playwright-inspired layout:
- Header with status badges and duration
- Sidebar with filters (all / failed / slow), scenario tree, and stats
- Timeline with colored segments and scrubable cursor
- Step list with status icons, keywords, durations, and mini-badges
- Step detail with tabs: Screenshot, Snapshot (before/after), Source, Console, Error, Artifacts
- Filmstrip with screenshot thumbnails
- Empty state
- Example project (
examples/calculator/) — a real Behave project demonstrating screenshots, DOM snapshots, logs, and a failing scenario. - E2E tests — meta Behave suite that runs Behave with
behave-traceformatter on inner test features and verifies the trace JSON structure, statuses, artifacts, stats, and environment capture. - Unit tests — 288 tests covering models, collector, formatter, serializer, attach API, CLI, server, and utils.
- CI/CD — GitHub Actions workflows for lint (ruff), typecheck (mypy), test (pytest with coverage + codecov) on Python 3.11-3.13 across Ubuntu/Windows/macOS, automated release to PyPI via Trusted Publishing, and MkDocs documentation deployment to GitHub Pages.
- Documentation — MkDocs Material site with installation, quickstart, CLI reference, attachments guide, Python API (mkdocstrings), architecture, and contributing guide.
- Community files — CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md, PR/issue templates, dependabot configuration.
- Developer tooling — Makefile, pre-commit hooks, .editorconfig, .markdownlint.json, py.typed marker.