Summary
In this chapter, we learned about aliases and variables and how to utilize them in Cypress. We covered what variables are in Cypress tests, different types of variables and their scopes, and how to utilize them. We also covered how variables in Cypress assist in the creation of closures and how we create an environment that can only be accessed by the variables in addition to the global context accessible to the tests. Lastly, we looked at how we use aliases and the different contexts in which aliases are utilized. We learned how to reference aliases in tests, how to use them with elements, routes, and requests, and even for context sharing between test hooks and the tests themselves.
From this chapter, you have gained the skills of understanding how aliases and variables work, how aliases can be used in both asynchronous and synchronous scenarios, and how and when to create and implement the scope of variables in tests.
Now that you fully understand how aliases and variables...