Share a Serenity BDD report

Serenity's output is unusually good and unusually hard to send. Two commands produce it:

mvn clean verify
mvn serenity:aggregate
# → target/site/serenity/index.html

Gradle users get the same path — the Serenity plugin writes to target/site/serenity rather than build/reports, which trips up almost everyone once.

What's in there is a site: the summary, a page per requirement, a page per test with the narrated step breakdown, the CSS and JS that make the tabs work, and every screenshot the run captured. The narrative is the product; a single index.html is a table of contents for files that aren't there.

Publish the directory

Zip target/site/serenity and drop it into Comma:

  • index.html becomes the report body.
  • Every requirement page, test page, stylesheet, script and screenshot uploads alongside, and the relative links between them are rewritten to the uploaded copies — so clicking from a failing scenario into the step that failed, and into the screenshot taken at that moment, still works.
  • Scripts run inside a sandboxed iframe with no same-origin access, so the tabs and filters behave — interactive HTML reports.

Trim the screenshots first

The default screenshot policy is generous. In serenity.properties:

serenity.take.screenshots=FOR_FAILURES

Options run from FOR_EACH_ACTION (a PNG per interaction — thousands of files on a real suite) down through AFTER_EACH_STEP and FOR_FAILURES to DISABLED. FOR_FAILURES is the setting that makes the report both publishable and readable: evidence where something went wrong, nothing where it didn't.

From CI

mvn clean verify -Dserenity.take.screenshots=FOR_FAILURES
mvn serenity:aggregate
zip -qr serenity.zip target/site/serenity

Publish the zip to a report id per branch. The URL stays stable and each run appends a revision — which is how you tell an intermittent failure from a new one, instead of losing last week's evidence to the artifact retention window. See publishing from CI and the Jenkins walkthrough, which covers the Content-Security-Policy setting that makes Jenkins serve these reports unstyled in the first place.

What review adds

  • Anchored threads on the failing step, next to the screenshot — commenting on HTML.
  • Revisions, so "this test has failed three nights running" is visible rather than remembered.
  • Access per report — private, team, domain-gated or link-based. See sharing & access control.

Limits

  • Assets: 25 MB per file, 250 MB and 500 files per report. A full-screenshot Serenity run blows past the file count; FOR_FAILURES is the fix, and it's the right setting anyway.
  • Entry HTML: 5 MB. 60 requests/minute per token.

Try it

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

Publish a Serenity report →

Related