Cypress came out with their 3rd major release this year when they released Cypress version 9.0.0 on 10th November. The following are some of the breaking changes, new features, and bug fixes included in the latest version:
Breaking changes in Cypress 9.0.0
Cy.Contains – When cy.contains() matches the content of the <script> or <style> tags, it will no longer yield the <body> element.
Custom Commands – Attempting to add an existing built-in Cypress command with Cypress.Commands.add() now returns an error, suggesting that existing command behavior should be overwritten with Cypress.Commands.overwrite() instead.
Cypress.Config – If an invalid value is supplied to Cypress.config, an error will now be thrown. Invalid values were previously disregarded, which could lead to unexpected behavior
Windows 32-bit – Windows 32-bit is no longer supported in Cypress with the latest release as it is no longer extensively used.
Improvement in Typescript – Argument types are inferred from type definitions in Cypress 9.0.0, which avoids incorrect arguments from being added or rewritten accidentally.
New feature in Cypress 9.0.0
File encoding – Users can write and read files from their filesystem using commands like cy.writeFile() and cy.readFile(). Users can now utilize a null argument to write and read their files and fixtures in binary, in addition to the existing encodings.
Bug Fixes in Cypress 9.0.0
- During action commands, sticky items within a fixed container can now be appropriately navigated.
- After cy.visit(), document.referrer will now represent the right value from the application which is under testing.
Upgrades in Cypress 9.0.0
- The bundled Node.js version was upgraded from 14.17.0 to 16.5.0.
- Upgraded electron from 14.1.0 to 15.2.0.
- Upgraded Chrome browser version used during cypress run.
The new version didn’t bring many radical changes but laid the ground for upcoming features. It will be exciting to see what Cypress brings in its future releases.