newman-reporter-rv-apex
v1.3.2
Published
A beautiful HTML test report for Newman — converts any Newman collection run into a professional, customer-ready report with dark/light mode.
Downloads
80
Maintainers
Readme
newman-reporter-rv-apex
A professional, customer-ready HTML test report for Newman.
Turns any Newman collection run into a beautiful report with:
- 🌓 Dark & Light mode toggle (in-report switch)
- 📊 Dual donut charts — Request Summary & Assertion Summary (with toggle)
- 📈 Progress bars for both request-level and assertion-level distribution
- 📁 Folder tree (nested or flat collections both work)
- 🔍 Live search + filter (All / Pass / Fail / Skipped / Folder tabs)
- ✅ Per-request expandable panel with Test Assertions, Request Headers, Request Body, Response Headers, Response Body
- ⚡ Optional reclassification of infrastructure error codes (user-defined)
- 🔒 Sensitive data masking (host, headers — partial mask)
- 🧪 Test Environment details card
- 🖼️ Custom logo support (URL or base64)
Installation
# Local install (recommended)
npm install --save-dev newman-reporter-rv-apex
# Or globally
npm install -g newman-reporter-rv-apexUsage
CLI
# Basic usage
newman run collection.json -r rv-apex
# With all options
newman run collection.json \
-e environment.json \
-r rv-apex \
--reporter-rv-apex-export ./reports/test-report.html \
--reporter-rv-apex-title "My API — Regression Report" \
--reporter-rv-apex-darkMode false \
--reporter-rv-apex-logo "https://example.com/logo.png" \
--reporter-rv-apex-infraCodes "504,502,408" \
--reporter-rv-apex-environment "Environment: QA | Server: v2.1.3 | Client: v1.8.0 | Comment: Post-hotfix run" \
--reporter-rv-apex-mask "host,authorization,cookie"
# Multiple reporters
newman run collection.json -r cli,rv-apex \
--reporter-rv-apex-export ./reports/report.htmlProgrammatic (Node.js)
const newman = require('newman');
newman.run({
collection: require('./collection.json'),
environment: require('./environment.json'),
reporters: ['rv-apex'],
reporter: {
'rv-apex': {
export: './reports/rv-apex-report.html',
title: 'My API Test Report',
darkMode: 'true',
logo: 'data:image/png;base64,iVBORw0KGgo...', // or https:// URL
infraCodes: '504,502,503,408',
environment: 'Environment: Production | Server: v3.2.1 | Client: v2.0.0',
mask: 'host,authorization,cookie,x-api-key',
}
}
}, (err) => {
if (err) throw err;
console.log('Done!');
});Reporter Options
| Option | CLI flag | Default | Description |
|---------------|-------------------------------------|-------------------------|-----------------------------------------------------------------------------|
| export | --reporter-rv-apex-export | ./rv-apex-report.html | Output HTML file path |
| title | --reporter-rv-apex-title | Collection name | Report title shown in the header |
| darkMode | --reporter-rv-apex-darkMode | true | Initial theme (true=dark, false=light). Toggle available in-report. |
| logo | --reporter-rv-apex-logo | Built-in logo | URL or base64 data URI for your logo |
| infraCodes | --reporter-rv-apex-infraCodes | (empty — disabled) | Comma-separated HTTP codes to reclassify as infra errors |
| environment | --reporter-rv-apex-environment | (empty — hidden) | Pipe-separated environment details (see below) |
| mask | --reporter-rv-apex-mask | (empty — no masking) | Comma-separated fields to mask: host, header names (see below) |
Test Environment Details
Display test environment information as a card in the report. Pass pipe-separated Key: Value pairs:
--reporter-rv-apex-environment "Environment: QA | Server: v2.1.3 | Client: v1.8.0 | Comment: Regression after hotfix"This renders as:
┌─────────────────────────────────────────────┐
│ Test Environment │
│ │
│ Environment QA │
│ Server v2.1.3 │
│ Client v1.8.0 │
│ Comment Regression after hotfix │
└─────────────────────────────────────────────┘If the option is not provided, the card is hidden.
Sensitive Data Masking
Mask sensitive values in URLs and headers before they appear in the report. Useful for customer-shareable reports.
--reporter-rv-apex-mask "host,authorization,cookie,x-api-key"Masking logic: First 4 chars + **** + last 4 chars.
| Field | Original | Masked |
|-------|----------|--------|
| host | https://my-server.example.com/api | https://my-s****e.com/api |
| authorization | Bearer eyJhbGciOiJIUz...xyz | Bear****xyz |
| cookie | JSESSIONID=ABC123DEF456GHI | JSES****FGHI |
host— masks the hostname portion of all request URLs- Any header name (e.g.,
authorization,cookie,x-api-key) — masks that header's value in both request and response headers - Values ≤ 8 characters are fully replaced with
****
Reclassification Logic (Optional)
By default, reclassification is disabled. To enable it, provide the HTTP status codes you know are caused by infrastructure issues (not real test failures):
--reporter-rv-apex-infraCodes "504,408,523"When enabled, if an assertion fails with a pattern like expected 504 to equal 200, and 504 is in your infraCodes list, it will be marked as PASS★ instead of FAIL:
⚡ Manually verified PASS — infrastructure timeout during automation run
This keeps your failure count accurate when infra issues cause false negatives.
Report Features
Dual Summary Charts (Toggle)
The report shows a Request Summary and Assertion Summary with a toggle switch:
- Request Summary — donut chart + stats showing how many requests passed/failed/skipped
- Assertion Summary — donut chart + stats showing how many individual assertions passed/failed/skipped
Filter Tabs
Filter the request tree by:
- All — all requests
- ✅ Passed — requests where all assertions passed
- ❌ Failed — requests where any assertion failed
- ⏭ Skipped — requests where all assertions were skipped
- 📁 Folder — filter by top-level folder (for nested collections)
Expandable Request Panels
Each request expands to show 5 tabs:
- Test Assertions — pass/fail/skip status with error details
- Request Headers — all request headers
- Request Body — formatted request payload
- Response Headers — all response headers
- Response Body — formatted response payload
How it works
| Event | What it captures |
|---------------|---------------------------------------------------------------|
| start | Run start time, environment name |
| beforeItem | Folder path (from item parent chain), request name |
| request | HTTP method, URL, request/response headers, request body, response body, status code, response time |
| assertion | Assertion name, pass/fail/skip, error message |
| item | Commits completed request to its folder |
| done | Calculates totals, duration, data transferred, writes HTML |
Works with any collection structure
Flat collection:
request_1
request_2
request_3
Nested folders:
folder_a/
subfolder_1/
group_1/
test_request_1
test_request_2
folder_b/
subfolder_2/
test_request_3Both render correctly — single-level folders show as folder_name, nested folders show as root / leaf.
Example output
✅ RV-Apex report saved → ./reports/rv-apex-report.htmlOpen the HTML file in any browser — no server needed, fully self-contained.
Author
Revanna V Gowda | XL4
License
MIT
