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

What’s New in Cypress 12? Features and Changes

Cypress 12 made cross-origin testing and session caching generally available, enabled test isolation by default, and changed several upgrade requirements. Here is what to check before migrating.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Cypress 12 made cy.origin() and cy.session() generally available, enabled end-to-end test isolation by default, and changed several migration details that can affect existing suites. The biggest upgrade risks are tests that depended on state carrying between cases, projects using unsupported Node.js versions to install Cypress, and code that relies on removed cookie APIs or customized commands.

What changed in Cypress 12?

Cypress 12’s headline additions were stable cross-origin testing and session caching. It also changed the default test lifecycle and refined how Cypress resolves DOM elements. These changes are most relevant when upgrading an existing project: a suite may now start each test with a clean browser state, even if earlier tests had left the application logged in or on a particular page.

As an Amazon Associate I earn from qualifying purchases.

  • cy.origin() is generally available: use it to interact with a second origin during a test, such as an authentication provider. Cypress describes this as a supported way to test multi-origin flows.
  • cy.session() is generally available: cache and restore cookies, localStorage, and sessionStorage so tests can reuse authentication state rather than repeat a login flow. Cypress presents this as a way to reduce suite execution time; no independent speed measurement is established here.
  • End-to-end test isolation defaults to enabled: before each test, Cypress resets the page and clears cookies and local and session storage when isolation is enabled. It remains configurable.
  • DOM element resolution was improved: Cypress re-queries elements after DOM updates with the goal of reducing detached-DOM errors. This can reduce the likelihood of those failures, but does not guarantee they will never happen.
  • Queries became a distinct command category: some commands reclassified as queries can no longer be overridden using Cypress.Commands.overwrite(). Projects with custom command overwrites should review the migration guide’s list.
  • Other behavior changed: Cypress called out altered cy.request() query-string handling, removed cookie APIs, and new installation requirements for Node.js.

Cypress’s announcement, dated December 6, 2022, describes the isolation change this way: “With Cypress 12, end-to-end tests now set test isolation to true by default, which means that we reset the cookies, storage, and the page state before each test.” Cypress 12 announcement.

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

What cy.origin() and cy.session() do

Use cy.origin() for a second origin

Cross-origin support is useful when an end-to-end journey leaves your application’s origin—for example, to visit a third-party sign-in page and then return. Cypress 12 made the feature generally available. If the callback imports or requires external dependencies, those dependencies are not enabled by default; the migration guide names e2e.experimentalOriginDependencies: true as the opt-in configuration. Check the guide before enabling it, particularly if your callback relies on packages beyond Cypress commands.

Use cy.session() to reuse browser session state

A session can preserve and restore cookies, localStorage, and sessionStorage. This can avoid repeating a login flow in tests that need the same authenticated state. Treat session caching as a deliberate test setup choice: make sure the cached state is valid for the scenario, and do not assume that ordinary state left behind by a preceding test will persist under the default isolation behavior.

How test isolation affects existing suites

With isolation enabled, Cypress resets the page and clears cookies and local and session storage before each test. That makes tests less dependent on execution order and prevents one case’s browser state from silently becoming another case’s setup. The practical migration impact is that tests must establish the state they need, rather than relying on a previous case to leave it behind.

The configuration values also changed: use true or false for testIsolation, not the earlier on or off values. Isolation is configurable, but disabling it to preserve shared state means accepting that tests may depend on prior browser activity. Prefer explicit setup or an intentional cy.session() strategy when that better expresses the test’s needs.

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

Cypress 12 installation requirements and migration checklist

The Cypress 12 migration guide says installing the Cypress npm package requires Node.js 14, 16, or 18 or later; Node.js 12, 15, and 17 were dropped. This refers to the system Node.js version used to install Cypress, not Cypress’s bundled Node.js runtime. Confirm the version in the environment that installs the package, including CI, rather than checking only a developer workstation. See the Cypress migration guide.

  1. Check the installer’s Node.js version. Confirm it meets the migration guide’s stated requirement: Node.js 14, 16, or 18 or later.
  2. Find tests that share browser state. Look for cases that rely on a prior test’s page, cookies, or storage. Make each test establish its own state, or choose an intentional isolation configuration.
  3. Update testIsolation values. Replace legacy on/off settings with true/false.
  4. Replace removed cookie APIs where appropriate. Cookies.defaults and Cookies.preserveOnce were removed. Cypress recommends cy.session() for preserving cookies between tests.
  5. Audit custom command overwrites. Check whether any command your project overrides was reclassified as a query and is no longer eligible for Cypress.Commands.overwrite().
  6. Check cy.request() query strings. The migration guide notes changed handling of qs; verify that complex values produce the URL your tests expect.
  7. Review dependencies in origin callbacks. If a cy.origin() callback imports or requires external dependencies, assess whether the documented e2e.experimentalOriginDependencies: true opt-in is needed.

Common upgrade problems and fixes

  • A test is no longer logged in after another test: the default isolation behavior clears browser state between tests. Set up authentication for the test itself or use cy.session() to cache and restore the required state.
  • A testIsolation setting is rejected or behaves unexpectedly: change legacy on/off values to boolean true/false.
  • Cypress installation fails under an older Node.js version: check the system Node.js version used by the installer or CI job against the version 12 requirement; do not confuse it with Cypress’s bundled runtime.
  • A cookie-preservation helper no longer exists: migrate uses of Cookies.defaults or Cookies.preserveOnce to an appropriate cy.session() approach.
  • A custom overwrite no longer works: check whether the target command became a query, then consult the migration guide for the commands that cannot be overridden.
  • A request URL differs from the expected URL: inspect the qs values passed to cy.request() and compare the resulting query string with the behavior described in the migration guide.
  • An origin callback cannot load a dependency: external dependencies are not enabled by default; review the documented e2e.experimentalOriginDependencies: true opt-in.
  • A detached-element error still appears: improved re-querying reduces the likelihood of these errors, but does not eliminate them. Review whether the page is replacing the element between the query and the action, and structure the test to query the current element after the update.

Release date: December 5 or December 6?

Cypress’s dedicated release page lists Cypress 12.0.0 as released December 5, 2022, while the Cypress changelog and announcement label it December 6. The sources therefore differ by one day; attribute the date to the specific page rather than treating one date as universally stated. Cypress changelog; Cypress announcement.

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 task is to capture pages for test fixtures or documentation rather than exercise Cypress interactions, ScreenshotNeo is a website screenshot API and MCP server. A single GET request can return a PNG, JPEG, WebP, or PDF. For example, this cURL command saves a WebP screenshot of Stripe; replace the URL with the page you need. See the ScreenshotNeo API documentation for parameters and response details.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo can accept cookie or consent banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and responses identify 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.

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

The Free plan includes 1,000 screenshots per month with no card required. Paid plans start at $5 for 3,000 shots; yearly billing gives two months free, and every feature is available on every plan.

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

Frequently Asked Questions

When was Cypress 12 released?

Cypress’s dedicated release page says December 5, 2022; its changelog and announcement say December 6, 2022.

Does Cypress 12 guarantee that detached-DOM errors are gone?

No. Cypress improved element re-querying to reduce their likelihood, but the change is not a guarantee that they cannot occur.

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 *

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
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver 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.