Chapter 8: Understanding Variables and Aliases in Cypress
Before we get started on how variables and aliases work in Cypress, it is important to understand what we covered in the previous chapters on how to write tests in Cypress, how to configure tests, and even how to use Cypress to write applications in the proper way by following a test-driven development approach. The background information provided in the previous chapters of this book will give you a good grounding as we dive into how variables and aliases work. By exploring what variables and aliases are, we will understand how we can create references in Cypress, which will ease our test writing process and the complexity of our tests. Understanding how to use variables and aliases will not only make you write better tests but also write tests that are easy to read and maintain.
In this chapter, we will focus on writing asynchronous commands to make use of the variables and aliases that Cypress comes bundled with. We will...