Writing practical tests
In the previous section, we went through the basics of understanding different classifications for tests in Cypress and what the results of the classifications are. In this section, we will focus on writing tests that go beyond asserting that a Boolean value is equal to another Boolean value.
For any test to have value, it needs to have three fundamental phases:
- Setting up the desired state of the application
- Executing the action to be tested
- Asserting the state of the application after executed actions
In our practical tests, we will use our Todo application to write tests that correspond to the three fundamental phases required to write a meaningful test. To do this, we will complete the following steps:
- Visit the Todo application page.
- Search for an element.
- Interact with the element.
- Make an assertion on the application state.
These steps will guide the practical tests that we are about to write and will...