From the course: End-to-End JavaScript Testing with Cypress.io
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Writing your first Cypress test
From the course: End-to-End JavaScript Testing with Cypress.io
Writing your first Cypress test
- [Instructor] So now, we're back in our test file. And since this is our first test, we're going to be testing something very simple. We're going to check if a heading on our site contains the right text. And this is probably a little contrived, but the main point here is for us to see the basic syntax of a Cypress test. So, this will do nicely for now. Now, since one of the main use cases for Cypress is to test the functionality of existing applications, I've created a very simple React application for you to run locally and point your tests at. So, if you haven't already, you should download this test application from the site. So, once you've downloaded the application, in order to run it, you just need to open up a terminal. Again, I'm using VS codes built-in terminal here. And after making sure that you're in the directory of the app, type npm run start, and hit enter. And your application should launch without a…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Installing and opening Cypress3m 38s
-
(Locked)
Writing your first Cypress test5m 3s
-
(Locked)
Testing text input6m 59s
-
(Locked)
Selecting elements8m 35s
-
(Locked)
Aliasing elements4m 24s
-
(Locked)
Working with command results3m 14s
-
(Locked)
The "beforeEach" hook2m 10s
-
(Locked)
Setting a base URL1m 32s
-
-
-
-