velvet-report
v2.1.1
Published
VelvetReport — Universal JUnit XML → self-contained offline HTML test reporter. Works with Jest, Playwright, Cypress, Mocha and any JUnit-compatible tool.
Maintainers
Readme
velvet-report
Turn any JUnit XML into a stunning, self-contained, 100% offline HTML test report — with one command.
velvet-report is a universal JUnit XML → HTML test reporter for Jest, Playwright,
Cypress, Mocha, Jasmine, Karma, Vitest, TestNG, JUnit 5 and any tool that emits
JUnit XML. No server. No upload. No internet. Just a single beautiful .html file
you can open, email, or commit — a modern, offline Allure / Extent Report alternative.
npm install --save-dev velvet-reportWhy velvet-report
- 📴 100% offline & self-contained — one HTML file, all CSS/JS/data inlined. Works with zero network.
- 🧩 Framework-agnostic — any JUnit XML in, one consistent dashboard out.
- ⚡ Zero runtime dependencies — tiny install, nothing to configure.
- 📈 History & flaky detection — trends across runs, auto-flagged flaky tests.
- 🎯 CI-friendly — drop it in
posttestand ship an artifact every build. - 🌍 Same engine on npm, PyPI & Maven — identical reports across Node, Python, and Java.
Quickstart
1. Generate from a JUnit XML file
npx velvet-report generate junit.xml ./reports
# → ./reports/velvetreport.html ✓ (open it in any browser)2. Wire it into your test script
{
"scripts": {
"test": "jest --reporters=default jest-junit",
"posttest": "velvet-report generate junit.xml ./reports --open"
}
}npm test
# → runs tests, then opens ./reports/velvetreport.htmlPoint it at a file or a directory of JUnit XMLs — both work:
velvet-report generate ./test-results/ ./reports
velvet-report generate ./junit.xml ./reports --title "Web E2E"CLI
velvet-report generate <junit.xml | dir/> [output-dir] [options]
OPTIONS
--title <text> Report title (default: XML filename)
--history <dir> History directory (default: <output>/.history)
--open Open the report in your browser after generating
--version, -v Print version
--help, -h Show help
COMMANDS
generate Build a report from JUnit XML (alias: gen)
clear-history [dir] Delete saved history runs
info Show version and install path- Default output directory:
velvetreport-output/ - Output file:
velvetreport.html
Programmatic API
const { generate, buildEmailHtml } = require('velvet-report');
// Generate the full HTML dashboard
generate('junit.xml', './reports', {
title: 'Nightly E2E',
historyDir: './reports/.history',
open: false,
});
// Build a lightweight, email-ready HTML summary
const emailHtml = buildEmailHtml('junit.xml');What's in the report
- KPI cards — total, passed, failed, errors, skipped, retries, pass rate, avg/total duration, stability score, flaky %, reproducibility.
- Risk badge — STABLE / UNSTABLE / HIGH RISK.
- Expandable suite tree — per-test Error / Steps / Logs / Console / Attachments / stderr tabs.
- Flaky detection — auto-compared against previous runs, with per-test history dots.
- 10 charts — pass/fail donut, duration histogram, volume & outcome trends, duration trends, duration by spec/describe, worker & browser distribution, top-10 slowest, suite health.
- Result heatmap + collapsible mind map navigation.
- Failure analysis — auto-classified Assertion / Timeout / Network / Script.
- History & trends — compact JSON in
.history/(~3 KB/run, up to 30 runs). Commit it for team-wide trends. - Export — HTML, CSV, JSON, or email-ready summary.
Embedding screenshots / attachments
Print a marker to stdout during your test and velvet-report embeds it:
const b64 = (await page.screenshot()).toString('base64');
process.stdout.write(`[[ATTACHMENT|screenshot.png|${b64}]]\n`);Supported frameworks
Jest · Playwright · Cypress · Mocha · Jasmine · Vitest · Karma · WebdriverIO · TestNG · JUnit 5 · Maven Surefire · Gradle · pytest · Robot Framework · RSpec · PHPUnit · gotestsum · xUnit · NUnit — and anything that outputs JUnit XML.
Requirements
- Node.js >= 14
Links
- 🌐 Website: https://velvetreport.dev
- 📦 npm: https://www.npmjs.com/package/velvet-report
- 🐍 PyPI: https://pypi.org/project/velvet-report/
- 💻 Source: https://github.com/DwivediTarun/velvet_report
License
MIT © VelvetReport Contributors
Keywords: junit xml to html · junit html reporter · jest html report · playwright html report · cypress test report · mocha reporter · vitest report · offline html test report · self-contained test report · allure alternative · extent report alternative · ci test dashboard · flaky test detection · test history · node test reporter · javascript test report generator.
