Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk5 min

How to Archive Website Screenshots from Cypress Test Runs

Cypress saves failed-test screenshots during cypress run, but CI must preserve them. Learn how to upload the right folder and avoid missing or stale artifacts.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To keep Cypress screenshots after a test job ends, upload the run’s screenshot folder as a CI artifact after Cypress finishes. In cypress run, Cypress captures failed-test screenshots automatically by default and saves them to cypress/screenshots. Cypress clears that folder before each run by default, so the artifact should collect the current run’s files after the test command—even when tests fail.

What Cypress captures and where it saves the files

Failure screenshots are enabled by default in cypress run, but Cypress does not automatically take them in cypress open. The default configuration saves screenshots to cypress/screenshots; you can change the location with screenshotsFolder. You can also create additional screenshots with cy.screenshot().

As an Amazon Associate I earn from qualifying purchases.

By default, trashAssetsBeforeRuns is true. Before a run, Cypress removes the contents of the screenshots folder, including nested files and directories. That makes the folder a useful source for artifacts from the current run, but it also means files from an earlier run will not remain there. Set this option to false only when you deliberately want files to persist between runs, and take care not to upload stale images as though they came from the latest run. See Cypress screenshot and video documentation and the configuration reference.

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

Upload screenshots as a CI artifact

The general workflow is to run Cypress, then have your CI provider upload cypress/screenshots as a workflow artifact. Configure the upload step to run after a failed test step as well as a successful one, using the provider’s supported failure condition. Otherwise, the job can discard the screenshots that are most useful for debugging.

#1 Best Overall
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.
  1. Choose the output folder. Keep the default cypress/screenshots, or set screenshotsFolder in Cypress configuration. If you change it, use the same path in your CI artifact configuration.
  2. Run Cypress. Use your existing cypress run command. Cypress writes failure screenshots to the configured folder when failure capture is enabled.
  3. Upload after the run. Add your CI provider’s artifact-upload step after the Cypress step and point it at the screenshot folder. Configure it to run when tests fail if the provider supports that behavior.
  4. Check the artifact. Confirm a failed test produces an artifact containing the image files, then confirm that the artifact is available after the job ends and can be downloaded by the intended reviewers.

Cypress’s GitHub Actions guide documents artifact actions in a Cypress workflow. Artifact syntax and retention controls belong to the CI provider and can change, so check that provider’s current documentation for the exact upload action, failure condition and retention settings.

Use the actual screenshot paths in scripts

Cypress’s screenshot directory structure reflects spec paths, and the shared ancestor in those paths can change when the set of specs changes. If a script copies, renames or separates screenshots, do not assume a permanent path derived from a spec’s name. Use paths reported by screenshot callbacks or the resolved file paths exposed by Cypress’s after:screenshot and after:spec Node events. The cy.screenshot() documentation describes screenshot output and related events.

Rank #2
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
  • Easily store and access 1TB to content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop. Reformatting may be required for Mac
  • 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.

Generated screenshots, downloads and videos are often excluded from source control. Whether to ignore them depends on whether your team intentionally commits any of those assets; archiving them as CI artifacts does not require committing them to the repository. Cypress discusses generated assets in Writing and organizing Cypress tests.

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

Choose between CI artifacts and Cypress Cloud

CI-provider artifacts are a direct fit when your team wants downloadable files attached to a workflow. Cypress Cloud is another route: recorded runs can present screenshots and other run data alongside test results. The choice depends on whether your team needs files only or wants test results and artifacts together in a managed debugging interface.

Rank #3
Sale
WD 2TB Elements Portable External Hard Drive for Windows, USB 3.2 Gen 1/USB 3.0 for PC & Mac, Plug and Play Ready - WDBU6Y0020BBK-WESN
  • High capacity in a small enclosure – The small, lightweight design offers up to 6TB* capacity, making WD Elements portable hard drives the ideal companion for consumers on the go.
  • Plug-and-play expandability
  • Vast capacities up to 6TB[1] to store your photos, videos, music, important documents and more
  • SuperSpeed USB 3.2 Gen 1 (5Gbps)
Consideration CI-provider artifacts Cypress Cloud
Where screenshots appear As files attached to a CI workflow or job; exact interface depends on the provider. With recorded test results and run data in Cypress Cloud.
Retention Set according to the provider’s current artifact controls. Depends on applicable account and plan settings; check current retention for your account.
Access and sharing Depends on the CI provider’s workflow permissions and artifact controls. Depends on Cypress Cloud account settings and access controls.
Best fit Teams that want downloadable run files within their existing CI workflow. Teams that want a managed view of recorded results and associated artifacts.

Cypress documents artifacts in its GitHub Actions guide and recorded-run artifacts in Recorded runs in Cypress Cloud. Neither option has one universal retention duration or access policy that applies to every provider, account and plan; verify those details for your setup before relying on a particular retention period.

Protect sensitive page data in screenshots

Review screenshots before making artifacts broadly available. Cypress supports blackout selectors, but its documentation says blackout applies to viewport captures, not runner captures. Check which capture mode your test uses and confirm sensitive page values are not visible in the resulting artifact. See the Cypress.Screenshot API.

Screenshot capture is asynchronous. Cypress describes the operation as taking around 100 ms, and the rendered page can change between issuing the command and capturing the image. Do not treat a screenshot as a guaranteed exact frame of the instant the command ran; wait for the page state you need before capture.

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

Troubleshoot missing or misleading artifacts

  • No screenshot after a failure: Confirm the test ran with cypress run, not only cypress open, and check that screenshotOnRunFailure has not been disabled. Cypress documents the setting in its configuration reference.
  • The artifact folder is empty: Check that the upload step runs after Cypress and that its configured path matches screenshotsFolder. Also make sure the upload action runs on failure, if your CI provider requires an explicit condition for that case.
  • Older screenshots disappeared: This is expected with the default trashAssetsBeforeRuns: true. Upload each run’s output before the job ends; change the setting only if retaining files between runs is intentional.
  • A script cannot find an image: Avoid constructing paths from spec names. Use the file path reported by a screenshot callback or a Cypress Node event.
  • An image contains sensitive data: Validate the capture mode and blackout behavior, then restrict access to or remove the artifact as appropriate. Blackout selectors do not apply to runner captures.
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 you need screenshots of web pages outside a Cypress test run, ScreenshotNeo is a website screenshot API and MCP server for developers. Its one-request API can return an image or PDF; this example saves a WebP screenshot:

Best Value
UnionSine 1TB Ultra Slim Portable External Hard Drive HDD-USB 3.0
  • 【Upgraded version】 - The mirror logo strip is combined with the striped non-slip design. The rounded corners of the shell are more suitable for holding. The strips play a heat dissipation function to ensure a stable and fast transmission process.
  • 【Ultra-thin and quiet】 - The motherboard adopts JMicron 578 noise-free solution, giving you a quiet working environment. Lightweight and portable size designed to fit in your pocket for easy portability.
  • 【Ultra-Fast Data Transfers】 - Pairing this external hard drive with JMicron 578 solution USB 3.0 and USB 2.0 interfaces enables blazing-fast data transfer. It boasts theoretical read speeds of up to 125MB/s and write speeds of up to 103MB/s.
  • 【Plug and Play】 - With no software to install, just plug it in and the drive is ready to use.The hard disk chip is wrapped with an aluminum anti-interference layer to increase heat dissipation and protect data.
  • 【What You Get】 - 1 x Portable Hard Drive, 1 x USB 3.0 Cable, 1 x User Manual, Gift-type shell packaging ,Three-year manufacturer's warranty and free technical support services.

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 API documentation for request options. ScreenshotNeo accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups and chat widgets before capture; each of those steps can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and response headers report the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info and capture_pdf tools 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; yearly billing gives two months free. Sign up for ScreenshotNeo’s free plan.

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

Quick Recap

SaleBestseller No. 1
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
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
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$129.99
Bestseller No. 2
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$119.80
SaleBestseller No. 3

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
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair 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.