3.0.0
Released Released on May 28, 2018
Summary:
There is a new
cy.task()command that enables you to go outside the browser to perform tasks directly innode. This will make it easy to setup, scaffold, seed, talk to your database, or anything else useful on a back end.cy.screenshot()has been rewritten from the ground up. It now takes a screenshot of only the application under test by default. It also can take full page screenshots or element only screenshots. This is the first step of Cypress Dashboard support for screenshot diffing.When running with
cypress runwe now run each spec file in isolation from others. We have rewritten our reporter to provide more details and provide a summary of the run at the bottom.The Dashboard has been upgraded to make it easier to understand the results of each spec run. This was done in anticipation of providing you the ability to parallelize and load balance your spec files automatically in CI.
We are now capturing the performance and timings data of every test when using
--recordmode and are beginning to offer the first analytics and insights into the health of your tests on our Dashboard Service.Cypress now caches globally per version which prevents it from being installed multiple times across projects.
Breaking Changes:
We now run each spec file in isolation from one another. This shouldn't technically break anything, but if you have set up your tests in a way that requires the state of a previous spec file, this could potentially break your tests. This will go a long ways towards reducing problems we were seeing with long runs in CI. Fixes #431, #681, #1589, #1539, and #1692.
The environment variable
CYPRESS_BINARY_VERSIONhas been removed. You should use the equivalent environment variableCYPRESS_INSTALL_BINARYinstead.The environment variable
CYPRESS_SKIP_BINARY_INSTALLhas been removed. To skip the binary install, setCYPRESS_INSTALL_BINARY=0.screenshotOnHeadlessFailurehas been removed as an option incypress.json. Instead you can now control this behavior directly with code by settingscreenshotOnRunFailuretofalsewithin the new Screenshot API. Fixes #1140 and #1754.trashAssetsBeforeHeadlessRunshas been renamed totrashAssetsBeforeRunsin our configuration. Fixes #1754.videoRecordinghas been renamed tovideoin our configuration to be clearer and prevent confusion about recording to our Dashboard. Fixes #562.Cypress no longer copies screenshots and videos to artifacts for CircleCI. Copying artifacts should be left up to the user to handle themselves in their
circle.ymlfile. Fixes #1592.The standard output has been redesigned to better visualize spec files running in isolation and to be more visually appealing. This may break any specialized logic written that expected the standard output to be structured in a specific way or contain specific words. Fixes #1588.
cy.screenshot()no longer takes a screenshot of the runner by default. Instead it will hide the runner, remove application scaling and then scroll to take a full page picture of your application.beforeandafterhooks within a support file now run before/after every spec file, instead of only once before/after the entire run. #681
Features:
There is a new
cy.task()command for executing any arbitrarynodecode.You can now run multiple specs by passing a glob to the
--specargument ofcypress run. Fixes #263, #416 and #681.There is a new Screenshot API and new
cy.screenshot()options that allow you set defaults for how screenshots are captured, whether to scale your app, disable timers and animations, or which elements to black out in the screenshot. You can also set defaults for whether to automatically take screenshots when there are test failures or whether to wait for the Command Log to synchronize before taking the screenshot. Fixes #1424.cy.screenshot()can now be chained off of commands that yield a DOM element and will only take a screenshot that element.During install of cypress, the Cypress binary is now downloaded to a global cache. This prevents multiple projects from downloading the same Cypress version. Fixes #1300.
The seeded
example_spec.jsfile has been replaced by anexamplesfolder with several spec files. This more closely reflects the recommended use of Cypress - as smaller groups of tests split among many files that will now be run in isolation. The tests were also updated from ES5 to ES6. You can see all changes in thecypress-example-kitchensinkrepo Fixes #1460.Cypress now watches all the
plugins file's entire dependency tree to make iterating on plugins easier. Fixes #1407.Videos will now be saved locally with a filename named after the associated
specfile that it represents. Fixes #980.The Test Runner now displays
skippedtests differently thanpendingtests. #244.Standard output now displays the number of
skippedtests within the summary output duringcypress run. #1559.The url to view the run in the Dashboard is now printed to output during
cypress run. #494.We now print the browser and browser version run in the output during
cypress run. #833.The build number and url to CI for tests run within Drone are now captured and displayed on the run within the Dashboard. #1709.
Bugfixes:
Cypress no longer crashes when attempting to proxy a WebSocket connection that fails. Fixes #556.
Asserting that an attribute equals a falsy value no longer fails when the value was falsy. Fixes #831 and #1491.
Snapshots now ignore stylesheets with
media="print". Fixes #1568.Fixed issue where the Cypress
windowwas being returned instead of AUT'swindow. Fixes #1436.The
closeevent now properly fires onfilewhen manually closing the browser. Fixes #1560.cypress.env.jsonis now being watched for changes. Fixes #1464.Fixed issue when using TypeScript that caused namespace errors to be thrown. Fixes #1627.
Fixed error message on .type() and .clear() when typing into non-typeable elements or clearing non-clearable elements to accurately list the elements allowed. Fixes #1650.
Added Chrome flag
--disable-blink-features=RootLayerScrollingto prevent the application under test from "shaking" in recent versions of Chrome. Fixes #1620.Fixed issue where some TTY characters were not properly formatted in the terminal for Windows during
cypress run. Fixes #1143 and #1550.Removed an extraneous error display from Electron during
cypress runabout a "transparent titlebar" setting. Fixes #1745.
Misc:
We are now aggressively turning on colors when running in CI. If you're using Jenkins and do not have an ANSI color plugin installed, you can turn off colors with the
NO_COLOR=1environment variable. Fixes #1747 and #1748.When running
cypress run --recordon forked PR's, we now detect that the Record Key is missing and do not fail the build. We will display a warning, but continue running the tests. Fixes #1193.Searching in the Test Runner now filters out any non-matching folders. Fixes #1706.
Duplicate, subsequent logs in the Command Log are now collapsed and can be expanded to view all logs. Fixes #1580.
We now throw a descriptive error if an alias using .as() was defined starting with the
@character. #1643.We now pass the
--disable-device-discovery-notificationsflag automatically. This should prevent Chromium browser from automatically trying to communicate with devices in your network, such as printers, while running tests. Fixes #1600.We now pass any reporter errors along and provide a stack if a custom reporter you've provided does not exist. Fixes #1192.
You can now pass a normal object to
cypress.open()orcypress.run()through the Module API, just as you would from the command line. #1442.Added type definitions for
Cypress.offandCypress.log. Fixes #1110 and #1591.Update type definitions for
cy.screenshot()to reflect new changes to command's options. Fixes #1753.The type definition for
.filter()now correctly supports a function argument.The type definition for
.scrollIntoView()no longer errors when passed adurationoption. Fixes #1606.NODE_OPTIONSenvironment variables now print within thecypress:clilogs when running inDEBUGmode. Although usingNODE_OPTIONSthemselves should not be used due to #1676. Fixes #1673.Cypress will error and exit with status 1 if no specs were found during
cypress run. Fixes #1585.We are now counting and aggregating the stats at the end of test runs separately from Mocha. Cypress considers a test to be the
itand any accompanyinghooksthat run before or after a test. Cypress will correctly associate failures in those hooks to the test itself. We believe this more accurately models and just "makes sense". Fixes #1163.The minimum viewport size has been lowered from
200pixels to20pixels. Fixes #1169 and #1444.Internal changes to our API structure and communication. Fixes #1170, #1413, #1415.
We output a much more complete test results object when using cypress as a module. Fixes #1248.
Added keywords to Cypress npm package. Fixes #1508.
Centered the animating icon in the Test Runner when 'running'. Fixes #1695.
We made some changes to internal references of
headedandheadlessto be more specific and instead referencerun modeandinteractive mode. Fixes #1140.The test name text is now selectable inside the Command Log. Fixes #1476.
Minor improvements to contributing docs and scripts. Fixes #1665.
We now collect Semaphore CI params and provide URL's to click into the builds from the Dashboard. Fixes #1785.
Config overrides coming from the CLI or environment variables are now validated the same way as if they've been set in
cypress.json. Fixes #1783.There is a better / more helpful experience around passing unknown options to the CLI. Fixes #837.
Display an empty message when there is no commit information on recorded runs. Fixes #1809.
Documentation Changes:
Update
cy.screenshot()doc to include new accepted usage and optionsUpdate
Installing Cypressdoc to include new options for Cypress binary cachingUpdated
Writing and Organizing Teststo include newly seededexamplesfolderUpdated
Launching Browsersto include our disabling of device discovery notificationsUpdated
Preprocessorsto reflect all wayscloseevent could be triggeredUpdated use of "running headlessly" to more accurate "during
cypress run"