Skip to main content

VelvetReport — Universal JUnit XML to Offline HTML Test Reporter

PyPI version npm version Maven Central License: MIT Zero Dependencies Self-Tests

VelvetReport is a zero-dependency, self-contained, 100% offline HTML test reporting engine. It converts standard JUnit XML output into an interactive, single-file dashboard with historical trend tracking, flaky test detection, execution timelines, and failure analytics. Built as a lightweight, zero-server alternative to Allure Report and ExtentReports across Python, Node.js, and Java.


⚡ 10-Second Quickstart

Python (pytest — Zero Config):

pip install velvet-report
pytest   # Report auto-generated at reports/velvetreport.html with zero config!

Node.js (npx — Zero Install):

npx velvet-report generate reports/results.xml ./reports --open

Java (Maven):

<dependency>
  <groupId>dev.velvetreport</groupId>
  <artifactId>velvet-report</artifactId>
  <version>2.1.3</version>
</dependency>

🥊 Why VelvetReport? (Comparison Matrix)

Feature VelvetReport (v2.1.3) Allure Report pytest-html / Mochawesome
100% Offline (No CDN/Internet) ✅ Single file, zero network calls ⚠️ Requires Java runtime / HTTP server ✅ Single static file
Zero Server / Zero Setup ✅ Double-click file to open in browser ❌ Requires allure serve or cloud host ✅ Static file
Zero Runtime Dependencies ✅ 0 dependencies ❌ Heavy CLI / JVM setup ⚠️ Multiple packages
Historical Trends & Flaky Tracking ✅ Auto-saved in .history/ (~3 KB/run) ⚠️ Needs Allure Server / DB ❌ None
Pytest Auto-Capture ✅ Environment, fixtures, xdist, tags ⚠️ Requires manual decorators ⚠️ Limited
Interactive Test Details Drawer ✅ Summary, Traces, Steps, Screenshots ✅ Supported ⚠️ Limited
Multi-Framework Parity ✅ Python, Node.js, Java ⚠️ Framework-specific adapters ❌ Single framework
Failure Classification ✅ Auto-detects Assertion / Timeout / Network ⚠️ Manual classification ❌ None

🚀 Key Highlights (v2.1.3)

  • 📴 100% Offline & Self-Contained: One standalone .html file. Inlines all CSS, JS, charts, and base64 screenshots. Zero external network calls.
  • ⚡ Zero-Config Pytest Auto-Capture: Automatically captures OS, Python runtime, CI variables, git branch, marks, setup/call/teardown timings, fixture overheads, and xdist worker distribution.
  • 🎯 Interactive Test Details Drawer: Per-test Summary (Date, Duration, Failure Cause, Screenshot thumbnail), Stack Trace, Run History (30-run trend dots), Logs, Tags & Steps, and Attachments lightbox.
  • 📈 History & Flaky Detection: Automatically tracks up to 30 previous test runs in lightweight .history/ files and highlights flaky tests across runs.
  • 📊 10+ Rich Interactive Visualizations: Donut pass/fail charts, duration histograms, volume trends, worker distribution, failure categorization, and collapsible Mind Map navigation.
  • 🧩 Universal Compatibility: Works with pytest, Playwright, Jest, Cypress, Robot Framework, Vitest, TestNG, JUnit 5, and any tool outputting JUnit XML.

Testing Frameworks Integration & Reporting

VelvetReport acts as a modern, self-contained reporting system. While test execution runs your test scripts (performing assertions, API requests, and browser interactions), test reporting structures these outcomes into an easily readable, interactive dashboard containing diagnostics, logs, trends, and attachments.


Python (pytest / Playwright) Integration

VelvetReport provides native, zero-config reporting for Python testing using pytest. The velvet-report pytest plugin automatically hooks into your tests to capture run telemetry and environment info.

1. Why Reporting is Required

  • Analyze Failures: Instantly pinpoint why a Python browser or API test failed.
  • Diagnostics: View duration, error stack traces, and system-under-test environments.
  • Evidence Collection: Access screenshots and logs associated with failed tests.
  • CI/CD Insights: Track execution trends over multiple builds using historical data.

2. Prerequisites & Installation

Ensure you have Python >= 3.8. Install the required packages via pip:

# Install pytest, playwright, and the VelvetReport collector
pip install pytest pytest-playwright velvet-report

# Install browser binaries for Playwright
playwright install

3. Reporting Configuration

VelvetReport is configured directly in your pytest.ini file at the root of your project:

[pytest]
# Direct pytest to output JUnit XML to the reports folder
addopts = --junitxml=reports/results.xml

# VelvetReport specific configurations
vReport_Title               = Playwright Python Suite
vReport_output              = reports
vReport_history             = reports/.history
vReport_open                = false
vReport_embed_max           = 2M
vReport_email_report_enable = false
  • vReport_Title: Custom title shown in the report topbar.
  • vReport_output: The directory where the final velvetreport.html is built (default: reports).
  • vReport_history: History trend logs directory (default: reports/.history).
  • vReport_embed_max: Limits the maximum file size (e.g. 2M for 2 megabytes) of attachments embedded directly as base64 inside the offline HTML.

4. Supported Capabilities

  • Execution Timings: Timings of setup, call, and teardown test phases, including fixture overheads.
  • Worker/Platform Dist: Track test distribution across multiple workers (when using pytest-xdist).
  • Assertion vs. Timeout Identification: Auto-categorizes errors into Assertion, Timeout, Network, or Script.
  • Automatic Attachment Discovery (Playwright): On failed tests, VelvetReport automatically scans the Playwright test-results/ directory, extracts screenshots, and encodes them directly into the report.
  • Manual Attachments: Manually attach logs, videos, or screenshots in code:
    import velvet_report.get_pytest_data as vr
    
    def test_homepage(page):
        page.goto("https://playwright.dev")
        # Add step metadata
        with vr.step("Capture screenshot"):
            vr.attach(page.screenshot(), name="home.png", mime="image/png")
    

5. Run Tests and Generate Report

To run your test suite and automatically generate the VelvetReport HTML dashboard:

# Run pytest (VelvetReport executes as a plugin and compiles the HTML dashboard)
pytest

The report is generated at: reports/velvetreport.html

6. Open the Report

Open the generated HTML dashboard file directly in any browser — no local server is required:

# On Windows
start reports/velvetreport.html

# On macOS
open reports/velvetreport.html

Click on any failed test in the suite tree to inspect step logs, stack traces, and embedded screenshots.

7. Customization Options

  • Command Line Overrides:
    pytest --vReport-title "Staging Regression Run" --vReport-output custom-reports --vReport-open
    
  • Filter and Search: The UI supports full tag filters (e.g. @smoke, @regression), text search, and test status toggles.

8. CI/CD Usage

In CI/CD (such as GitHub Actions), run tests, archive the generated HTML report, and review the dashboard in pipeline artifacts.

# .github/workflows/test.yml snippet
- name: Run Pytest Suite
  run: pytest
- name: Archive Test Report
  if: always()
  uses: actions/upload-artifact@v4
  with:
    name: velvetreport
    path: reports/velvetreport.html

Report Features

Metrics & KPIs

  • 12 KPI cards — Total, Passed, Failed, Errors, Skipped, Rerun, Pass Rate, Avg Test Time, Total Duration, Stability Score (0–100), Flaky %, Failure Reproducibility — animated count-up on view.
  • Risk badge — STABLE / UNSTABLE / HIGH RISK.
  • Click any KPI card → modal listing the exact test cases behind it.

Test Details Drawer

  • Expandable suite tree with per-test tabs: Summary (phases/fixtures/reason/thumbnail), Stack Trace, Run History, Logs, Tags & Steps, Screenshots, Attachments.
  • Run history — per-run status, duration, date/time, failure reason, screenshot — mapped correctly by file + test name across 30 runs.
  • FLAKY badge — auto-detected vs previous runs.
  • Live search + filter (All / Passed / Failed / Skipped / Flaky).

Visual Analysis & Charts

  • Test Execution Timeline — animated per-test bars.
  • Mind Map — Root → Suite → Describe → Test, clickable nodes open full detail.
  • Failure Analysis — auto-classified: Assertion / Timeout / Network / Script, with screenshot preview in modal.
  • Pass/Fail donut, Duration histogram, Volume & Outcome Trends, Duration Trends, Test Distribution by Worker, Browser Distribution, Top 10 Slowest, Suite Health.


📧 Automated Executive Email Summary Report

In addition to the full interactive dashboard (velvetreport.html), VelvetReport generates an ultra-clean, email-client-friendly single-file HTML summary: velvetreport_email.html.

🌟 Key Highlights of the Email Report

  • Executive Snapshot: Designed specifically for CI/CD notifications (GitHub Actions, GitLab CI, Jenkins, Slack/Teams email dispatch, Outlook, Gmail, Apple Mail).
  • Zero External Scripts: 100% inline CSS and HTML table structure that renders reliably without being blocked by corporate email spam filters or mail user agents.
  • Delta Trend Metrics (162 | ↑ 5): Metric cards showcase pass/fail/total/flaky comparisons against the previous test execution (e.g., 162 | ↑ 5 or 12 | ↓ 2).
  • Timing & Execution Banner: Highlights Start Time, End Time, Duration, Git Branch, and Framework runtime metadata at the top.
  • New vs. Repeated Failures: Distinguishes newly emerging test failures ([NEW FAIL]) from recurrent failures ([REPEATED FAIL]) with visual alert badges.

How to Generate the Email Report

1. Via Command-Line Interface (CLI)

  • Python / pytest:
    pytest --vReport-email
    
  • Node.js / npx / global CLI:
    velvet-report generate reports/results.xml ./reports --email
    # or using npx directly
    npx velvet-report generate reports/results.xml ./reports --email
    

2. Via pytest.ini Configuration (Python)

Add vReport_email = true (or its alias vReport_email_report_enable = true) to your pytest.ini:

[pytest]
addopts = --junitxml=reports/results.xml

# Generate email-ready HTML summary alongside velvetreport.html
vReport_email               = true
vReport_email_report_enable = true
vReport_output              = reports

3. Programmatically in Python

from velvet_report import generate_report

# Generates reports/velvetreport.html AND reports/velvetreport_email.html
generate_report(
    junit_xml="reports/results.xml",
    output_dir="reports",
    email_en=True,                # Enable email HTML generation
    title="Nightly Regression Suite"
)

4. Programmatically in Node.js / JavaScript / TypeScript

const { generate, buildEmailHtml, parseJunit } = require('velvet-report');

// Option A: Generate both reports to disk
generate('reports/results.xml', './reports', {
  title: 'CI Test Run',
  email: true // writes reports/velvetreport_email.html
});

// Option B: Generate raw email HTML in-memory to send via Nodemailer / SendGrid
const fs = require('fs');
const xml = fs.readFileSync('reports/results.xml', 'utf8');
const report = parseJunit(xml, 'results.xml');
const emailHtml = buildEmailHtml(report);

5. CI/CD Notification Dispatch (GitHub Actions)

- name: Run Tests & Generate Reports
  run: pytest --vReport-email
  if: always()

- name: Send Email Report Notification
  if: always()
  uses: dawidd6/action-send-mail@v3
  with:
    server_address: smtp.gmail.com
    server_port: 465
    username: ${{ secrets.MAIL_USERNAME }}
    password: ${{ secrets.MAIL_PASSWORD }}
    subject: "Test Execution Summary: ${{ github.repository }} (#${{ github.run_number }})"
    html_body: file://reports/velvetreport_email.html
    to: team-qa@example.com

Configuration Reference

Python (pytest.ini & CLI Options)

Key CLI Flag Default Description
vReport_Title --vReport-title <text> XML filename Custom report title shown in dashboard header
vReport_output --vReport-output <dir> reports Output folder for HTML reports
vReport_history --vReport-history <dir> reports/.history Directory where historical runs are stored
vReport_xml --vReport-xml <path> Auto-detected Path to JUnit XML input file
vReport_open --vReport-open false Automatically open dashboard in default browser
vReport_disable --vReport-disable false Disable VelvetReport generation entirely
vReport_capture — auto pytest telemetry capture (auto | off)
vReport_embed_max — 2M Maximum attachment size to embed as base64
vReport_email / vReport_email_report_enable --vReport-email false Generate email-friendly summary (velvetreport_email.html)
vReport_server --vReport-server <url> "" VelvetReport Platform server URL for auto-upload
vReport_token --vReport-token <token> "" Bearer authorization token for Platform upload

Node.js CLI & Programmatic API

velvet-report generate <junit.xml | dir/> [output-dir] [options]
velvet-report server [--port 4100]
velvet-report clear-history [dir]
velvet-report info

Node.js CLI Options

Flag Default Description
--title <text> XML filename Report title
--history <dir> <output>/.history History directory
--open false Open the dashboard in default browser
--email false Generate email summary (velvetreport_email.html)
--server <url> "" Upload report XML to platform ingestion server
--token <token> "" Bearer auth token for server upload
--version, -v — Print VelvetReport version
--help, -h — Show CLI help text

Node.js Programmatic API Options

generate(xmlPath, outputDir, {
  title: 'My Custom Suite',     // Report title string
  historyDir: 'reports/.history', // Historical data directory
  open: false,                  // Open browser automatically
  email: true                   // Generate velvetreport_email.html
});

Architecture & Local Platform Development

VelvetReport maintains a strict one-way build pipeline:

core/src/template-parts/               ← Modular HTML / CSS / browser runtime
core/src/parser.js                     ← JUnit XML parser
core/src/history.js                    ← History + email
core/packages/python/get_pytest_data/  ← pytest auto-capture plugin
        ↓
node scripts/build.js                  ← Compiles to all 3 platforms + 25 self-tests
        ↓
packages/pip → PyPI   packages/npm → npm   packages/maven → Maven Central

Local Platform Ingestion & Server (Optional)

For team workflows and local aggregation:

# 1. Start local ingestion server (defaults to port 4100)
node offlineReport/platform/server.js

# 2. Run platform verification tests
npm run test:platform

# 3. Build & verify offline packages
node scripts/build.js --verify

Contributing? See CONTRIBUTING.md — small files, FIX: headers, easy to extend.


Supported Frameworks

pytest · Playwright · Robot Framework · Jest · Cypress · Mocha · Jasmine · Vitest · Karma · WebdriverIO · JUnit 5 · TestNG · Maven Surefire · Gradle · RSpec · PHPUnit · gotestsum · xUnit · NUnit · and any tool that outputs standard JUnit XML.


Support the Project & Donate

If VelvetReport helps you or your team build and debug faster, please consider supporting the project. Your contributions directly help us maintain the library and reach our target of 10M+ downloads/users!

Buy Me a Coffee Sponsor on GitHub

  • ☕ Buy Me a Coffee: A fast, simple way to show support.
  • 💖 Sponsor on GitHub: Fund ongoing maintenance and feature development.
  • ⭐ Star the Repository: Help increase the project's visibility across the developer community.

License

MIT © Tarun Dwivedi and VelvetReport Contributors.


Keywords: junit xml report generator, html test report, pytest html report, pytest allure alternative, playwright test report, jest html reporter, cypress report, offline html test report, self-contained test report, CI test dashboard, test history tracking, flaky test detection, xdist report, python test report, junit 5 report, maven surefire report

Metadata

Release files for velvet-report 2.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for velvet-report 2.1.4
File Size Uploaded Provenance Actions
velvet_report-2.1.4.tar.gz 168.0 kB Without provenance Details for velvet_report-2.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for velvet-report 2.1.4
File Interpreter ABI Platform Actions
velvet_report-2.1.4-py3-none-any.whl Python 3 none any Details for velvet_report-2.1.4-py3-none-any.whl

Total release size: 335.1 kB

Release files / velvet_report-2.1.4.tar.gz

Download URL velvet_report-2.1.4.tar.gz
Size 168.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b27b6076d5b1833017cec013f2668321ddc3436ed80c938c720a8817e89b5ed5
BLAKE2b-256 checksum
How to use checksums
10dea66322f7bfaf37faef359bc1a7c73ffd1304888ba4821ac740cb7bff789d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.6

Release files / velvet_report-2.1.4-py3-none-any.whl

Download URL velvet_report-2.1.4-py3-none-any.whl
Size 167.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c626da2f58e097e384e55561c4f0af254623c643bd81c756845e5d0269fa5de
BLAKE2b-256 checksum
How to use checksums
cfc66735090ed4aeb7473a96485267daff7e4b76b222d85904934ceb6430a490
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.6

Security for velvet-report 2.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page