For a screenshot you capture explicitly, generate a filename-safe timestamp and pass it to cy.screenshot():
const timestamp = new Date().toISOString().replace(/[:.]/g, '-')
cy.screenshot(`checkout-${timestamp}`)
The result is a name such as checkout-2026-10-03T20-34-05-046Z.png. This uses UTC time and makes the colon and period characters safe for common filesystems. If you also need timestamps on Cypress’s automatic test-failure screenshots, use Cypress’s Node after:screenshot event; that is a separate, post-capture workflow.
As an Amazon Associate I earn from qualifying purchases.
Name an explicit screenshot with a timestamp
cy.screenshot() accepts a name. When supplied, Cypress uses it instead of the default suite or test name. Add a timestamp to that name at the point where you call the command:
const timestamp = new Date().toISOString().replace(/[:.]/g, '-')
cy.screenshot(`checkout-${timestamp}`)
toISOString() produces a UTC timestamp ending in Z. Replacing colons and periods with hyphens yields a filename-friendly value while retaining the date and time structure. Cypress adds the image extension, such as .png, according to the screenshot format.
#1 Best Overall
- 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
You can include a relative subdirectory in the screenshot name; Cypress creates the directory structure. For example:
const timestamp = new Date().toISOString().replace(/[:.]/g, '-')
cy.screenshot(`checkout/${timestamp}`)
See the Cypress cy.screenshot() API documentation for command options and naming behavior.
Rank #2
- 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.
Use a reusable helper when many tests need the same format
If several explicit captures need a consistent prefix and timestamp, put the formatting in a helper rather than repeating it:
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →function takeTimestampedScreenshot(name) {
const timestamp = new Date().toISOString().replace(/[:.]/g, '-')
cy.screenshot(`${name}-${timestamp}`)
}
// In a Cypress test:
takeTimestampedScreenshot('checkout')
This is ordinary JavaScript around the Cypress command, not a special Cypress filename-template setting. Add a sequence or random component if your workflow requires uniqueness even when two captures occur within the same clock resolution; timestamps alone do not guarantee that.
Rank #3
- 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
Use a different approach for automatic failure screenshots
The timestamp argument above applies to screenshots your test explicitly requests. Cypress also captures screenshots automatically for test failures during cypress run; it does not automatically capture failures in cypress open. Cypress does not document a filename-template option that adds a timestamp to all automatic captures.
For centralized handling after screenshots are saved, use the Node after:screenshot event in the Cypress configuration file. The event receives screenshot information including the saved path, and is intended for post-capture handling. This lets you inspect or process the actual artifact path rather than guessing it from the spec name. Consult the current Cypress Node Events documentation for supported event arguments and return behavior before implementing a rename or other filesystem operation.
Rank #4
- 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.
The command-level onAfterScreenshot callback is also post-capture: it receives details such as the saved path and dimensions. It is useful for recording or acting on the completed capture, but the filename has already been selected by then. See Cypress.Screenshot API documentation.
Account for Cypress artifact behavior
- The default screenshot directory is
cypress/screenshots. Cypress path organization can depend on the spec location and the common ancestor of the specs selected for a run; use the path Cypress provides for downstream handling rather than reconstructing it. See Cypress screenshot and video capture guidance and Writing and organizing Cypress tests. - Cypress clears the screenshots folder before
cypress runby default. SettrashAssetsBeforeRuns: falsein configuration if that cleanup is not wanted. The relevant setting is described in Cypress configuration. - Cypress may append suffixes for duplicate screenshots, failures, and retries. A timestamp can reduce collisions, but do not assume it overrides Cypress’s suffix rules. See Cypress test retries.
Choose a timestamp format that fits your workflow
- UTC and chronological sorting: The ISO form with punctuation replaced, as shown above, is readable and sorts by date and time. The trailing
Zindicates UTC. - Stricter filename portability: Replace the
TandZmarkers too if your downstream system has stricter naming rules. For example,new Date().toISOString().replace(/[:.TZ]/g, '-')yields a more uniformly hyphenated value. - Local time: If filenames must reflect a local timezone, format the date explicitly for that timezone. Do not treat the
Z-terminated ISO value as local time. - Collision resistance: For captures that could share a timestamp, append a counter or random identifier. Clock skew can also affect ordering across machines, so use a run or sequence identifier when those distinctions matter.
Troubleshooting timestamped screenshot names
The timestamp is missing from a failure screenshot
Check whether the screenshot came from an explicit cy.screenshot() call or Cypress’s automatic failure capture. The name argument covers the explicit call; automatic captures need centralized handling through the Node after:screenshot event, and any rename should use the saved path supplied by Cypress.
Best Value
- 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³
The filename contains an unexpected suffix
Cypress may add suffixes for duplicate names, retries, or failure captures. Treat your timestamp as part of the requested name, not a guarantee that Cypress will omit its own artifact-identification suffixes.
The output path differs between runs
Cypress’s screenshot path can depend on which specs are selected. Avoid hard-coding a reconstructed path for post-processing; inspect the event’s actual path. Also check whether trashAssetsBeforeRuns is cleaning the screenshot directory before a run.
Two screenshots still collide
Timestamp precision is not a uniqueness guarantee. Add a per-run counter or random component if captures may happen within the same clock resolution, especially when multiple workers write artifacts concurrently.
Recommended Free Tools
Or skip the browser setup
If your goal is a screenshot of a website rather than a Cypress test artifact, ScreenshotNeo provides a website screenshot API and MCP server. A single GET request returns an image or PDF; see the 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 accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and billing status. Its MCP server gives AI agents tools to take screenshots, get page information, and capture PDFs. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.
Sign up for 1,000 free screenshots a month—no card required.
Quick Recap
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.




