Cypress’s Advanced Test Automation Capabilities

Explore advanced Cypress features: retry mechanism, time-based output validation, CI integration, and component testing.

Let’s explore the advanced features of the Cypress framework that front-end developers and SDETs can use.

Note: Measuring code coverage is also considered a powerful capability within software test automation. However, since we covered the abilities of code coverage with Istanbul and Babel in a previous chapter, we won’t repeat it here.

Cypress test retries

When creating test automation scenarios, one of the most complex cases and the most time-consuming is test stability and flakiness. Tests can often fail due to platform availability, environmental issues (such as loss of network connectivity on the test machine), synchronization issues on the web application under tests, and so on. For such cases, Cypress offers a test retry mechanism that, in cases of failures, will attempt to rerun tests up to three times prior to marking them as failed.

To use this feature globally for all our tests, we need to add a short block of code to the cypress.json file, as shown here:

Get hands-on with 1200+ tech skills courses.