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 desk3 min

Cypress Screenshot Not Saved After a Failed Test: How to Fix It

Cypress automatically saves failure screenshots during cypress run, not cypress open. Check the effective config, output folder, cleanup settings, and CI artifact upload.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If Cypress is not saving a screenshot after a failed test, run the test with cypress run, confirm that the effective configuration has screenshotOnRunFailure: true, and check the configured screenshots folder. Automatic failure screenshots are not taken by cypress open; in CI, also configure the job to retain or upload the folder.

1. Run Cypress in the mode that captures failure screenshots

Cypress automatically captures screenshots for failures during cypress run, including CI runs. It does not automatically take failure screenshots during cypress open. To check a particular spec, run:

As an Amazon Associate I earn from qualifying purchases.

npx cypress run --spec "path/to/spec.cy.js"

Replace the example path with the path to your spec. See Cypress’ screenshots and videos guide for the documented behavior.

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

2. Check the configuration Cypress actually uses

The documented default for screenshotOnRunFailure is true. A project configuration or runtime override can change it to false. If the command uses --config-file, check that file; if it uses --config, check the overrides as well. Consult the Cypress configuration reference for the installed version and testing type.

#1 Best Overall
Sandisk 2TB Extreme Portable SSD, Up to 1050MB/s, USB-C, USB 3.2 Gen 2, IP65 Water and Dust Resistance, Updated Firmware, External Solid State Drive, SDSSDE61-2T00-G25
  • Get NVMe solid state performance with up to 1050MB/s read and 1000MB/s write speeds in a portable, high-capacity drive(1) (Based on internal testing; performance may be lower depending on host device & other factors. 1MB=1,000,000 bytes.)
  • Up to 3-meter drop protection and IP65 water and dust resistance mean this tough drive can take a beating(3) (Previously rated for 2-meter drop protection and IP55 rating. Now qualified for the higher, stated specs.)
  • Use the handy carabiner loop to secure it to your belt loop or backpack for extra peace of mind.
  • Help keep private content private with the included password protection featuring 256‐bit AES hardware encryption.(3)
  • Easily manage files and automatically free up space with the SanDisk Memory Zone app.(5). Non-Operating Temperature -20°C to 85°C
const { defineConfig } = require('cypress')

module.exports = defineConfig({
  screenshotOnRunFailure: true,
  screenshotsFolder: 'cypress/screenshots',
})

For a TypeScript configuration using ES modules:

import { defineConfig } from 'cypress'

export default defineConfig({
  screenshotOnRunFailure: true,
  screenshotsFolder: 'cypress/screenshots',
})

Keep the settings in the configuration shape used by your installed Cypress version; do not assume the root configuration is active when the run selects another file.

3. Look in the configured folder and account for filenames

The default output folder is cypress/screenshots, unless screenshotsFolder changes it. Cypress organizes captures into spec-related subfolders. Automatic failure screenshots use the test name with (failed) appended; with retries, an attempt suffix may also appear. Search below the configured folder rather than checking only its top level. See the cy.screenshot() documentation for screenshot behavior.

Rank #2
Sandisk 1TB Portable SSD, Up to 800MB/s Read Speeds, Black (Old Model)
  • Solid state performance with up to 800MB/s read speeds in a portable drive. (Based on internal testing; performance may be lower depending on host device, interface, usage conditions and other factors. 1MB=1,000,000 bytes.)
  • Back up your content and memories on a storage solution that fits seamlessly into your mobile lifestyle.
  • Take it with you on your adventures—up to two-meter drop protection means this durable drive can take a beating. (Based on internal testing.)
  • Secure it to your belt loop or backpack for extra peace of mind thanks to the tough rubber hook.
  • From Sandisk, a brand professional photographers trust to take on assignments.

4. Check whether Cypress or CI removed the file

Cypress cleanup before a run

When trashAssetsBeforeRuns is true—the documented default—Cypress clears the contents of its downloads, screenshots, and videos folders before each cypress run. Set it to false if you need to keep artifacts from earlier runs. This preserves prior files; it does not change whether a new failure screenshot is captured.

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.

CI artifact retention after a run

Cypress writes the screenshot to the run’s filesystem, but that alone does not make it available after a CI job ends. Configure your CI system to upload or otherwise preserve the screenshots folder. The exact setting depends on the CI provider; Cypress’ test organization guide explains how Cypress structures tests, but artifact retention is a separate CI configuration.

Rank #3
SSK Portable SSD 500GB External Solid State Hard Drive USB C Up to 1050MB/s
  • Capacity Display Variance: 500GB external ssd often appears as around 465GB on Windows. MacOS can show full 500 GB capacity. This is binary calculation difference and doesn’t affect SSD hard drive actual physical storage
  • 1050 MB/s Speed: Instantly access to your files with blazing-fast 10Gbps external SSD read up to 1050MB/s and write up to 1000MB/s. LED Light indicates USB SSD instant activity
  • Data Security: Solid state drives S.M.A.R.T. health diagnostics​ and adaptive TRIM optimizing data block management ensures consistent write speeds and extends the longevity of the portable SSD
  • USB-C & USB-A Cable: Both cables featuring rapid USB 3.2 Gen2, this USB SSD effortlessly bridges devices, enabling seamless cross-platform file transfers and backup between computers, smartphones, tablets and iPhone
  • Always Fast: No slowdowns for large file transfers. With SLC caching (25% of current available capacity allocated as high-speed cache), this external SSD delivers steady 10Gbps for transfers within the cache capacity

5. Test whether a screenshot can be written manually

Add a manual capture at a useful point in the test:

cy.screenshot('debug-check')

Then look for it beneath the effective screenshotsFolder. A manual capture can help reveal a path or write-access problem, but a successful manual screenshot does not prove that automatic failure capture is enabled.

Rank #4
Sale
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400) | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
  • Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

Quick troubleshooting checklist

  • No automatic capture: verify that the test runs with cypress run, not only cypress open.
  • Capture option disabled: inspect the active config file and any --config overrides for screenshotOnRunFailure: false.
  • Folder seems empty: check the configured screenshotsFolder and search its spec-relative subfolders for (failed) filenames and retry attempt markers.
  • Older files disappeared: check trashAssetsBeforeRuns; its default cleanup applies before a run.
  • File exists locally but not in CI results: configure the CI job to upload or preserve the folder.
  • Need to isolate the output path: add cy.screenshot('debug-check') and inspect the configured folder.
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 what you need is a screenshot of a website rather than Cypress’ own failed-test artifact, ScreenshotNeo can return an image or PDF with one GET request. Its API is not a replacement for Cypress failure screenshots: it captures a URL, while Cypress captures the state of the app during a test.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Samsung T7 Portable SSD 1TB Titan Gray, USB 3.2 Gen 2, Up to 1,050MB/s | Reliable External Solid State Drive Storage for Gaming, Students, Professionals (MU-PC1T0T/AM)
  • MADE FOR THE MAKERS: Create; Explore; Store; The T7 Portable SSD delivers fast speeds and durable features to back up any endeavor; Build your video editing empire, file your photographs or back up your blogs all in an instant
  • SHARE IDEAS IN A FLASH: Don’t waste a second waiting and spend more time doing; The T7 is embedded with PCIe NVMe technology that brings fast read and write speeds up to 1,050/1,000 MB/s¹, making it almost twice as fast as the T5
  • ALWAYS MAKE THE SAVE: Compact design with massive capacity; With capacities up to 4TB, save exactly what you need to your drive – from large working files to game data and everything in between
  • ADAPTS TO EVERY NEED: Whether using a PC or mobile phone, count on the T7 for extensive compatibility²; It’s a true team player when it comes to heavy-duty application usage or file-saving
  • HI RESOLUTION VIDEO RECORDING: Record Ultra High Resolution (4K 60fs) videos directly onto the T7 Portable SSD with your favorite camera or mobile devices; Supports iPhone 15 Pro Res 4K at 60fps video and more³

ScreenshotNeo API documentation

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are not billed. It also offers an MCP server for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots.

Sign up for ScreenshotNeo’s free plan

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.

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
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

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.