Cypress introduction

AJ Diaz
Nov 2, 2020

Picking up from last week, I wanted to do another post on testing by exploring another testing suite, Cypress. I picked Cypress since one of the lead instructors at the Flatiron School, Kyle Coberly, recommended it and he seems like a pretty smart cat. I’m going to be following along with Cypress’ YouTube video: Cypress in a Nutshell. Cypress can run on anything and is incredibly easy to DL and run:

Install:

npm install -D cypress

Open Desktop App

npx cypress open

Once you get past the initial file structure and pick a file to test here is what we are met with:

Cypress Desktop App: GUI layout

On the right is your app and on the left side is the command log which shows each test in your spec file.

One of the awesome features is the time travel feature which allows you to select line by line. Cypress takes a DOM snapshot after each action which is incredibly helpful for debugging and to see if your tests are doing what they are supposed to be doing.

That’s all for this week. Next week I want to dive more into the Cypress API and explore how to write your own tests.

--

--