October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

How to Generate BackstopJS HTML Reports in CI

Use BackstopJS’s browser report setting for visual HTML output in CI, add the separate CI reporter for JUnit, and retain the report directory as a job artifact.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set BackstopJS’s report option to ["browser"], then run backstop test in your CI job. This creates the browser-readable visual report. If you also need a machine-readable report for the build system, enable "CI" as a separate report type; BackstopJS documents that output as JUnit, not HTML.

Configure the HTML report

In your BackstopJS configuration, select the browser reporter and set the output directory if you want to control where the HTML report is written:

As an Amazon Associate I earn from qualifying purchases.

{
  "report": ["browser"],
  "paths": {
    "html_report": "backstop_data/html_report"
  }
}

The example report path is relative to the job’s current working directory. BackstopJS allows the path to be changed in configuration, so make sure the CI step runs from the expected project directory. See the BackstopJS README for the configuration options and command behavior; details can vary with the version installed in your project.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Run the test and retain its report in CI

  1. Install or otherwise make the project’s BackstopJS CLI available in the CI job, using the same version and configuration as the project’s visual tests.

    #1 Best Overall
    QWIK-Code Report Writing Template
    • report writing template for law enforcement
  2. Run backstop test from the project directory. The configured browser report is generated as part of the test run.

  3. Configure your CI provider’s artifact or publication step to collect backstop_data/html_report, or the directory you set in paths.html_report. The exact retention syntax depends on the CI provider; BackstopJS does not prescribe one universal artifact recipe.

  4. Use the process exit status to gate the job: BackstopJS returns 0 when tests succeed and 1 when anything fails. Retain the report separately so a failed job still leaves a visual record to inspect.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose HTML, JUnit, or both

The report array selects report types. The browser report is intended for human visual inspection; the CI report is for test-system integration and is documented as JUnit by default. Enable both when developers need the visual report and the CI platform needs a test report.

Configuration What it produces Use it for
"report": ["browser"] Browser-readable visual HTML report Reviewing screenshot differences
"report": ["CI"] CI report; documented default format is JUnit Build-system test integration
"report": ["browser", "CI"] Both report types Visual review and machine-readable results

Here is a configuration that enables both and customizes the CI report settings:

{
  "report": ["browser", "CI"],
  "paths": {
    "html_report": "backstop_data/html_report",
    "ci_report": "backstop_data/ci_report"
  },
  "ci": {
    "format": "junit",
    "testReportFileName": "myproject-xunit",
    "testSuiteName": "backstopJS"
  }
}

The documented default CI report location is [backstopjs dir]/test/ci_report/xunit.xml. Set paths.ci_report to choose another directory, and use ci.format, ci.testReportFileName, and ci.testSuiteName to configure the format, filename, and suite name. The CI reporter does not replace the browser HTML reporter.

Open the latest report

Use backstop openReport to open the latest test run’s report. This is useful for reopening the output after a CI-only run or after a run that did not launch the browser reporter automatically. The report files still need to be retained or downloaded from CI if you want to inspect them on another machine.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For report features that depend on BackstopJS’s remote HTTP service, including approving scenarios or viewing scenario browser logs, start the service in another terminal before opening the report:

BACKSTOP_REMOTE_HTTP_PORT=3000 backstop remote --config=<your config>

Replace <your config> with the configuration path used by your project.

Troubleshoot missing or unusable reports

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your CI workflow also needs clean screenshots of live pages, ScreenshotNeo can return an image or PDF from one GET request. For example, this cURL request saves a WebP screenshot:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo documentation for API details. It removes cookie banners, newsletter popups, and chat widgets before the shot; bot checks, blank pages, and failed loads are not billed; and its MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000. Sign up for ScreenshotNeo free.

Frequently Asked Questions

Does `report: [“CI”]` create an HTML report?

No. BackstopJS documents the CI report’s default format as JUnit. Add `”browser”` to the `report` array for the browser-readable visual report.

Can a CI job generate both report types?

Yes. Set `”report”: [“browser”, “CI”]` and configure the HTML and CI output paths as needed.

What does `backstop openReport` open?

It opens the latest test run’s report.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.