# Share an Extent Report — Spark HTML on a Link, With Comments

Canonical: https://commareports.com/share-extent-report
Published: 2026-08-25

> ExtentSparkReporter writes Spark.html into target/ and it dies with the build. Publish the report folder to Comma for a stable URL, screenshots intact, and a thread per failed test.

# Share an Extent Report

Extent's Spark report is the nicest artifact in the Java QA toolchain
and the most stubbornly local. It's written to `target/`, which the next
`mvn clean` deletes, on the machine or agent that ran the suite.

So it gets zipped, or screenshotted, or attached to a Jira ticket at
40 MB.

## Publish the folder, not the file

```java
ExtentSparkReporter spark = new ExtentSparkReporter("target/spark/Spark.html");
ExtentReports extent = new ExtentReports();
extent.attachReporter(spark);
```

Drag `target/spark/` (or a zip of it) into
[the app](https://commareports.com/):

- `Spark.html` becomes the **report body**.
- Screenshots attached with `addScreenCaptureFromPath` upload alongside
  and their relative references are rewritten to the uploaded copies —
  which is exactly what emailing the single file destroys.
- Scripts run inside a sandboxed iframe (`allow-scripts`, no
  `allow-same-origin`), so the dashboard, the filters and the test tree
  all work.

If you'd rather ship one self-contained file, two switches help:
`spark.config().setOfflineMode(true)` bundles Spark's own CSS and JS
instead of loading them from a CDN, and
`addScreenCaptureFromBase64String` inlines the screenshots.

## From CI

```bash
mvn -B test || true   # keep going: the failing run is the one worth publishing

curl -fsS -X PATCH "https://commareports.com/api/v1/reports/$REPORT_ID" \
  -H "Authorization: Bearer $COMMA_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d "$(jq -n --rawfile html target/spark/Spark.html \
        --arg title "Regression — $GIT_COMMIT" '{title: $title, html: $html}')"
```

Run the publish step with `if: always()` (GitHub Actions), `when: always`
(GitLab, CircleCI) or `post { always { … } }` (Jenkins). PATCHing one
report id keeps a single URL per suite and appends a revision per run,
so "did this pass last night?" is a
[diff](/docs/ci) rather than a hunt through expired artifacts.

Attaching the screenshots as assets is the
[REST API](/docs/api) assets call; the drag-and-drop path does it for you.

## What review adds

- **Anchored threads** on the failing test, next to its screenshot —
  see [commenting on HTML](/comment-on-html).
- **Revisions**, so a flaky test's history is visible instead of
  remembered.
- **Access per report** — private, team, domain-gated or named
  reviewers. See the [sharing model](/docs/sharing).

## Limits

- **Entry HTML: 5 MB.** Assets: 25 MB per file, 250 MB and 500 files
  total. Screenshot-heavy suites are the ones to watch — Base64 captures
  count against the 5 MB entry file, path captures against the asset
  budget.
- **60 requests/minute per token.**

## Try it

Comma is free — unlimited reports, unlimited commenters, unlimited
revision history.

**[Publish a test report →](https://commareports.com/)**

### Related

- [Share a TestNG report](/share-testng-report) · [Share an Allure report](/share-allure-report)
- [Share a JaCoCo report](/share-jacoco-report) · [Share a Cucumber report](/share-cucumber-report)
- [Publish from CI](/docs/ci) · [Why the report lost its CSS](/html-report-broken-css)
