What’s New

Cypress Test Runner v5.2.0

Released 9.15.2020

New Features:

Support for shadow DOM is no longer experimental (which also means that we've removed the experimentalShadowDomSupport configuration flag). Now, by using the configuration option includeShadowDOM to enable shadow DOM, you'll be able to query globally, per-suite, per-test, or programmatically.

We recently introduced experimental network stubbing via cy.route2(). Now, we've added a followRedirect option that will ensure redirects are followed before resolving the req.reply callback. Additionally, we've added the capability to specify delayMs and throttleKbps when stubbing static responses.

Now, installing Cypress pre-releases no longer requires setting thee CYPRESS_BINARY_INSTALL environment variable.

For a full list of 5.2.0 changes visit the changelog >

Bug Fixes and Improvements

As per usual, several bugs were fixed with this release. Here are the highlights.

You might have experienced a performance issue which led to CPU bottlenecking during Cypress runs. That has now been fixed.

There was an issue with test retries that caused Cypress to hang (as in to stop running tests) in run mode with certain assertions. This has been fixed.

There was an issue with cy.getCookie() where assertions would be called twice. That has now been fixed.

There were two bugs related to shadow DOM that have been fixed. One, where using cy.contains() within a shadow root wouldn't yield the correct element and one where wearying the shadow DOM in a cy.within() callback would throw the error root.getRootNode is not a function.

You may have noticed a bug when using cy.type() with the special characters {moveToStart}/{moveToEnd} wherein the cursor would move only the the start or end of the current line rather than of the entire text editable when typing in a contenteditable element. This has now been fixed.

Get the full list of bug fixes in the changelog >

New from the Cypress Team

New from the Cypress Community

  • Cypress Ambassador Marie Drake [@mcruzdrake] will be speaking at the upcoming Open Quality Conference about Web Accessibility and how Cypress helps bridge the gap between developers on testers. Learn more >

Cypress Test Runner v5.1.0

Released 9.1.2020

Features:

Cypress 5.1.0 introduces experimental full network stubbing support. When experimentalNetworkStubbing is enabled, the cy.route2 command is available.

By using cy.route2(), your tests can intercept, modify, and wait on any type of HTTP request originating from your app, including XMLHttpRequests, fetch requests, beacons and subresources (like iframes and scripts).

Outgoing HTTP requests can be modified before reaching the destination server, and the HTTP response can be intercepted as well before it reaches the browser.

Check out the cy.route2() docs for more info on how to enable this experiment.

cy.trigger() now accepts an eventConstructor option in case you want to specify the type of event that you want to trigger (e.g. MouseEvent or KeyboardEvent).

For example - cy.get('button').trigger('mouseover', { eventConstructor: 'MouseEvent' })

New from the Cypress Community

Bugfixes:

Several bugs were fixed. Here are some of them (check the Changelog for the full list).

When a user exceeds the test limits of their free Cypress Dashboard plan, they’ll now see a warning message in the stdout.

You can now specify retries as a TestOptions type.

Types for specType field on Cypress.spec have been added.

There was a typo in the Typescript definitions where it said TestCptions rather than TestOptions (whoops) and now this has been fixed.

It was possible to run a never ending test accidentally when nesting hooks within other hooks and so now that has been fixed.

Cypress now resolves and loads tsconfig.json for TypeScript projects starting from the plugins directory.

There was an issue where, if npm config’s noproxy was set, unexpected behavior could occur. That has now been fixed.

There was an issue where test would unexpectedly fail with a “can’t resolve ‘async_hooks’” error. That has now been fixed.

There was an issue where return values from blob utils were mistaken for promises and could cause errors. That has now been fixed.

Now, cy.trigger() includes the view property in the event object when that is appropriate.


Cypress Test Runner v5.0.0

Released 8.18.2020

New Features

Cypress 5.0 has native support for test retries. Test retries are off by default. However, they can be configured using the new retries configuration option which allows you to set the number of times to retry a failing test.

We’ve improved clicking with modifiers. Now, .click(), .dblclick(), and .rightclick() accept options altKey, ctrlKey, metaKey, and shiftKey to hold down key combinations while clicking.

We now allow you to disable DOM snapshots for stubs and spies. You can chain .snapshot() off of cy.stub() and cy.spy() to disable snapshots during those commands. For example: cy.stub().snapshot(false).

Breaking Changes

Ready to upgrade? Cypress 5.0 contains some breaking changes. We put together a detailed Cypress 5.0 Migration Guide for a full breakdown on how to update your code to support 5.0.

Here are some of the breaking changes to be aware of:

We’ve renamed Cypress.Cookies.defaults() whitelist to preserve to better reflect its behavior. We also renamed the blacklistHosts configuration to blockHosts and cy.server() whitelist option to ignore for the same reason.

Because Cypress 5.0 has test retries built in natively (although they are disabled by default), we have deprecated the cypress-plugin-retries plugin. You will see an error message if you have the plugin still installed after upgrading to Cypress 5.0.

We made adding the sameSite property to objects yielded by cy.setCookie(), cy.getCookie(), and cy.getCookies() the default. As a result, the experimentalGetCookiesSameSite configuration has been removed.

If you have file paths with a question mark ? in them, Cypress no longer supports those.

Libgbm-dev is now a requirement to run Cypress on Linux.

Cypress now requires TypeScript 3.4+

Installing Cypress on your system now requires node.js 10+

Bug Fixes and Improvements

If you’ve ever seen the error Cannot set property 'err' of undefined incorrectly when rerunning tests in the Test Runner, you won’t anymore because it is fixed. 

If you’ve ever seen the Cannot read property ‘isAttached’ of undefined error during cypress run on Firefox versions >= 75, you won’t anymore because it is fixed.

If you’ve ever seen the error Maximum call stack size exceeded when calling scrollIntoView on an element in the shadow dom you won’t anymore because it is fixed.

Cypress environment variables that accept arrays as their value will now properly evaluate as arrays. 

Elements that have display: inline will no longer be considered hidden if they have child elements within them that are visible.

If a test fails in an afterEach or beforeEach hook after the hook has already passed, screenshots will now be correctly taken.

Speaking of screenshots, Cypress will no longer report screenshots overwritten in a cy.screenshot() onAfterScreenshot option as a unique screenshot. 

Additionally, taking screenshots will no longer fail when the screenshot names are too long for the filesystem to accept. Go ahead, go crazy with those screenshot names. 

Now Cypress will correctly remember the “last used browser” during cypress open if a non-default-channel browser was selected.

reporterStats will now correctly show the number of passed and failed tests when a test passes but the afterEach fails. 

The Developer Tools menu will now always display in Electron when switching focus from Specs to the Test Runner.

Check the Changelog for the complete release notes.

New from the Cypress Team

New from the Cypress Community


Test Analytics: New for the Cypress Dashboard

Released 8.11.2020

Test Analytics for the Cypress Dashboard is a huge step forward in our mission to help teams easily manage and improve their test suites, so developers can build better things with confidence.

With today’s release of Test Analytics, Cypress Dashboard users will notice four major new features: top failures, slowest tests, test case history, and project analytics like run status, run duration and more. 

Dashboard users can now find the troublemakers in their test suite, manage issues with ease, and unlock a deeper, unprecedented understanding of their tests. Read more>

Not using Cypress Dashboard yet? The Cypress Dashboard adds a layer of timely, simple and powerful insights to all your test runs in a single, easy-to-use Dashboard. Test and debug faster with The Cypress Dashboard. Get started for free.


Cypress Test Runner v4.12.0

Released 8.3.2020

New Features

  • You can now control whether screenshots are automatically taken on test failure during  cypress run by setting screenshotOnRunFailure in your configuration.
  • The pluginsFile now has access to a readonly version property within the config object that returns the current Cypress version being run. This will allow plugins to better target specific Cypress versions.
  • During cypress open, you can now run a subset of all specs by entering a text search filter and clicking ‘Run n tests’.

New from the Cypress Team

  • Bug fixes and improvements

    • position: fixed elements that have a parent with pointer-events: none will now correctly evaluate as visible. 
    • Applications using custom elements will no longer trigger infinite XHR request loops. 
    • When snapshotting the DOM, Cypress no longer causes attributeChangedCallback to be triggered on custom elements.
    • Spec files containing + characters now properly run in Cypress. 
    • When using the fx shortcut in cy.route(), an error is now thrown when the fixture file cannot be found. 
    • Cypress no longer thrown Cannot read property '__error' of null error when passing a file containing null content to cy.fixture()
    • Values containing exponential operators passed to --env via the command line are now properly read. 
    • The “Open in IDE” button no longer disappears from hooks when the tests are manually rerun. 
    • When experimentalSourceRewriting is enabled, AST rewriting will no longer return an output before the body is done being written. This would happen when the response body was too large and the response would be sent while the body was still being modified. 
    • When using .type(), Cypress now properly types into an input within an iframe that auto focuses the input.

Cypress Test Runner v4.11.0

Released 7.21.2020

New Features

  • You can now add ensureScrollability option to the ScrollTo command to indicate whether you want to ensure scrollability or not.
  • cy.clock() now accepts Dates as well as a Number for now.

Bug fixes and improvements:

  • Running multiple specs within Firefox during cypress run on Windows will no longer fail trying to make a connection to the browser. Fixes #6392.
  • Cypress will no longer throw a Cannot read property 'isAttached' of undefined error during cypress run on Firefox versions >= 75. Fixes #6813.
  • Fixed an issue where Cypress tests in Chromium-family browsers could randomly fail with the error “WebSocket is already in CLOSING or CLOSED state.” Fixes #7180.
  • Taking a screenshot of an element that changes height upon scroll will no longer throw an invalid for option "size" error. Fixes #6099.
  • Setting viewportHeight or viewportWidth from within the test configuration now properly changes the viewport size for the duration of the suite or test.
  • Setting deep objects and arrays on config within the pluginsFile now sets the values correctly. Fixes #7959.
  • The progress bar for cy.wait() now reflects the correct requestTimeout and responseTimeout of the command. Fixes #7881.
  • The command’s progress bar will not longer restart when its parent test is collapsed in the Command Log. Fixes #7912.
  • Key value pairs sent to ELECTRON_EXTRA_LAUNCH_ARGS as key=value will now be properly read in. Fixes #7994.
  • Stubbed responses responding with an empty string to cy.route() now correctly display as ‘xhr stub’ in the Test Runner’s Command Log. Fixes #8018.
  • Quickly reclicking the “Run All Tests” button in the Test Runners’ Command Log will no longer throw errors about undefined properties and the tests will no longer hang. Fixes #7968.

Cypress Test Runner v4.10.0

Released 7.6.2020

New Features

  • When hovering over a test in the Test Runner, you can click Open in IDE to open the test in your code editor and edit your tests more easily.
  • Now, before, beforeEach, after, and afterEach hook definitions display separately in the Test Runner’s Command Log when defined in separate hook definitions.
  • You can now open a spec file directly from the Tests tab in the Test Runner by clicking the Open in IDE button.

New from the Cypress Team

Bug fixes and improvements

  • We (specifically the Cypress proxy layer) will no longer prematurely cancel HTTP requests taking longer than the default responseTimeout.
  • Using Cypress commands to traverse the DOM on an application with a global parent variable will no longer throw Illegal Invocation errors. 
  • When experimentalShadowDomSupport is enabled, using .type() on an input in the Shadow DOM will not result in an error. 
  • When experimentalShadowDomSupport is enabled, checking for visibility on a shadow dom host element will no longer hang if the host element was the foremost element and had an ancestor with fixed position. 
  • Debug logs from the @benmalka/foxdriver module will no longer appear if any DEBUG environment variable was set. 
  • We made a few minor UI updates to the Test Runner.
  • Update to 4.10.0 with npm install --save-dev [email protected]

New from the Cypress Community


Cypress Real World App

Released 6.10.2020

The Cypress Real World App (RWA) is now available as an open-sourced project on Github. The RWA is a sample payment application that we have often used for demonstrating real world usage of Cypress testing methods, patterns, best practices and workflows.

Now anyone can use the Cypress Real World App to learn, experiment, tinker, train and practice testing with Cypress. Learn more >


Slack Integration: New for the Cypress Dashboard

Released 6.9.2020

Our new Slack app is live! Now, when you connect your Cypress organization with your Slack instance in the Cypress Dashboard, you’ll see run results for all projects in your org posted to the Slack channel of your choice. 

Not sure what the Cypress Dashboard is? The Cypress Dashboard is available to anyone running tests with Cypress. It adds a layer of timely, simple and powerful insights to all your test runs in a single, easy-to-use Dashboard. Test and debug faster with The Cypress Dashboard. Get started for free.