QA Automation Technology

Cypress.io – The future of test automation tool for both Developers and QA

Banner-image-15

Introduction:

As the quote says above, There’s a new test automation tool that is gaining popularity, real quick in the open-source community, and everyone’s talking about how Cypress may be an alternative to Selenium

Until now, end-to-end testing wasn’t that easy and user-friendly. It was the part developers hated most.

Not anymore!

Cypress makes setting up, writing, running and debugging tests easy. Cypress gives you the power to code as fast as possible.

Cypress is a next-generation front end testing tool for reliably testing anything built for the modern web which addresses the key pain points developers and QA engineers face when testing modern applications.

Cypress is written in JavaScript and packaged into ‘npm’ and runs on Node.js

What is Cypress?

Cypress.io is a custom implementation for selenium’s webdriver API, no need to install drivers for the specific browsers and their versions.

Rise of the test automation tools in the last 2 years:

Cypress Features:

  • Front-end testing tool
  • Open Source
  • Unit, Integration & end-to-end testing
  • Automatic waits, no need to add sleeps to your test
  • Script written in JavaScript
  • Framework – Mocha
  • Assertion – Chai
  • Architecturally different from Selenium
  • Browsers driver are by default included

Browsers Support:

  • Chrome
  • Chromium
  • Electron {Headless}
  • Firefox
  • Edge

System requirements:

Cypress is a desktop application that is installed on your computer. The desktop application supports these operating systems:

  • macOS 10.9 and above (64-bit only)
  • Linux Ubuntu 12.04 and above, Fedora 21 and Debian 8 (64-bit only)
  • Windows 7 and above

If using npm to install Cypress, we support:

  • Node.js 8 and above

Installation:

Three ways to install Cypress:

  1. Using npm
    1. npm install cypress –save-dev
  2. Using yarn
    1. yarn add cypress –dev
  3. Direct download
    1. https://download.cypress.io/desktop

Launch Browser:

Identify Locators and Write Tests:

Run Tests:

Why to choose Cypress:

  1. Open Source
  2. Automation tool for both Developers and QA
    1. Supports frameworks like Jest, Mocha
  3. Runs very fast
  4. Real time reloads
  5. Automatic waiting, no need to add sleeps
  6. Easy to set up, with just one line command
  7. Easy to Write test, JavaScript testing framework
  8. Easy to debug tests
    1. Travel back in time
  9. Not based on selenium
  10.  Runs directly in the browser
    1. Direct access to Application under test
  11.  No need to add any drivers for the browser and it’s version-specific.
  12.  Screenshots and Videos can be captured automatically
  13.  Easy to set up with CI tools
  14.  Flake resistant
  15.  Parallelization
  16.  Supports reporting like Mochawesome or Slack reporting
  17.  Supports all modern web browsers {angular, react, vue} testing.

I hope this blog helped you in implementing test automation using cypress with mocha framework for unit testing as well as end-to-end testing.

At Neova, we have an expert team of QA automation test engineers who are eager to work on the next big product. Feel free to reach us at sales@neovatechsolutions.com for any queries.

navdeep-rathore

QA Lead