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, andsessionStorageso 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.
Recommended Free Tools
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.
#1 Best Overall
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.
Rank #2
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.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →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.
Rank #3
- Check the installer’s Node.js version. Confirm it meets the migration guide’s stated requirement: Node.js 14, 16, or 18 or later.
- 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.
- Update
testIsolationvalues. Replace legacyon/offsettings withtrue/false. - Replace removed cookie APIs where appropriate.
Cookies.defaultsandCookies.preserveOncewere removed. Cypress recommendscy.session()for preserving cookies between tests. - 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(). - Check
cy.request()query strings. The migration guide notes changed handling ofqs; verify that complex values produce the URL your tests expect. - Review dependencies in origin callbacks. If a
cy.origin()callback imports or requires external dependencies, assess whether the documentede2e.experimentalOriginDependencies: trueopt-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
testIsolationsetting is rejected or behaves unexpectedly: change legacyon/offvalues to booleantrue/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.defaultsorCookies.preserveOnceto an appropriatecy.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
qsvalues passed tocy.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: trueopt-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.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.
Rank #4
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.
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.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesQuick 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.




