Cypress vs other tools

Cypress has been created with UI testing in mind, it's not a generic browser automation tool and it has a lot of magic that gets our testing life easier. You have to get a bit accustomed to the logic and syntax but here are summarized some advantages compared to more generic tools (like Selenium and Puppeteer):

  • AJAX interception and stubbing is super easy: waiting for an AJAX request and stubbing the back-end has never been easier. Mix it with analyzable request/response payloads and you get total control over front-end/back-end communications

  • automatic waitings and retry-ability avoid you adding fixed time sleeps that are bad for test durations (read more in the Await, do not make your E2E tests sleep article)

  • no fights with test timeouts: tests have not timeouts, every single command has

  • super neat and complete documentation, full of advice and best practices

  • automatic screenshot and videos on test failures

  • the Test Runner is astonishing

    • you do not need to slow down the browser to understand what's happening. The Test Runner reports everything and allows step-by-step navigation

    • if something is not enough clear, a click on a step reports detailed info in the DevTools console

    • you can play/pause the test

    • tracks every AJAX request

    • understanding which test is running is easy

  • some more practical advantages like avoiding single Chrome instance and auto-close management, automatic page error reports, etc.

  • last but not least: you can leverage tens of Cypress plugins

Author: Stefano Magni

results matching ""

    No results matching ""