Share a Nightwatch report

The useful part of a Nightwatch failure is rarely the assertion message. It is the screenshot taken at the moment it failed, and the sequence of steps that led there. Both of which are in the HTML report, and neither of which fits in the Slack message someone actually sends: "e2e is red again."

Publish it

npx nightwatch --reporter html || true

Nightwatch writes tests_output/nightwatch-html-report/index.html plus the screenshots it references. Publish the directory:

curl -fsS -X PATCH \
  "https://commareports.com/api/v1/reports/$COMMA_REPORT_ID" \
  -H "Authorization: Bearer $COMMA_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d "$(jq -n --rawfile html tests_output/nightwatch-html-report/index.html \
        --arg title "E2E — $BRANCH — build $BUILD_NUMBER" \
        '{title: $title, html: $html}')"

Or drag the whole nightwatch-html-report/ folder into the app, which uploads the screenshots as assets and rewrites the references to the uploaded copies. That second part is the step people skip, and it is why a report that looked fine locally shows empty image slots once it is somewhere else.

|| true because the failing run is the one worth publishing. PATCH on a per-suite report id keeps one URL with a revision per run.

What the URL changes

  • Comments on the failure, not about it. "This is the cookie banner again, not a regression" pinned to the step. See commenting on HTML.
  • Run-over-run history. Which build a flake started in, at a URL that does not expire with the artifact retention window.
  • No CI access needed. A designer or a PM opens a link.
  • Nightly runs. A routine refreshes the report on a schedule, so the suite has a current state without a push.

Limits

  • Entry HTML: 5 MB. Assets: 25 MB per file, 250 MB and 500 files total — a suite that screenshots every step can pass 500 files. Screenshot on failure only for the published report.
  • Scripts run, sandboxed: allow-scripts, no allow-same-origin.
  • 60 requests/minute per token.

Try it

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

Create your first report →

Related