Skip to main content

How to Share Test Results Without a Server

LiveDoc can produce a single HTML file containing your complete test results — features, scenarios, steps, attachments, and screenshots — that anyone can open in a browser. No server, no internet, no setup. Just double-click and read.

Prerequisites
  • @swedevtools/livedoc-vitest (TypeScript) or SweDevTools.LiveDoc.xUnit (.NET)
  • @swedevtools/livedoc-viewer installed (for the export CLI command)

The Pipeline

StepWhat happensOutput
Run testsYour test framework executes specs and exports resultslivedoc-report.json (TestRunV1 format)
Export HTMLlivedoc-viewer export bundles the viewer + data into one filereport.html (self-contained)
ShareUpload as CI artifact, deploy to Pages, email, or drop in a shared folderAnyone opens it in a browser

Step 1: Configure Your Reporter to Export JSON

TypeScript (Vitest)

Add the export option to LiveDocSpecReporter:

// vitest.config.ts
import { defineConfig } from 'vitest/config';
import { LiveDocSpecReporter } from '@swedevtools/livedoc-vitest/reporter';

export default defineConfig({
test: {
globals: true,
include: ['**/*.Spec.ts'],
reporters: [
new LiveDocSpecReporter({
detailLevel: 'spec+summary+headers',
export: {
output: './test-results/livedoc-report.json',
},
}),
],
},
});

Run your tests normally:

npx vitest run

The reporter prints a confirmation when the file is written:

✅ LiveDoc results exported to ./test-results/livedoc-report.json (1.2 MB)
Optional: project and environment metadata

You can set project and environment in the export config. If omitted, the reporter falls back to the publish config values, then to sensible defaults ("default" for project, auto-detected "ci" or "local" for environment):

export: {
output: './test-results/livedoc-report.json',
project: 'my-project',
environment: 'ci',
}

.NET (xUnit)

Pass the ExportPath parameter to the LiveDoc logger:

dotnet test --logger "LiveDoc;ExportPath=./test-results/livedoc-report.json;Project=my-project;Environment=ci"
ParameterDescription
ExportPathPath to write the TestRunV1 JSON file
ProjectProject name label in the report
EnvironmentEnvironment label (e.g., ci, local)

The logger creates directories automatically and prints the same confirmation:

✅ LiveDoc results exported to ./test-results/livedoc-report.json (845.2 KB)
Export runs alongside console output

In both SDKs, the JSON export runs in addition to console output and server publishing. It doesn't replace either — you get all output channels when all are configured.

Step 2: Generate the Static HTML Report

Use the livedoc-viewer export command to convert the JSON file into a self-contained HTML report:

npx @swedevtools/livedoc-viewer export \
--input ./test-results/livedoc-report.json \
--output ./test-results/report.html

You can set a custom title (defaults to the project name from the JSON):

npx @swedevtools/livedoc-viewer export \
-i ./test-results/livedoc-report.json \
-o ./test-results/report.html \
-t "Sprint 42 — Regression Results"
FlagDescriptionDefault
-i, --inputPath to TestRunV1 JSON file(required)
-o, --outputOutput HTML file path./livedoc-report.html
-t, --titleReport titleProject name from JSON

On success:

✅ LiveDoc report exported successfully!
Input: ./test-results/livedoc-report.json
Output: /home/ci/project/test-results/report.html
Size: 847.3 KB

Open in any browser to view your test results.

What's in the HTML file?

The generated HTML is completely self-contained:

  • Full LiveDoc Viewer — the same React application you see in the browser, bundled inline
  • All test data — features, scenarios, steps, timing, errors, tags
  • All attachments — screenshots and file attachments are embedded as base64
  • Dark theme — matches the Viewer's default appearance
  • Zero external dependencies — no CDN links, no fetch calls, no internet needed
File size expectations
ContentTypical size
Tests only (no screenshots)700 KB – 1 MB
Tests + a few screenshots2 – 5 MB
Tests + many high-res screenshots10 MB+

The bulk of the base size is the bundled Viewer JavaScript and CSS. Screenshots add size proportional to their resolution and count.

Step 3: Share the Report

The HTML file is a single file you can share however works for your team:

  • CI artifact — upload with actions/upload-artifact (GitHub) or artifacts: (GitLab)
  • GitHub Pages — deploy as a static site for a permanent URL
  • Email — attach to a release email or review request
  • Shared drive — drop in a network folder, SharePoint, or Google Drive
  • Pull request comment — link to the CI artifact URL
  • Slack / Teams — upload directly to a channel

CI/CD Integration

For complete CI pipeline examples including GitHub Actions, GitLab CI, Azure DevOps, and GitHub Pages deployment, see the per-SDK CI/CD guides:

  • Vitest CI/CD Guide — includes CI-specific config (allowOnly, fileParallelism), tag filtering, and complete workflows
  • xUnit CI/CD Guide — includes build config matching, journey test gotchas, and complete workflows
  • Viewer CI/CD Guide — GitHub Pages deployment, multi-project reports, and live dashboard setup

Troubleshooting

ProblemCauseSolution
Input file not foundJSON file wasn't createdVerify the export.output path in your config matches the --input path
Invalid TestRunV1 formatWrong JSON formatEnsure you're using the export option (TestRunV1), not JsonReporter (SDK model)
Webview assets not foundViewer not builtRun pnpm build in the viewer package, or use npx which resolves the built package
HTML file is very largeMany screenshotsScreenshots are base64-encoded; consider reducing resolution or count
Report shows no dataEmpty test runCheck that tests actually ran and the JSON file contains test results
Report shows "Run in progress"Older viewer versionUpdate to the latest @swedevtools/livedoc-viewer

See Also