End-to-End JavaScript Testing with Cypress.io

End-to-End JavaScript Testing with Cypress.io

2h 6mAdvanced2024-12-10

Authors

Shaun Wassell

Shaun Wassell

Full-Stack Software Developer

Course details

End-to-end testing is an incredibly powerful strategy. Essentially, it allows you to write programs that automatically interact with your web applications like a real user would. In this course, Shaun Wassell—a lifelong programmer and a Full-Stack Development Instructor—offers a comprehensive look at end-to-end testing using Cypress, which is one of the most popular and robust end-to-end testing tools available. Learn how to write and execute basic tests, and then move on to best practices for element selection, aliasing, and handling command results. Explore advanced Cypress features, such as hooks, environment variables, and test doubles, to create efficient and maintainable tests. By the end of the course, you will be prepared to perform real-world, end-to-end testing on any web application.

Learning objectives
Develop and execute end-to-end tests with Cypress
Understand and apply best practices for element selection, aliasing, and more
Use advanced Cypress features such as hooks, environment variables, and test doubles
Identify how to debug and optimize Cypress tests

Skills covered

Software TestingWeb Development ToolsFront-End Web DevelopmentWeb DevelopmentProgramming LanguagesSoftware DevelopmentOne-Off

Concepts

Introduction

  • It's time to use Cypress.io to do some end-to-end JavaScript testing
  • What you should know

Introduction to Cypress

  • What is Cypress
  • Advantages of Cypress

The Basics

  • Installing and running Cypress
  • Writing and running Cypress tests
  • Testing text inputs
  • Selecting elements
  • Element aliasing
  • Working with command results
  • Using beforeEach
  • Setting a base URL
  • Challenge 1 - Writing your own tests
  • Solution 1 - Writing your own tests

Intermediate Concepts

  • Interacting with elements
  • Triggering other actions
  • Common assertions
  • Automatic retries
  • Debugging Cypress tests
  • Setting environment variables
  • Working with test doubles
  • Challenge 2 - Writing your own tests
  • Solution 2 - Writing your own tests

Useful Commands

  • The wrap command
  • The and command
  • The filter and not commands
  • Typing special characters
  • Activating code completion
  • Challenge 3 - Writing your own tests
  • Solution 3 - Writing your own tests

Conclusion

  • Next steps with Cypress.io and JavaScript
80,000 Toman