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.

Set Cypress’s project-level screenshotsFolder option in cypress.config.js or cypress.config.ts. Cypress uses cypress/screenshots by default; changing this option redirects both screenshots you request with cy.screenshot() and failure screenshots created by cypress run.

Set the screenshot folder in Cypress configuration

Open the configuration file Cypress loads for the project. Put screenshotsFolder at the top level of defineConfig. The value can be a relative project path such as artifacts/screenshots.

JavaScript (CommonJS)

const { defineConfig } = require('cypress')

module.exports = defineConfig({
  screenshotsFolder: 'artifacts/screenshots',
})

TypeScript or ECMAScript modules

import { defineConfig } from 'cypress'

export default defineConfig({
  screenshotsFolder: 'artifacts/screenshots',
})

After saving the file, new captures are written below artifacts/screenshots instead of cypress/screenshots. Keep the setting at the project level unless your configuration deliberately scopes it differently; Cypress reads the value from the configuration file it actually loads.

What Cypress puts in that folder

Manual screenshots

A call such as cy.screenshot() uses the configured folder. A named call is also relative to that folder:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
cy.screenshot('checkout/payment-form')

This creates a nested path under the screenshot root. Cypress’s documented layout is {screenshotsFolder}/{adjustedSpecPath}/{name}.png for a named screenshot and {screenshotsFolder}/{adjustedSpecPath}/{testName}.png when no name is supplied. The adjusted spec path keeps captures from different specs separated.

Failure screenshots during a run

When a test fails during cypress run, Cypress captures a failure image in the same configured folder. These automatic failure images are not taken while using cypress open.

Duplicate names

If a capture would collide with an existing filename, Cypress adds a numbered suffix. If replacement is intentional, pass overwrite: true in the screenshot options:

cy.screenshot('checkout/payment-form', { overwrite: true })

Use overwrite carefully in parallel or diagnostic runs: the latest capture can replace evidence that would otherwise remain available.

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

Control failure capture and cleanup

Disable automatic failure images

Set screenshotOnRunFailure: false when you want only explicitly requested screenshots:

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
const { defineConfig } = require('cypress')

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

This affects failure capture from cypress run; it does not remove screenshots created directly by cy.screenshot().

Keep artifacts between run commands

trashAssetsBeforeRuns defaults to true. Before cypress run, Cypress clears the contents of screenshotsFolder, including nested files and directories. Set it to false if a later run must retain earlier images:

const { defineConfig } = require('cypress')

module.exports = defineConfig({
  screenshotsFolder: 'artifacts/screenshots',
  trashAssetsBeforeRuns: false,
})

The cleanup occurs for the run command. Cypress does not trash these assets when you use cypress open. In CI, decide whether the folder is a disposable workspace or an artifact directory that your pipeline uploads before the job ends.

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

Choose a path that works locally and in CI

Choice Best use Trade-off
Relative path, for example artifacts/screenshots Shared repositories and reproducible CI jobs The directory is relative to the project Cypress runs from.
Dedicated repository folder, for example test-output/screens Keeping screenshots beside other test artifacts It can be confused with reports unless naming is explicit.
Absolute machine path A controlled build agent with a fixed filesystem layout It is less portable and may not exist, or be writable, on another developer’s machine or runner.

Cypress needs to be able to create the configured directory and its nested paths. Prefer a relative path checked into the project configuration, then have CI archive that directory after the run. If the directory is regenerated on every run, exclude it from source control; Cypress’s organizing-tests guidance uses cypress/screenshots/ as an example of generated content in .gitignore.

Verify that Cypress is using the new location

  1. Confirm the option is spelled exactly screenshotsFolder; the plural screenshots is part of the name.
  2. Make one explicit capture in a test, such as cy.screenshot('path-check').
  3. Run the test with cypress run and inspect the configured directory for the resulting PNG.
  4. Trigger a deliberate test failure if you need to verify automatic failure capture, then check the same directory.
  5. Inspect the generated subdirectories. The spec path and test name are part of Cypress’s normal naming layout, so the file may be deeper than the root you selected.

If an old cypress/screenshots directory remains, that does not prove the setting failed. It may contain files from an earlier configuration or from another project directory. Check the timestamp and the path of the newest capture.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Common problems and fixes

“My files still go to cypress/screenshots”

Usually Cypress is loading a different configuration file, the option is nested in the wrong object, or the test is running from another project directory. Put the option directly inside defineConfig({ ... }), verify the file extension and module syntax match the project, and run Cypress from the directory containing that configuration.

The folder is created but no image appears

Check that the test reached cy.screenshot(). For automatic images, remember that failure screenshots are produced by cypress run, not cypress open. Also check whether screenshotOnRunFailure was set to false.

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.

Earlier images disappear before the test starts

This is the default cleanup behavior: trashAssetsBeforeRuns: true clears the screenshot folder at the start of a run. Set it to false when preserving previous artifacts is required, or copy/upload the folder before launching the next run.

A nested name creates unexpected directories

Slashes in a screenshot name are treated as path segments. For example, cy.screenshot('actions/login/clicking-login') intentionally creates actions/login below the configured root. Use a simple name when you do not want additional nesting.

CI reports a permission or path error

The Cypress process must be able to create the configured directory and write files. Choose a workspace-relative directory that the runner owns, create it during job setup if your environment requires that, and avoid developer-specific absolute paths. If the job cleans workspaces between steps, upload the screenshots in the same job that runs Cypress.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Two captures have the same name

By default Cypress preserves both by adding a numbered suffix. Keep that behavior for diagnostics. Use overwrite: true only when a stable, single filename is part of your workflow.

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

Organize screenshots deliberately

Use the folder setting for the broad storage policy and screenshot names for meaningful checkpoints. A practical layout is a single project-relative root such as artifacts/screenshots, with names that identify the user journey:

cy.screenshot('checkout/cart')
cy.screenshot('checkout/payment')
cy.screenshot('checkout/confirmation')

Cypress will still include the adjusted spec path, so two specs can use the same checkpoint name without silently overwriting each other. If a CI system expects one known directory, configure that directory once and archive it after the run rather than moving individual files during tests.

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 your goal is to capture a URL rather than produce Cypress test artifacts, ScreenshotNeo provides a direct screenshot API and an MCP server for AI agents. One GET request returns PNG, JPEG, WebP, or PDF. Before capture it accepts the cookie or consent banner like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers.

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}`);

See the complete parameter reference in the ScreenshotNeo documentation. Options include full-page capture with lazy images loaded, CSS-selector element capture, dark mode, 12 device presets or any viewport, retina scale, PDF paper and page controls, custom CSS and JavaScript, clicks before capture, selector hiding, waits for selectors, delays or network idle, request and resource blocking, custom headers, cookies, user agents, Authorization, timezone, geolocation, transparent backgrounds, image resizing, configurable-TTL caching, signed image links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API, and an OpenAPI specification. Existing parameter names used by other screenshot APIs also work, which can simplify migration.

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

The 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 shots. Create a free ScreenshotNeo account.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

FAQ

Can I point screenshotsFolder outside the repository?

Yes, provided the Cypress process can create and write to that path. An absolute location is tied to a particular machine or runner, so a project-relative path is usually easier to share.

Does changing the option rename existing screenshots?

No. The setting determines where future captures are written; move or delete files from the previous location separately if you no longer need them.

What file type does Cypress create?

The documented Cypress screenshot naming pattern ends in .png; the folder option changes location, not that default screenshot format.

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

Frequently Asked Questions

Can I point screenshotsFolder outside the repository?

Yes, provided the Cypress process can create and write to that path. An absolute location is tied to a particular machine or runner, so a project-relative path is usually easier to share.

Does changing the option rename existing screenshots?

No. The setting determines where future captures are written; move or delete files from the previous location separately if you no longer need them.

What file type does Cypress create?

The documented Cypress screenshot naming pattern ends in .png; the folder option changes location, not that default screenshot format.

The Bottom Line

Set screenshotsFolder in the top level of defineConfig, then decide separately whether Cypress should capture failures and clear old artifacts with screenshotOnRunFailure and trashAssetsBeforeRuns.

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.