living-documentation-publisher
Converts passing Cucumber JSON output into stakeholder-facing living documentation: generates HTML reports via multiple-cucumber-html-reporter (Node) or Serenity BDD aggregate (JVM), applies Gherkin tags to drive report sections, and publishes to GitHub/GitLab Pages in CI. Use when BDD scenarios are in use and the team needs an always-current, non-test-engineer-readable document showing which acceptance criteria pass.
Install with skills.sh (any agent)
npx skills add testland/qa --skill living-documentation-publisherliving-documentation-publisher
Overview
Per the Serenity BDD book (serenity-bdd/the-serenity-book, living-documentation.adoc (opens in new window)):
"Living documentation is generated by the automated test suite, and is therefore by definition it is always up-to-date."
The same source distinguishes living documentation from plain test reports: living documentation is authored before development starts, targets the whole team (BAs, product owners, stakeholders), and reads as a business-functionality narrative, not a pass/fail table.
This skill covers the full workflow: produce Cucumber JSON from a passing suite, feed it into a report renderer, apply tag-based section routing, and publish the HTML artefact to a Pages endpoint so stakeholders get a URL, not a zip file.
Two primary renderers are covered:
When to use
If only engineers read the results, the JUnit XML feed to junit-xml-analysis (in the qa-test-reporting plugin) is sufficient.
How to use
Worked example
A Cucumber-JS "Checkout Service" suite has 24 scenarios tagged by capability (@billing, @cart) and sprint (@sprint-12); 2 are still @wip.
Step 1 - Produce Cucumber JSON output
The report renderers both consume Cucumber JSON. Configure the JSON formatter before wiring the renderer.
Cucumber-JS (in package.json):
{
"scripts": {
"test": "cucumber-js features/ --format json:reports/cucumber.json"
}
}For parallel shards, use a timestamped JSON filename to avoid overwrite - see references/node-reporter.md.
Cucumber-JVM with Serenity (in serenity.properties):
The CucumberWithSerenity runner captures results automatically; no explicit JSON formatter is needed. Serenity writes its own JSON artefacts to target/site/serenity/ as part of mvn verify (serenity-bdd/the-serenity-book, maven.adoc (opens in new window)).
Step 2 - Generate the HTML report (Node path)
For any Cucumber-JS project, render the JSON with multiple-cucumber-html-reporter: install it, add a scripts/generate-report.js that points jsonDir at ./reports/ and reportPath at ./docs/living-documentation/, then run npm test && node scripts/generate-report.js. Full install, script, and options table: references/node-reporter.md.
Step 3 - Generate the HTML report (JVM / Serenity path)
For Maven/Gradle projects running CucumberWithSerenity, bind the serenity-maven-plugin aggregate goal to post-integration-test and run mvn verify. The Requirements tab renders living documentation from the feature-directory hierarchy. Full plugin config, hierarchy labels, and readme.md enrichment: references/serenity-reporter.md.
Step 4 - Tag scenarios for report sections
Use Gherkin tags to categorise scenarios in both renderers.
In the feature file:
@billing @sprint-12
Scenario: Apply promo at checkout
Given ...Serenity tag filtering - run only tagged tests and limit the aggregate report to those requirements (serenity-bdd/the-serenity-book, filtering-reports.adoc (opens in new window)):
# Run and report on one sprint
mvn clean verify -Dcucumber.options="--tags=@sprint-12" \
-Dtags=sprint-12
# Post-run report filtered to a tag
mvn serenity:aggregate -Dtags=sprint-12Note: "requirements filtering only happens if you specify the tags option" (serenity-bdd/the-serenity-book, filtering-reports.adoc (opens in new window)).
Excluding pending/WIP from published docs:
# Cucumber-JS: exclude anything tagged @wip from the JSON
npx cucumber-js features/ \
--tags "not @wip" \
--format json:reports/cucumber.jsonThis keeps the living-documentation page free of scenarios that are not yet passing.
Step 5 - Only publish passing runs
Gate the report publication step on a green test exit code. In a shell script:
set -e
npm test # exits non-zero on any failure
node scripts/generate-report.js # only reached if all tests passFor Serenity, use serenity:check after verify (serenity-bdd/the-serenity-book, maven.adoc (opens in new window)):
mvn verify serenity:check # fails the build if any scenario is redThis ensures the published artefact reflects only a fully-green run.
Step 6 - Publish to GitHub Pages (CI)
Publish the generated HTML to GitHub or GitLab Pages so stakeholders get a URL, not a zip file. Full GitHub Actions and GitLab Pages jobs (including the Serenity publish_dir override): references/ci-publish.md.
Anti-patterns
| Anti-pattern | Why it fails | Fix |
|---|---|---|
| Publishing on any push, including red runs | Stakeholders see failing-scenario counts; erodes trust in the document | Gate publish on exit code 0 (Step 5) |
Including @wip / @pending scenarios in the report | Document shows work-in-progress as if it is accepted behaviour | Filter with not @wip before generating JSON |
| One flat tag for all scenarios | Stakeholders cannot navigate to a capability area | Apply two-level tags: @capability-name and @sprint-N |
| Publishing stale JSON from a previous run | Report shows old results after source changes | Delete reports/*.json at the start of each CI run before running tests |
| Embedding full screenshots in every step | HTML artefact becomes hundreds of MB | Use Serenity's evidence API (Serenity.recordReportData()) selectively, or configure take.screenshots=FOR_FAILURES in serenity.properties |
Limitations
References
Publish living documentation to Pages (CI)
View source (opens in new window)Publish living documentation to Pages (CI)
Publishes the generated HTML report to GitHub or GitLab Pages so stakeholders get a URL, not a zip file. Referenced from living-documentation-publisher (opens in new window) Step 6.
GitHub Actions
name: Living Documentation
on:
push:
branches: [main]
jobs:
publish-docs:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Run tests and generate report
run: |
npm ci
npm test
node scripts/generate-report.js
- name: Publish to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/living-documentationFor Serenity (JVM), replace the generate step and point publish_dir at target/site/serenity.
GitLab Pages
pages:
stage: deploy
script:
- npm ci
- npm test
- node scripts/generate-report.js
- mkdir -p public
- cp -r docs/living-documentation/* public/
artifacts:
paths:
- public
only:
- mainSee github-actions-test-jobs (in the qa-ci-integration plugin) for general CI test-job conventions.
Node report renderer: multiple-cucumber-html-reporter
View source (opens in new window)Node report renderer: multiple-cucumber-html-reporter
Renders Cucumber JSON into a stakeholder HTML report for any Cucumber-JS project. Referenced from living-documentation-publisher (opens in new window) Step 2.
Install
Install the reporter as a dev dependency (multiple-cucumber-html-reporter installation (opens in new window)):
npm install multiple-cucumber-html-reporter --save-devTimestamped JSON for parallel shards
Use a timestamped filename when running parallel shards to avoid overwrite (multiple-cucumber-html-reporter usage (opens in new window)):
cucumber-js features/ \
--format json:reports/cucumber-$(date +%s).jsonGenerate the report
Create scripts/generate-report.js:
const report = require("multiple-cucumber-html-reporter");
report.generate({
// required
jsonDir: "./reports/",
reportPath: "./docs/living-documentation/",
// identification metadata shown in the report header
metadata: {
browser: { name: "chrome", version: "latest" },
device: "CI runner",
platform: { name: "linux", version: "22.04" }
},
// custom info block (release, project, branch)
customData: {
title: "Run info",
data: [
{ label: "Project", value: "Checkout Service" },
{ label: "Release", value: process.env.RELEASE_TAG || "dev" }
]
},
// display options
reportName: "Checkout Service - Living Documentation",
pageTitle: "Acceptance Criteria Status",
displayDuration: true,
durationInMS: true
});Run it after the test step (multiple-cucumber-html-reporter usage (opens in new window)):
npm test && node scripts/generate-report.jsOptions
Key options from the official docs (multiple-cucumber-html-reporter options (opens in new window)):
| Option | Type | Default | Purpose |
|---|---|---|---|
jsonDir | String | required | Directory of Cucumber JSON files |
reportPath | String | required | Output directory for the HTML report |
reportName | String | Title displayed in the UI | |
pageTitle | String | "Multiple Cucumber HTML Reporter" | HTML <head> title |
displayDuration | Boolean | false | Show step/scenario timing |
durationInMS | Boolean | false | Interpret step durations as ms not ns |
saveCollectedJSON | Boolean | false | Keep merged JSON for debugging |
customStyle | Path | Append a CSS file for brand colours | |
overrideStyle | Path | Replace all default CSS |
Sources
Serenity BDD aggregate report (JVM)
View source (opens in new window)Serenity BDD aggregate report (JVM)
Renders living documentation for Maven/Gradle projects that run CucumberWithSerenity. Referenced from living-documentation-publisher (opens in new window) Step 3.
Bind the Serenity Maven plugin
Add the Serenity Maven plugin and bind it to post-integration-test (serenity-bdd/the-serenity-book, maven.adoc (opens in new window)):
<plugin>
<groupId>net.serenity-bdd.maven.plugins</groupId>
<artifactId>serenity-maven-plugin</artifactId>
<version>${serenity.maven.version}</version>
<executions>
<execution>
<id>serenity-reports</id>
<phase>post-integration-test</phase>
<goals><goal>aggregate</goal></goals>
</execution>
</executions>
</plugin>Run
Run the full pipeline:
mvn verifyOr regenerate the report from existing test data without re-running tests:
mvn serenity:aggregateRequirements hierarchy
The Requirements tab of the generated report renders living documentation: Serenity reads the directory hierarchy under src/test/resources/features/[theme]/[capability]/ and maps it to the requirements hierarchy (serenity-bdd/the-serenity-book, living-documentation.adoc (opens in new window)).
Set hierarchy labels in serenity.properties:
serenity.requirements.types=theme,capability,storyAdd a readme.md at each directory level; Serenity renders it as contextual prose above the scenario list, turning the Requirements tab into a readable illustrated user manual (serenity-bdd/the-serenity-book, living-documentation.adoc (opens in new window)).
Sources
Related skills
acceptance-test-from-criteria
ATDD (Acceptance Test-Driven Development) workflow that generates @AC-N-tagged Gherkin scenarios from a signed-off acceptance-criteria list, scaffolds NotImplementedError step stubs, and produces an AC-to-test traceability table, all before implementation begins, in the team's BDD framework (Cucumber / Behave / Reqnroll). Use when devs are gated on green acceptance tests and failures must map back to a specific criterion. For story-narrative-to-Gherkin without prior ACs, use gherkin-from-stories. For BDD scenario authoring without the ATDD test-first gate, use a general BDD scenario-authoring workflow.
bdd-overview
Teaches behaviour-driven development end to end for a newcomer: what BDD is and how discovery, formulation and automation fit together; a decision table that picks the runner from the project's language and build files (Cucumber-JVM, Cucumber-JS, Cucumber-Ruby, Behave for Python, Reqnroll for .NET, and why SpecFlow is end-of-life); install and first-run commands for each; the declarative-versus-imperative Gherkin discipline with a worked bad-versus-good pair; Background, Scenario Outline and domain-organised step libraries; the traps that make BDD collapse into an expensive UI-automation wrapper; and an honest account of when BDD is not worth adopting. Use when a team is adopting BDD, choosing a Gherkin runner, or a *.feature file needs writing and nobody has settled the conventions.
bdd-step-library-curator
Keeps a BDD step-definition library DRY across a Cucumber / Behave / Reqnroll project - inventories every step definition, detects duplicates (different patterns matching the same intent), recommends canonical consolidations, reorganizes steps by domain, and publishes a step-library README the team greps for "is there already a step for X?" before authoring new ones. Use when a BDD project's step count grows past ~50, on a quarterly step-library review, or when a new engineer cannot find an existing step and is about to write a duplicate.
behave-testing
Configures Behave for Python BDD scenarios - `pip install behave`, authors `.feature` files in Gherkin, writes step implementations in `features/steps/*.py`, configures via `environment.py` for setup/teardown hooks, organizes via tags, runs via `behave`. Use for Python codebases that want Cucumber-family BDD without Cucumber-Ruby / Cucumber-JS.
cucumber-testing
Configures Cucumber for BDD scenarios - Cucumber-JVM (Java/Kotlin via JUnit 5), Cucumber-JS (Node), Cucumber-Ruby. Authors `.feature` files in Gherkin, writes step definitions in the host language, runs via the framework's runner, integrates with JUnit XML reporting. Use when the user mentions Cucumber, Gherkin, `.feature` files, or behavior-driven (BDD) tests in Java, Kotlin, JavaScript, or Ruby, as the canonical wrapper for any of the three official implementations.
gherkin-from-stories
Build-an-X workflow that converts user stories into Gherkin scenarios - extracts the actor / capability / value triple from "As a … I want … so that …", maps acceptance criteria to Scenario blocks, identifies parameterizable axes for Scenario Outlines, and emits a Feature file ready for `bdd-step-library-curator`-curated step definitions. Starts from the story itself rather than from an already-extracted acceptance-criteria list; this skill operates at the user-story layer and produces Gherkin directly. Emits Gherkin only: no step definition stubs and no runner detection. For a full runnable artifact (Feature file plus scaffolded step definitions), follow this skill with step-definition scaffolding for the detected runner. Use when a PM hands over a user story or a backlog of stories and the team's first test artifact is the `.feature` file rather than a separate AC doc.
manual-step-to-gherkin
Translates an existing manual test step (table row, prose bullet, TestRail/Qase exported step) into a declarative Gherkin Given/When/Then step phrased in business language - strips UI mechanics ("clicks the button", "types in the field"), elevates the user intent ("signs in", "adds the product"), and aligns vocabulary with the project's existing step library. The input is an already-written manual step - not a user story and not an acceptance-criteria list. Use when a team is migrating manual test scripts to BDD, or when a manual tester is handing a script off to an automation engineer.
reqnroll-testing
Configures Reqnroll (the canonical .NET BDD framework) - install via `dotnet add package Reqnroll`, author `.feature` files in Gherkin, write step bindings as `[Given/When/Then]`-decorated methods in any C# class, runs via `dotnet test`. Reqnroll is the SpecFlow successor (originated as a community port off the SpecFlow codebase); new .NET BDD work targets Reqnroll. Use for .NET projects starting BDD or migrating from SpecFlow.
specflow-testing
Maintains SpecFlow tests on existing .NET projects - authors Gherkin `.feature` files, writes C# `[Binding]` step definitions, runs them via xUnit/NUnit/MsTest, and migrates a project to Reqnroll. SpecFlow is the legacy .NET BDD framework and Reqnroll is its maintained fork. Use only for existing SpecFlow projects, especially mid-migration; new .NET BDD projects use `reqnroll-testing` instead.