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

To keep Cypress screenshots after a test run, upload the run’s cypress/screenshots directory as a CI artifact after Cypress finishes. In cypress run, Cypress captures failed-test screenshots by default and clears the screenshot folder before each run, so the CI upload must collect the current run’s files—even when tests fail. You can instead use Cypress Cloud to view screenshots attached to recorded results.

Where Cypress saves screenshots

In run mode, Cypress automatically takes a screenshot when a test fails unless failure screenshots are disabled. The default folder is cypress/screenshots; you can change it with the screenshotsFolder configuration option. The folder is output, not an archive: Cypress does not itself preserve a history of runs there.

Cypress clears the contents of the configured screenshot folder before cypress run by default. This includes nested folders. That behavior helps prevent a new artifact from accidentally containing images from an older run, but means you should upload the files before another run reuses the folder. See Cypress’s screenshot and video guide and configuration reference.

Failure screenshots are automatic in cypress run, not in the interactive cypress open workflow. For an intentional screenshot in a test, use cy.screenshot(); it can create named files and nested directories. See the cy.screenshot() documentation.

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.

Archive screenshots as a GitHub Actions artifact

Run Cypress and then upload the screenshot folder in a subsequent workflow step. Configure the upload action to run even if tests fail; otherwise a failed test step may prevent the files you need from being archived. Cypress’s GitHub Actions guide documents artifact uploads; check the current action documentation for its syntax and retention controls because those can change.

steps:
  - name: Install dependencies
    run: npm ci

  - name: Run Cypress tests
    run: npx cypress run

  - name: Archive Cypress screenshots
    if: ${{ always() }}
    uses: actions/upload-artifact@v4
    with:
      name: cypress-screenshots
      path: cypress/screenshots/
      if-no-files-found: ignore

This example assumes the default screenshot folder and that the workflow checks out the project and configures Node.js earlier. If you set screenshotsFolder to another location, use that path in the artifact step too. The if-no-files-found: ignore setting allows a successful run with no failure screenshots to complete without an upload error; use the provider’s current options to decide whether a missing directory should instead fail the workflow.

The upload step runs after Cypress whether tests pass or fail. The workflow can still be marked failed because of the Cypress step, while the artifact step makes the screenshots available for inspection. Find the artifact on the completed workflow run in GitHub Actions. For current Cypress guidance, see Run Cypress tests in GitHub Actions.

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.

Keep paths and cleanup behavior predictable

Set a deliberate output folder

If you customize screenshotsFolder, keep the setting and CI artifact path in sync. Cypress organizes screenshot directories in relation to spec paths, and the shared ancestor can change as the set of specs changes. Avoid scripts that guess the full screenshot path from a spec filename.

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

Use Cypress-reported paths for file processing

If you need to copy, rename, or partition screenshot files before upload, use the resolved file path provided by screenshot callbacks or Cypress’s after:screenshot and after:spec Node events. The screenshot command documentation describes screenshot behavior and callbacks; the test organization guide explains generated test assets and repository organization.

Choose whether generated screenshots belong in Git

Screenshots are generated output. Many projects exclude screenshots, downloads, and videos from source control and retain them through CI artifacts instead. If you want that arrangement, add the generated directory to .gitignore, for example:

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)
cypress/screenshots/

Do not ignore the folder if your project deliberately versions selected images; in that case, keep generated run output separate from files you maintain in Git.

Choose CI artifacts or Cypress Cloud

Need CI-provider artifact Cypress Cloud
Downloadable files from a workflow Upload the screenshot directory as a workflow artifact; path and availability depend on the provider’s workflow settings. Recorded run artifacts can be viewed alongside test results.
Test results and screenshots together Depends on how your CI workflow publishes test results and artifacts. Cypress documents screenshots and other run data attached to recorded test results.
Retention period Set or verify the provider’s artifact retention controls. Retention depends on the applicable account and plan; Cypress documentation does not establish one universal duration.
Best fit Teams that want ordinary files available from their existing CI job. Teams that want a managed interface for inspecting recorded test runs and their artifacts.

The right choice depends on whether you primarily need files to download or interactive review tied to test results, along with your access-control and retention requirements. Verify current policy and account settings with your CI provider or Cypress Cloud before relying on a particular retention duration. See Recorded runs in Cypress Cloud.

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

Protect sensitive page data in screenshots

Review screenshots before making artifacts broadly accessible: they can contain customer details, tokens rendered in the UI, or other private page content. Cypress supports blackout selectors, but documents that blackout applies to viewport captures and not runner captures. Confirm the capture mode and test the resulting image rather than assuming sensitive values were masked. Details are in the Cypress.Screenshot API documentation.

Timing and reliability considerations

Screenshot capture is asynchronous. Cypress describes it as taking around 100 ms, and the page may change between issuing the screenshot command and the actual capture. Treat the image as a useful record of rendered state, not necessarily an exact frame of the instant the command was called. If the page is still updating, wait for a stable state before capturing; the cy.screenshot() reference covers command behavior.

For dependable archiving, upload after the test process has completed, use the configured output path, and make the artifact step run under the provider’s failure-handling condition. If you run Cypress again before the upload, its default cleanup can remove the prior screenshots.

Troubleshoot missing or unexpected screenshots

  • No screenshots after a passing run: Cypress’s automatic screenshots are for failed tests in cypress run. Add cy.screenshot() where you need an intentional capture.
  • No artifact after a failed test: Check whether the upload step was skipped because an earlier step failed. Configure it to run after failures, using your CI provider’s current syntax.
  • Artifact exists but is empty: Confirm a screenshot was produced, the action points at the actual configured screenshotsFolder, and the folder was not removed or changed before upload.
  • Old images appear in the artifact: Check whether trashAssetsBeforeRuns has been set to false, or whether your workflow collects a separate persistent directory. By default Cypress clears the screenshot folder before a run.
  • A script cannot find a screenshot: Do not reconstruct a path from a spec name; spec-set changes can alter directory structure. Use the resolved path provided by Cypress callbacks or Node events.
  • Sensitive content is visible: Verify whether the capture was a viewport or runner capture and whether the blackout behavior applies to that capture. Restrict artifact access if the image should not be shared.
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 the job is to capture a website outside Cypress rather than preserve Cypress test evidence, ScreenshotNeo offers a screenshot API and MCP server. One GET request can return an image or PDF; its options include full-page capture, viewport and device settings, waiting, and custom CSS or JavaScript. The API accepts a URL and can return clean shots after removing cookie banners, popups, and chat widgets. Those cleanup steps can be turned off.

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.

For example, save a WebP capture of Stripe with cURL:

Best Value
Sale
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 setup and request options. ScreenshotNeo says bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, with verdict and billing details in response headers. Its MCP server provides screenshot tools 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 free for 1,000 screenshots a month, with no card required.

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 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.

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