Complete Course

Cypress Testing Lab

Practice Cypress commands hands-on: interactions, network mocking, API testing, and advanced techniques.

Course Content

25 comprehensive lessons covering everything you need to know

Introduction

Introduction
Course Structure
Learn how the course is organized and make the most of the content.
Introduction
Prerequisites
Systems and knowledge required to complete the course.
Introduction
Getting to know the application under test
Learn about the Cypress Playground app that will be tested throughout the course.
Lesson
Lesson 1
Project Clone
Clone and configure the project repository to get started.

Core interactions

Lesson
Lesson 2
Structuring the test suite
Learn how test cases are organized into suites in Cypress.
Lesson
Lesson 3
Visiting web pages
Use cy.visit() to navigate to the application under test.
Lesson
Lesson 4
Getting elements
Use cy.get() and cy.contains() to select elements on the page.
Lesson
Lesson 5
Clicking on elements
Use .click() to interact with buttons and other clickable elements.
Lesson
Lesson 6
Typing in fields
Use .type() to enter text into input fields.
Lesson
Lesson 7
Checking and unchecking checkboxes
Use .check() and .uncheck() to interact with checkbox inputs.
Lesson
Lesson 8
Checking radio buttons
Use .check() to select radio button options.
Lesson
Lesson 9
Selecting options in dropdown fields
Use .select() to choose options from a dropdown field.
Lesson
Lesson 10
Selecting multiple options in select fields
Use .select() to pick multiple options in a multi-select element.
Lesson
Lesson 11
Testing file uploads
Use .selectFile() to test file upload functionality.

Network & API

Lesson
Lesson 12
Intercepting and waiting for network requests
Use cy.intercept() and cy.wait() to control network traffic in tests.
Lesson
Lesson 13
Overwriting the result of a network request
Use fixtures with cy.intercept() to mock API responses.
Lesson
Lesson 14
Simulating an API failure
Use cy.intercept() to simulate error responses from an API.
Lesson
Lesson 15
Simulating a network failure
Use cy.intercept() to force a network error and test app resilience.
Lesson
Lesson 16
Creating a simple API test
Use cy.request() to test HTTP endpoints directly.

Advanced techniques

Lesson
Lesson 17
Handling range inputs
Test slider and range input elements in Cypress.
Lesson
Lesson 18
Handling date inputs
Test date picker and date input elements in Cypress.
Lesson
Lesson 19
Protecting sensitive data
Keep credentials and secrets out of your test source files.
Lesson
Lesson 20
Not leaking sensitive data in the command log
Prevent passwords and tokens from appearing in the Cypress command log.
Lesson
Lesson 21
Counting items
Assert on the number of elements matching a selector.
Lesson
Lesson 22
Freezing the browser's clock
Use cy.clock() to control time-dependent behavior in tests.
Lesson
Lesson 23
Using app-generated data as test input
Read values from the DOM and feed them back into test interactions.
Lesson
Lesson 24
Testing file reading
Use cy.readFile() to verify downloaded file contents.

Running tests

Lesson
Lesson 25
Running tests in headless mode
Use the npm test script to run the whole suite headlessly from the terminal.

Bonus & Conclusion

Bonus
Content from Talking About Testing
Explore additional Cypress content from Talking About Testing.
Conclusion
Congratulations!
You've completed the Cypress Testing Lab course!