codeburst

Bursts of code to power through your day. Web Development articles, tutorials, and news.

Follow publication

Member-only story

Get Started with Cypress and Angular

Changhui Xu
codeburst
Published in
5 min readApr 20, 2020

Cypress is like Protractor for Angular applications, but Cypress is much faster to run and easier to debug. Cypress not only is good at the automated end-to-end testing that is independent from our applications, but also is capable of unit testing against methods in model classes, service classes, and so on. At this point, testing Angular components using Cypress may need a little bit of extra work (tutorial 1, tutorial 2, tutorial 3), but it’s still doable.

In this introductory article, we will go over some basics about adding Cypress to an Angular project, configuring TypeScript support, and setting up the continuous integration (CI) pipeline. In the end, I will summarize some useful resources for learning and working with Cypress.

Add Cypress to an Angular Project

It is straightforward to add Cypress to an Angular project. We only need to install an npm package cypress using the following command.

npm i -D cypress

The cypress package includes a desktop app and the Cypress binary. It may take a few minutes to run this command at the first time, because the package installation needs to download the Cypress binary. The Cypress binary is saved in a global cache directory, so installing this package in the future will be much faster for the same version.

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Published in codeburst

Bursts of code to power through your day. Web Development articles, tutorials, and news.

Written by Changhui Xu

Lead Application Developer. MBA. I write blogs about .NET, Angular, JavaScript/TypeScript, Docker, AWS, DDD, and many others.

No responses yet

Write a response