DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk6 min

How to Use Argos CI with Cypress Screenshots

A practical guide to installing Argos for Cypress, capturing screenshots in CI, stabilizing visual tests, and fixing common headless and upload issues.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To send Cypress screenshots to Argos CI for visual review, install @argos-ci/cypress, register its task in Cypress’s Node event setup, import its support file, and call cy.argosScreenshot() after the page reaches the state you want to compare. Argos adds the baseline and visual-diff workflow; Cypress’s built-in screenshot command alone does not compare images.

What Argos adds to Cypress screenshots

Cypress can save screenshots during a test run, including failure screenshots, but it does not perform image comparison itself. Argos captures screenshots during Cypress runs and provides a review workflow for visual changes, including CI and pull-request integration. See Cypress’s visual testing guide and the Argos Cypress integration reference.

As an Amazon Associate I earn from qualifying purchases.

The setup below uses the official JavaScript package, @argos-ci/cypress. The package registry’s version can change, so check its npm page before pinning a version. The code follows the documented integration pattern; it is not a claim of independent testing.

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

Install and configure the Cypress integration

1. Add the package

From the project root, install the package as a development dependency:

npm install --save-dev @argos-ci/cypress

2. Register the Argos task

In cypress.config.js, register registerArgosTask inside setupNodeEvents. This CommonJS example enables uploads when the CI environment variable is present, while allowing local runs without uploading:

const { defineConfig } = require("cypress");
const { registerArgosTask } = require("@argos-ci/cypress/task");

module.exports = defineConfig({
  e2e: {
    setupNodeEvents(on, config) {
      registerArgosTask(on, config, {
        uploadToArgos: !!process.env.CI,
      });
      return config;
    },
  },
});

If your configuration uses ES modules or a different Cypress configuration structure, preserve the same integration steps but adapt the module syntax to your project.

3. Load the support file

Import the Argos support module from the Cypress support file, conventionally cypress/support/e2e.js:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import "@argos-ci/cypress/support";

4. Capture a named checkpoint in a test

Visit the page and establish the intended state before taking the Argos screenshot. Use a stable, descriptive name that identifies the same visual checkpoint across runs:

// cypress/e2e/home.cy.js
it("captures the homepage", () => {
  cy.visit("http://localhost:3000");
  cy.argosScreenshot("homepage");
});

The sample assumes the application is available at http://localhost:3000; replace it with the URL appropriate to your test environment.

Enable uploads safely in CI

Configure the Argos project token in your CI provider’s secret or environment-variable settings according to Argos’s project setup. Do not commit the token to the repository. With uploadToArgos: !!process.env.CI, screenshots upload when CI is set and do not upload in an ordinary local run. Consult Argos’s Cypress documentation for current authentication and project setup details.

Make visual comparisons reliable

A screenshot can differ even when the intended UI has not changed. Stabilize the page and its rendering environment before treating a diff as a product regression.

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.

Wait for the right application state

  • Wait for the data and UI state under test, then assert that state before capturing. Avoid snapshots taken while rendering, animation, or network work is still in progress.
  • Use fixtures or network stubs when API responses would otherwise vary from run to run.
  • Control the clock and time-dependent content, such as timestamps, countdowns, or rotating promotions.

Keep rendering conditions consistent

  • Set an explicit Cypress viewport and use consistent CI rendering conditions for baselines and comparison runs.
  • Where possible, keep browser versions pinned and use the same browser and environment for both runs.
  • Use a meaningful page or element checkpoint rather than capturing incidental states throughout the test.

Use Argos stabilization options deliberately

Argos documents stabilization behavior including waiting for fonts and images, waiting for elements marked aria-busy to clear, hiding text carets and scrollbars, pausing GIFs, and stabilizing sticky or fixed elements. Its screenshot API also documents element capture, viewport sets, injected CSS, tags, alternate baseName values, and a comparison threshold whose reference default is 0.5. These details and defaults may change, so check the current API reference before relying on a particular default.

Hide or modify only the dynamic regions you cannot make deterministic. Argos provides CSS utilities for concealing or modifying dynamic content; masking too much can hide genuine visual regressions.

Handle headless viewport inconsistencies

Argos notes that Cypress viewport behavior can be inconsistent in some headless configurations. If screenshots have the wrong dimensions or vary between headless runs, set the browser dimensions in Cypress’s before:browser:launch hook before the browser starts. The Argos reference provides examples for Chrome, Electron, and Firefox; use the matching example for the browser you run and confirm the resulting viewport in CI.

Combine Argos with existing Cypress event handlers

Cypress supports only one handler per event. If another plugin already registers the relevant event handlers, do not simply add a second competing handler. Argos documents calling its argosAfterScreenshot and argosAfterRun handlers from your existing custom handlers so both integrations can run.

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

When to use Cypress screenshots versus Argos

Cypress’s cy.screenshot() saves images in interactive and run modes, and Cypress automatically captures screenshots on test failure during cypress run. The default output directory is cypress/screenshots; Cypress clears it before a run unless trashAssetsBeforeRuns is disabled. Use these built-in captures when you need artifacts for debugging. Use Argos when you also need a visual baseline and review workflow.

For broader visual testing, Cypress lists integrations including Argos, Applitools, Chromatic, Happo, LambdaTest SmartUI, Percy, Sauce Labs Visual, SmartBear VisualTest, and Wopee.io. The integration list establishes that these providers support Cypress, not their current prices or which service fits a particular project. Compare whether captures render in the test browser or through a service, how baselines and reviews work, which browsers and viewport widths are covered, and what controls exist for dynamic content. Verify current commercial terms directly with each provider.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting

No Argos screenshots appear in the build

  • Confirm that registerArgosTask runs inside setupNodeEvents and that the support import is loaded by the Cypress support file.
  • Check that the test calls cy.argosScreenshot() and that CI is set in the CI job when uploads are intended.
  • Verify the Argos project authentication is configured in CI secrets, not only on a developer’s machine.

The screenshot is captured too early or diffs on every run

Assert the required page state before capture. Control variable API responses and time-dependent content, wait for fonts and images where needed, and remove only uncontrolled dynamic regions with CSS. Keep viewport and browser conditions consistent.

The headless capture has unexpected dimensions

Set browser dimensions in before:browser:launch for the browser used in CI. Cypress viewport settings and the launched browser’s dimensions are separate parts of the rendering setup; confirm both when diagnosing mismatches.

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

An event plugin stops working after adding Argos

Check for duplicate Cypress handlers. Keep one handler for the event and invoke Argos’s documented after-screenshot and after-run callbacks from it where applicable.

Local screenshots are missing after a run

Cypress clears cypress/screenshots before runs by default. Set trashAssetsBeforeRuns to false if retaining that directory between runs is required; otherwise copy or process artifacts as part of the test workflow.

Or skip the browser setup

If your goal is a website screenshot rather than a Cypress visual-regression test, ScreenshotNeo can return an image or PDF from one request. Its capture flow accepts cookie banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step can be disabled. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. ScreenshotNeo also provides an MCP server for AI agents.

cURL example; see the ScreenshotNeo API documentation for parameters:

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

ScreenshotNeo is a separate screenshot API, not an Argos visual-diff integration; it returns a capture and does not replace Argos’s Cypress baseline-review workflow. Its free plan includes 1,000 screenshots per month with no card, and paid plans start at $5 for 3,000. Sign up for ScreenshotNeo free.

Frequently Asked Questions

Does Cypress compare screenshots by itself?

No. Cypress can capture screenshots, but visual baseline comparison requires a separate tool or service such as Argos.

Can I use Argos screenshots locally without uploading them?

Yes. The documented configuration can set uploads to run only when the CI environment variable is present, so local runs need not upload.

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.

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.

Leave a Reply

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

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
Windows Errors? Fix Them Before They SpreadFree repair scan

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.