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

Use two retention paths together: let Cypress create failure screenshots (and videos when enabled), upload those folders plus terminal output as CI artifacts in an always-run post-test step, and record the run to Cypress Cloud when you need searchable history or Test Replay. Test Replay is the part that preserves rendered DOM and CSS, Cypress command events, network traffic, console logs, JavaScript errors, and element-rendering context; a PNG or MP4 alone is not a DOM snapshot.

Protect every captured artifact as potentially sensitive test data. Mask secrets, suppress runner UI when appropriate, use a short retention period, and decide whether your CI system or Cypress Cloud is the canonical copy.

What Cypress saves by default

In a cypress run execution, Cypress automatically takes a screenshot when a test fails. The default directory is cypress/screenshots. Cypress removes that directory before each run unless trashAssetsBeforeRuns is set to false.

Video recording is disabled by default. Set video: true to create one video per spec during cypress run; files go to cypress/videos unless you change videosFolder. That directory is also cleared before a run unless asset cleanup is disabled. Manual calls such as cy.screenshot('checkout-error') write into the screenshots folder as well.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
  • 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.

Neither a screenshot nor a video is a DOM snapshot. They show pixels and, in a video, their time sequence. To inspect the rendered DOM, CSS, requests, and console state at the failure point, enable Cypress Cloud Test Replay. If you need a standalone HTML file, write one explicitly during the test.

Optional standalone HTML snapshot

This command stores the current document as an artifact-friendly file. It is useful when you need a simple, provider-independent snapshot, but it does not include later DOM changes or network and console history.

cy.document().then((doc) => {
  const html = '<!doctype html>n' + doc.documentElement.outerHTML
  cy.writeFile('cypress/dom-snapshots/dashboard.html', html, { log: false })
})

Place the command after the state you want to inspect, such as immediately after an assertion that is likely to fail. Keep the path under a directory that your CI uploader will collect.

Configure screenshots, videos, and paths

A minimal cypress.config.js for CI can make the output locations explicit and expose the resolved paths in Node event logs:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const { defineConfig } = require('cypress')

module.exports = defineConfig({
  screenshotOnRunFailure: true,
  video: true,
  screenshotsFolder: 'cypress/screenshots',
  videosFolder: 'cypress/videos',
  trashAssetsBeforeRuns: true,
  e2e: {
    setupNodeEvents(on, config) {
      on('after:screenshot', (details) => {
        console.log(`Screenshot: ${details.path}`)
      })

      on('after:spec', (spec, results) => {
        if (results?.video) console.log(`Video: ${results.video}`)
      })

      return config
    }
  }
})

screenshotOnRunFailure is already true by default, but setting it explicitly documents the policy. Turn video on only for runs where motion evidence is useful; video files increase upload time and storage. The after:screenshot and after:spec events provide resolved paths, so a Node handler can copy files, add a commit or shard prefix, or pass them directly to a CI uploader.

Leave trashAssetsBeforeRuns: true when each CI job starts with a clean workspace. Set it to false only when a job intentionally combines outputs from multiple Cypress runs; otherwise an old file can be mistaken for evidence from the current run.

Rank #2
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
  • Easily store and access 5TB of 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 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.

Preserve local evidence as CI artifacts

Cypress writes files inside the job workspace. They disappear when the runner is destroyed unless your CI provider uploads them. Upload in a post-test step that runs even when Cypress exits non-zero. Include screenshots, videos, any custom DOM directory, the captured standard output, and machine-readable test results.

GitHub Actions example

The following workflow records stdout with tee, runs Cypress, and uploads evidence regardless of the test result:

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

on: [push, pull_request]

jobs:
  cypress:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci
      - name: Run Cypress
        id: cypress
        shell: bash
        run: |
          set -o pipefail
          npx cypress run 2>&1 | tee cypress-stdout.log
      - name: Upload Cypress evidence
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: cypress-${{ github.sha }}-${{ github.run_id }}
          if-no-files-found: ignore
          path: |
            cypress/screenshots/**
            cypress/videos/**
            cypress/dom-snapshots/**
            cypress-stdout.log
            cypress/results/**

set -o pipefail keeps the Cypress exit status when output is piped to tee. The always() condition is essential: a failed test is exactly when the files matter. Add the browser name and shard number to the artifact name when a matrix or parallel run can produce several jobs. If your CI system has a different uploader, use the same set of paths and its equivalent of an always-run condition.

Make artifact names and retention deliberate

  • Include commit SHA, workflow or run ID, browser, and spec shard in names so parallel jobs cannot overwrite one another.
  • Keep artifacts only as long as the team needs to triage failures; the appropriate period depends on your organization and CI provider.
  • Restrict artifact access. Screenshots, videos, HTML, request payloads, and console output can contain credentials, personal data, or customer-like fixtures.
  • Do not assume that uploading a folder preserves files from a previous job. Each job needs its own upload, or an explicit aggregation step.

When to use Cypress Cloud and Test Replay

Run Cypress with --record and supply the record key through a masked CI secret such as CYPRESS_RECORD_KEY:

CYPRESS_RECORD_KEY=${CYPRESS_RECORD_KEY} npx cypress run --record

Cypress Cloud recording stores standard output, test results, test definitions, Cypress configuration excluding environment variables, screenshots, videos, and CI- and Git-related operating-system environment variables. Test Replay capture adds the rendered DOM and CSS, Cypress command events, network traffic, and browser console logs. At a failure, engineers can inspect the page and its requests and errors at the exact point captured, rather than reconstructing the state from pixels.

For GitHub Actions, the official Cypress Action supports record: true, failure reports, screenshots, videos, contextual details, and optional parallelization. Cypress also documents integrations for CircleCI, GitLab CI, Jenkins, and AWS CodeBuild. Recording is not a substitute for a local artifact upload when your organization requires provider-controlled retention or an offline copy; use both when that separation matters.

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.
Rank #3
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.

Native artifacts versus Cypress Cloud

Decision axis Native CI artifacts Cypress Cloud with Test Replay
DOM and log depth Exactly what you export: screenshots, videos, stdout, reports, and any custom HTML snapshot. Recorded stdout, screenshots, videos, plus rendered DOM/CSS, command events, network traffic, and console history when Test Replay capture is enabled.
Setup Configure folders and an always-run upload step; works with any CI provider. Add --record or the GitHub Action setting, protect a record key, and enable Test Replay capture.
Retention and access Controlled by your CI provider’s artifact policy and permissions. Hosted in Cypress Cloud under project access controls; the service supplies run context and search.
Sharing and search Usually download- or link-oriented and dependent on the CI provider. Run history and failure context are organized for investigation and team sharing.
Portability Files remain usable if you change CI vendors. Replay inspection depends on the Cypress Cloud recording.
Cost Uses the storage and retention allowance of your CI provider. Cypress publishes no universal retention period or workflow price in the material covered here; check the plan and retention terms for your organization.

Choose CI artifacts as the canonical copy when compliance, provider-controlled retention, or portability is primary. Choose Cloud recording when searchable run history and interactive failure context save more debugging time. A team can upload the same run to both, but define which system is authoritative so engineers know where to look first.

Security and privacy controls

Handle captured content as if it were an application log, not a harmless image. DOM and network data can include authorization headers, account details, tokens embedded in fixtures, and personally identifiable information.

Reduce what Cypress captures

  • Mask sensitive values in the application or test data before a failure can render them.
  • Use Cypress masking controls documented for your project, and review what is included in Test Replay.
  • Use --no-runner-ui when the Cypress Command Log or application-under-test content should not appear in screenshots or videos.
  • Keep the record key in the CI secret store; never commit it or echo it in a command.
  • Grant artifact and Cloud-project access only to people who troubleshoot the tests.

Performance and reliability trade-offs

Screenshots are the least expensive evidence to collect and are automatic for failures. Videos add rendering, encoding, and upload work for every spec, so enable them where motion or timing is diagnostically valuable. Test Replay sends substantially richer state and should be enabled when the team needs DOM, request, or console reconstruction rather than for every low-value smoke run.

Large suites benefit from deterministic naming and sharding. Upload while the workspace still exists, and verify that the uploader runs after the test command even when a process is interrupted. If your CI cancels jobs aggressively, configure the provider’s cancellation behavior so the post-test upload has a chance to execute, or rely on Cloud recording for runs that must remain available.

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

Troubleshooting

No screenshot appears after a failure

Confirm the command is cypress run, not an interactive-only workflow, and that screenshotOnRunFailure has not been disabled. Check the configured screenshotsFolder and the test’s permissions to write there.

The artifact is empty

The upload probably ran before Cypress finished or was skipped on failure. Put it in a separate step with if: always(), and do not use a shell command that masks Cypress’s exit code without pipefail.

Rank #4
Sale
Seagate Portable 4TB External Hard Drive HDD – USB 3.0, 1-Year Rescue
  • Easily store and access 4TB of 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
  • 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.

Old evidence is mixed with a new run

Cypress normally clears screenshot and video folders before a run. If you set trashAssetsBeforeRuns: false, clean or namespace the directories yourself and include the run ID in artifact names.

Videos are missing

Set video: true at the top level of the Cypress configuration and run with cypress run. Interactive cypress open sessions do not produce the same CI video output.

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

Cloud shows no failure

Cypress Cloud can only display a failure it captured. Verify that the command includes --record (or the Action’s record: true), that CYPRESS_RECORD_KEY is present as a secret, and that the job can reach Cloud. Recording a run is required before Test Replay data can be inspected.

Replay has pixels but no DOM or network details

Check that Test Replay capture is enabled for the project and that the run was recorded after the setting changed. A screenshot-only artifact cannot be upgraded into a DOM, CSS, network, or console history later.

Captured data contains a secret

Revoke the exposed credential, remove or restrict the artifact and Cloud run, then add masking or --no-runner-ui before rerunning. Treat the incident as a log-exposure event, not merely a test failure.

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 only need a clean visual capture of a web page for an artifact or review, ScreenshotNeo makes one HTTP request instead of requiring browser installation and screenshot plumbing. It is not a replacement for Cypress DOM snapshots, command logs, or Test Replay; use it when a standalone page image is the evidence you actually need.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
UnionSine 500GB Ultra Slim Portable External Hard Drive HDD-USB 3.0
  • [Upgraded Version] - This external hard drive features a mirrored logo stripe combined with a striped anti-slip design, and the rounded corners of the casing make it easier to grip. The stripes also have a heat dissipation function, ensuring stable and fast data transfer.
  • 【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.

Its API removes cookie-consent banners, newsletter popups, and chat widgets before capture. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and the response identifies the page verdict and billing status in headers. An MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients.

See the ScreenshotNeo documentation for authentication and options. The same request can be called from CI with cURL:

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

Python:

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)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

Every plan includes the capture features; the Free plan provides 1,000 screenshots per month without a card, and paid plans start at $5 for 3,000. Create a free ScreenshotNeo account to add clean visual captures to your CI evidence when they complement, rather than replace, Cypress’s DOM and log retention.

Frequently Asked Questions

Can a Cypress screenshot be converted back into a DOM snapshot?

No. A screenshot contains pixels only. Capture HTML during the test or enable Test Replay before the run if you need DOM, CSS, network, and console state.

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

Should CI artifacts and Cypress Cloud both be enabled?

They can coexist. Use CI artifacts for provider-controlled, portable files and Cloud recording for searchable run context; designate one as the canonical location for your team.

Does Cypress Cloud recording include environment variables?

The recorded configuration excludes environment variables, but captured page content, requests, and logs can still contain sensitive values, so masking and access controls remain necessary.

What should be retained for a flaky test?

Retain the failing screenshot, the relevant video when timing matters, stdout and test results, and a recorded Cloud run with Test Replay if the failure depends on DOM, network, or console state.

Quick Recap

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

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.