Introduction to Cypress

A brief introduction to Cypress

Aswathy E G
2 min readMay 10, 2021
Photo by Hal Gatewood on Unsplash

Introduction

Are you a developer or QA engineer who is familiar with JavaScript? Then, without any doubts, you can choose Cypress as a tool for UI automation testing .It is a JavaScript based testing framework. It helps to perform fast, easy and reliable testing for anything that runs on a browser.

What is Cypress

Cypress is a tool which makes setting up, writing, running and debugging UI tests easily. It works on any front-end framework. Cypress contains some of the best-in-class tools and they all work together seamlessly.

Test files are located in cypress/integration by default, but can be configured to another directory. Test files may be written as:

  • .js
  • .jsx
  • .coffee
  • .cjsx

Advantages of Cypress

Cypress enables you to write following types of tests:

  • End-to-end tests
  • Integration tests
  • Unit tests

There are no servers, drivers, or any other dependencies to install or configure. You can write your first passing test in a few minutes.Tests written in Cypress are meant to be easy to read and understand. Cypress runs as fast as your browser can render content. You can watch tests run in real time as you develop your applications. Readable error messages help you to debug quickly.

To see exactly what happened at each step, you can hover over commands in the Command Log. And you can debug directly from familiar tools like Developer Tools. Yes -you can stop guessing .Cypress generates screenshots automatically on failure, or videos of your entire test suite when run from the CLI and runs much faster compared to other testing frameworks.

Disadvantages of Cypress

Cypress does not support parallel testing or mobile testing.

You cannot run other browsers besides Chrome

What’s next

In the next article, let’s dive in to the following aspects:

  • Installation
  • Execution
  • Report generation
  • How to test canvas images with cypress
  • Known issues

Resources

Cypress docs: https://docs.cypress.io

--

--