How to get started with Cypress

Leverage Cypress for End-to-End testing in Angular

Michael Karén
Angular In Depth
Published in
12 min readMay 13, 2019

--

In this article, I show how to use Cypress to run end-to-end testing with your front-end. I write multiple tests that simulate user behavior like registering and logging in a user. I explain how Cypress handles network requests and what features Cypress has to help us debug failing tests.
And most importantly, I show that end-to-end testing can be fun.

Disclaimer: I clone an Angular project to run the tests, but the article does not contain any code specific to Angular. You can read it to learn Cypress even though you prefer something like React, Vue, Svelte or Vanilla JavaScript.

Testing methods

There is more than one testing method:

  1. Unit testing verifies that units of code work as expected.
  2. Integration testing verifies that different parts of the code work together like an API and the database.
  3. End-to-End (E2E) testing verifies all parts of the system by simulating user behavior. End-to-end describes a process that takes a method or service from its beginning to its end and delivers a complete functional solution.

What is Cypress

--

--

Michael Karén
Angular In Depth

Frontend Architect • JavaScript Enthusiast • Educative.io Author • ngVikings organizer.