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

Run Cypress from the command line with cypress run, keep Cypress’s automatic failure images in cypress/screenshots, and configure Mochawesome to emit one JSON file per spec. Merge those files with mochawesome-merge, then create the browsable report with marge. This gives you reliable screenshots and a consolidated HTML test report; the standard Mochawesome pipeline does not, by itself, guarantee that every screenshot is embedded in the HTML, so verify the image-link behavior in your project.

What the workflow produces

A useful CI result has two related but separate outputs:

  • Cypress failure screenshots: images captured when a test fails during a run.
  • Mochawesome results: JSON files that describe suites, tests, assertions and statuses, later merged into one HTML report.

Cypress documents the key distinction this way: it automatically captures screenshots when a failure happens during cypress run, but screenshots on failure are not automatic during cypress open. Use cy.screenshot() when you want a deliberate capture in interactive mode.

Prerequisites and a clean project layout

Install Cypress and the reporter tools in the project that runs your tests:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
npm install --save-dev cypress mochawesome mochawesome-merge marge

A typical result layout is:

cypress/
  e2e/
  screenshots/
  results/
mochawesome-report/

Cypress uses cypress/screenshots by default. Before a normal cypress run, it removes existing files and folders under the screenshots directory. That prevents yesterday’s failures from being mistaken for today’s results. If your pipeline intentionally preserves files in that directory, set trashAssetsBeforeRuns: false and use a run-specific artifact directory or naming convention so old images cannot be confused with new ones.

Configure Cypress and Mochawesome

JavaScript configuration file

For a CommonJS Cypress configuration, add the reporter and ask it for JSON only. Disabling per-file HTML keeps the run fast and leaves one merge step to produce the final report.

const { defineConfig } = require('cypress')

module.exports = defineConfig({
  e2e: {
    setupNodeEvents(on, config) {
      return config
    },
  },
  reporter: 'mochawesome',
  reporterOptions: {
    reportDir: 'cypress/results',
    overwrite: false,
    html: false,
    json: true,
  },
})

If your project uses cypress.config.ts or ESM, keep the same option values but use the module syntax already used by that project. Reporter option support belongs to the reporter, so check its installed version if an option is rejected.

Equivalent command-line configuration

You can leave the configuration file unchanged and supply the reporter options for one run:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
npx cypress run 
  --reporter mochawesome 
  --reporter-options reportDir="cypress/results",overwrite=false,html=false,json=true

overwrite=false is important when a run executes multiple specs: each spec can write a separate JSON result instead of replacing the previous file.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

Run tests and collect the automatic screenshots

Local or CI command

npx cypress run

On a failed test, Cypress writes an image beneath cypress/screenshots, normally in a path that reflects the spec and test title. A passing test does not need an automatic failure image. In CI, upload the complete cypress/screenshots directory as an artifact even when the test command exits non-zero; configure the CI job to collect artifacts on failure.

Interactive debugging

npx cypress open is useful for watching a test, but it does not automatically create a failure screenshot. Add an intentional capture where it helps diagnosis:

it('shows the account form', () => {
  cy.visit('/account')
  cy.get('[data-testid="account-form"]').should('be.visible')
  cy.screenshot('account-form-debug')
})

Keep deliberate screenshots focused; otherwise an interactive session can fill the same artifact directory with images that do not correspond to a CI run.

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

Merge JSON files and generate the HTML report

Merge all spec results

npx mochawesome-merge cypress/results/*.json -o mochawesome.json

The glob must match the files produced by the reporter. If your shell does not expand globs in the CI environment, list the files explicitly or use the merge tool’s supported input syntax.

Create the browsable report

npx marge mochawesome.json

The Cypress guide’s documented flow places the standalone HTML under mochawesome-report by default. Publish both that directory and cypress/screenshots as CI artifacts. Whether images are embedded into the HTML or referenced as separate files depends on the reporter and its configuration; test the generated report from the same directory structure used by your artifact viewer.

Rank #3
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

A repeatable npm script

{
  "scripts": {
    "test:e2e": "cypress run --reporter mochawesome --reporter-options reportDir=cypress/results,overwrite=false,html=false,json=true",
    "report:e2e": "mochawesome-merge cypress/results/*.json -o mochawesome.json && marge mochawesome.json"
  }
}

Run npm run test:e2e first, then npm run report:e2e in a post-test step. Make the post-test step run even when the test command fails, provided at least one JSON result exists.

Should you use the screenshot-aware community reporter?

Cypress’s community extension directory lists cypress-mochawesome-reporter as a “Zero config Mochawesome reporter for Cypress with screenshots.” The listing shows version 5.0.0, updated July 2026, with Cypress >=6.2.0. It is community-maintained, not a built-in Cypress reporter.

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

Do not install it solely because its name implies compatibility with every project. Check the package’s current instructions against your Cypress version, Node version, module format and retry settings. In particular, confirm whether the generated report embeds images, links to files, or expects a particular directory layout. The package’s current setup is the authority for version-specific options; older README snippets are not a safe substitute.

Decision point Built-in screenshots + standard Mochawesome cypress-mochawesome-reporter
Automatic failure capture Cypress behavior during cypress run Uses Cypress capture while adding reporter integration
Report assembly JSON per run/spec, then mochawesome-merge and marge Follow the installed package’s current setup and output rules
Maintenance status Uses documented Cypress and Mochawesome components Community extension; verify compatibility before adoption
Image portability Retain screenshots as CI artifacts unless your integration links or embeds them Confirm embedding/link behavior in the version you install

The standard route is the conservative choice when you want the documented JSON/merge/HTML process and are comfortable managing images as separate artifacts. The community route is worth evaluating when screenshot-aware report presentation is more important than minimizing third-party integration risk.

Retries, filenames and flaky tests

When Cypress retries a failing test, it captures screenshots for failed attempts and adds an attempt marker to the filename. A second failed attempt can look like user-login-errors (failed) (attempt 2).png. Upload every matching file rather than retaining only the last image; otherwise the evidence that distinguishes a transient failure from a repeatable one can disappear.

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
  • Keep retry screenshots in the same artifact bundle as the Mochawesome HTML.
  • Do not write a cleanup script that removes files containing (attempt before artifacts are uploaded.
  • Use the test title, spec path and attempt suffix together when correlating an image with a report entry.

CI pipeline pattern

  1. Start from a clean workspace, or use a unique results directory for each job.
  2. Run Cypress with cypress run and overwrite=false.
  3. Preserve the command’s exit status so a failed test still fails the job.
  4. In an always-run post step, merge any JSON files that were produced and run marge.
  5. Upload mochawesome-report, mochawesome.json, cypress/results and cypress/screenshots.

For parallel CI machines, avoid having workers write to the same shared directory. Give each worker an isolated results and screenshot path, then merge the JSON files after all workers finish. If the final report references image paths, copy the worker screenshot trees into the artifact tree without changing relative paths.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting

No screenshot appears after a failure

  • Cause: The test ran in cypress open. Fix: run it with npx cypress run, or call cy.screenshot() explicitly.
  • Cause: A cleanup step deleted the directory. Fix: inspect the folder before cleanup and collect it in an always-run artifact step.
  • Cause: You are looking in the wrong location. Fix: check the effective screenshotsFolder value and nested spec directories.

Earlier screenshots vanished

Cypress clears cypress/screenshots before a run by default. Leave that behavior enabled for clean builds and archive each run’s artifacts, or set trashAssetsBeforeRuns: false only when you have a deliberate retention strategy.

The merged report is empty or merge fails

  • Confirm that the reporter wrote JSON by checking cypress/results after the test command.
  • Ensure html: false and json: true are being applied to the reporter you actually invoked.
  • Check that the shell glob matches files and that the post-test step runs in the same workspace.

The HTML opens but images are broken

Inspect the generated HTML for image references and compare them with the uploaded artifact paths. Keep the screenshots beside the report using the relative layout expected by the reporter. If you need a single self-contained file, verify that the selected reporter supports image embedding rather than assuming standard Mochawesome does it automatically.

Only one retry image is visible

Search the artifact directory for filenames containing (attempt 2), (attempt 3) and so on. Update artifact include patterns to retain all attempts, and avoid a post-processing step that normalizes names and overwrites them.

The community reporter breaks after an upgrade

Compare the installed package version, Cypress version and Node version with the package’s current documentation. Because the extension is community-maintained, treat a Cypress or reporter upgrade as a compatibility change and validate a failed test, a retried test and a multi-spec run before promoting it to CI.

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.
Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

Performance, reliability and storage considerations

Writing JSON during the run and generating HTML afterward avoids producing a separate HTML document for every spec. The main storage cost is screenshots, especially full-page images and retry attempts. Retain the report and images for the period your team needs to diagnose failures, then apply your CI system’s normal artifact expiration policy.

For reliable diagnosis, preserve the exact spec, browser, commit and retry context alongside artifacts. A screenshot without its corresponding report entry is difficult to interpret; a report without the image path is equally incomplete. Test the failure path itself periodically so a successful pipeline does not hide a broken artifact-upload rule.

Or skip the browser setup

If your goal is simply to obtain a clean screenshot of a URL rather than capture a Cypress test state, ScreenshotNeo provides a website screenshot API and MCP server. One GET request returns PNG, JPEG, WebP or PDF output. The API can accept the URL directly, so there is no browser-installation or page-automation setup in your application.

For example, using the documented API pattern (see the ScreenshotNeo API documentation):

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
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo accepts the cookie or consent banner before capture and removes more than 60 known consent platforms, newsletter popups and chat widgets; each cleanup step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and response headers identify the page verdict and whether the request was billed. Its MCP server exposes take_screenshot, get_page_info and capture_pdf for Claude, Cursor and other MCP clients. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots. This is complementary to Cypress failure capture: it screenshots a URL, not the live browser state at the moment a Cypress assertion fails.

Create a free ScreenshotNeo account to use the 1,000 monthly screenshots without a card.

Frequently Asked Questions

Can a Mochawesome report be moved to another CI system as one file?

Only if the selected reporter has embedded the images or the destination preserves the referenced screenshot paths. Otherwise publish the HTML together with its screenshot directory.

Is the listed 5.0.0 community reporter a Cypress guarantee?

No. The Cypress directory lists it as a community extension with Cypress ≥6.2.0; validate its current instructions and behavior against your installed versions before making it a CI dependency.

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

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.