Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon 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 desk6 min

How to Generate High-Resolution Screenshots and Videos with Cypress

Learn which Cypress settings control screenshot pixels, app viewport, capture mode, and video compression—and how to troubleshoot common artifact issues.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For sharper Cypress screenshots, configure the headless browser’s display dimensions and Chromium device scale factor; changing cy.viewport() alone does not create a retina capture. For video, enable recording in Cypress runs and tune videoCompression to balance image quality, file size, and encoding time.

Understand the three settings that control capture quality

“Resolution” can mean different things in Cypress. Keep these controls separate when diagnosing a soft or incorrectly sized artifact:

As an Amazon Associate I earn from qualifying purchases.

Control What it changes What it does not do
Headless browser display size The screen dimensions available to a headless browser. Cypress’s Chromium launch example sets this to 1400 × 1200. It does not set Cypress’s configured application viewport dimensions.
CSS viewport The dimensions the app lays out against, set through viewportWidth, viewportHeight, or cy.viewport(). Cypress explicitly says cy.viewport() does not simulate devicePixelRatio. A larger CSS viewport alone is not a retina screenshot.
Device scale factor On the documented Chromium headless setup, --force-device-scale-factor=2 is Cypress’s example of a retina-style capture. Behavior can vary by browser, Cypress release, operating system, and page; the documented pixel dimensions are examples, not universal guarantees.
Video compression Controls the video quality/file-size trade-off and adds encoding work when enabled. It does not change screenshot dimensions.

Cypress’s official browser launch API illustrates a 1400 × 1200 headless Chromium display and says a full-page screenshot can be 1400 × 1200 at scale factor 1 or 2800 × 2400 at scale factor 2 in that setup. Treat those figures as documented examples, not output guaranteed for every machine.

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.

Configure a higher-resolution headless screenshot

Set the headless browser’s launch arguments from setupNodeEvents in the relevant Cypress E2E or component configuration. The official Chromium pattern is:

#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB | 1920×1080 LED Monitor, 4ms GtG, Adaptive Sync, HDMI 1.4, Tilt Adjust, Low Blue Light, 4yr Advance Replacement Warranty
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
setupNodeEvents(on, config) {
  on('before:browser:launch', (browser, launchOptions) => {
    if (browser.name === 'chrome' && browser.isHeadless) {
      launchOptions.args.push('--window-size=1400,1200')
      launchOptions.args.push('--force-device-scale-factor=2')
    }
    return launchOptions
  })
}

For example, place the function inside the relevant configuration’s e2e or component section:

const { defineConfig } = require('cypress')

module.exports = defineConfig({
  e2e: {
    setupNodeEvents(on, config) {
      on('before:browser:launch', (browser, launchOptions) => {
        if (browser.name === 'chrome' && browser.isHeadless) {
          launchOptions.args.push('--window-size=1400,1200')
          launchOptions.args.push('--force-device-scale-factor=2')
        }
        return launchOptions
      })
    }
  }
})

The full configuration shown here follows Cypress’s documented CommonJS style; if your project uses a different configuration format, add the same event handler to its existing setupNodeEvents. The condition limits these Chromium-specific arguments to headless Chrome. Other browser families have different launch options, so do not assume the same flags apply to them.

Set the app’s CSS viewport separately

Use the Cypress config’s viewportWidth and viewportHeight for a consistent default layout, or set dimensions for an individual test with cy.viewport(width, height):

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB | 1920×1080 LED Monitor, 4ms GtG, Adaptive Sync, HDMI 1.4, Tilt Adjust, Low Blue Light, 4yr Advance Replacement Warranty
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
// In a test, choose the app layout explicitly:
cy.viewport(1280, 900)
cy.visit('/')

Cypress documents a default viewport of 1000 × 660 CSS pixels. Choose dimensions for the responsive layout you intend to test; use the browser display and scale-factor settings separately when you need more output pixels. See the official viewport API for the distinction: devicePixelRatio is not simulated by cy.viewport().

Choose the screenshot capture mode

Call cy.screenshot() for a deliberate screenshot. Its capture option selects the region; its scale option controls whether the app is scaled to fit the browser viewport.

Capture value What it captures Relevant behavior
viewport The current application viewport. Useful for a fixed-screen layout comparison.
fullPage The full application page. This is the screenshot API default. The browser setup and page can affect resulting pixel dimensions.
runner The Cypress runner UI. Automatic failure screenshots during cypress run use runner capture; scale is coerced to true for runner captures.

Example of an intentional full-page capture:

cy.screenshot('account-page', {
  capture: 'fullPage',
  scale: false
})

During cypress run, Cypress captures a screenshot on test failure by default and coerces the capture to runner. Set screenshotOnRunFailure: false in Cypress configuration to disable automatic failure screenshots. Check the current screenshot API for option details and version-specific behavior.

Rank #3
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

Record videos and tune compression

Video recording is disabled by default. Enable it in Cypress configuration with video: true; Cypress records per-spec videos during cypress run, not cypress open. Videos are saved in cypress/videos by default.

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

module.exports = defineConfig({
  video: true,
  videoCompression: 20
})

videoCompression is disabled by default. Setting it to true uses CRF 32; Cypress documents a CRF range of 1–51. Lower CRF means higher quality and larger files. Compression also uses processing time, and recorded Cypress Cloud runs can incur an interval while video is encoded and uploaded.

  • Choose a lower CRF when image detail matters more than storage or processing time.
  • Choose a higher CRF when smaller files matter more than preserving fine detail.
  • Compare captures from the same browser and environment; the result depends on actual page content and runtime, not CRF alone.

When video and compression are both enabled, Cypress can embed chapters for attempts in a spec in the MP4. Cypress documentation notes player support including VLC, QuickTime, and IINA. Cypress Cloud instead lists tests alongside a run video and lets a viewer jump to the corresponding point. See the official screenshots and videos guide and configuration reference.

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor | 100Hz, Game Mode, Advanced Eye Comfort, HDMI and D-sub Ports (LS27D366GANXZA)
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

Keep artifacts deterministic and recover from common problems

Make visual comparisons repeatable

  • Select the browser explicitly and keep its version and execution environment consistent.
  • Fix the CSS viewport for the layout under test, then configure headless display dimensions and scale factor independently.
  • Generate and compare captures in the same environment. Cypress’s visual testing guidance recommends a fixed viewport and same-environment comparisons.

Know where files go and when they are cleared

Cypress clears screenshot and video artifact folders before cypress run by default, including files in nested subfolders. Set trashAssetsBeforeRuns: false if prior artifacts must remain. Change the destinations with screenshotsFolder and videosFolder. For Cloud-recorded runs, videos are processed and uploaded after each spec unless handled according to the documented workflow.

Troubleshoot the usual mismatches

Symptom Likely cause What to check
The screenshot has the requested layout but not more pixels. Only the CSS viewport was increased. Keep cy.viewport() for layout; configure the headless browser display and, on the documented Chromium setup, device scale factor for output resolution.
The app appears at an unexpected responsive breakpoint. The CSS viewport was confused with the headless display dimensions. Set viewportWidth/viewportHeight or call cy.viewport() explicitly, and verify separately which browser is launched headlessly.
The screenshot includes Cypress controls instead of just the page. An automatic run-failure screenshot is a runner capture. Use explicit cy.screenshot() with capture: 'viewport' or 'fullPage' for page content, or disable automatic failure captures with screenshotOnRunFailure: false.
No video appears. Video is off by default, or the run used cypress open. Set video: true, run with cypress run, and inspect the configured videosFolder.
Video files are unexpectedly large or runs take longer. Compression is disabled or the chosen CRF/encoding trade-off does not fit the workflow. Enable videoCompression and choose a CRF based on acceptable quality, file size, and processing time.
Artifacts from an earlier run disappeared. Cypress cleared artifact folders before the run. Set trashAssetsBeforeRuns: false when retaining previous files is required.
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 website rather than test it in Cypress, ScreenshotNeo provides a screenshot API and MCP server. A single GET request can return PNG, JPEG, WebP, or PDF. For example, using cURL:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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. It accepts consent banners as a visitor and removes 60+ known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing status in headers. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. The free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

FAQ

Can cy.viewport() create a 2× retina screenshot?

No. It changes the app’s CSS viewport, but Cypress says it does not simulate devicePixelRatio. Set the headless browser’s device scale factor separately where supported.

Does Cypress record video in interactive mode?

No. Cypress records video per spec during cypress run when video is enabled; it does not record in cypress open.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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.

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
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

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.