Cypress Training Advent Lesson Day 4
Testing the loading element by delaying the server response
Let’s return to our Network Testing course. Today I would like you to implement the “Spec 04: The application is showing the loading element” assignment.
Tip: delay a stubbed network response. This way you easily control the time delay and know the expected text the page should display.
Bonus: the test also checks if the “loading” element goes away. Read the blog post Be Careful With Negative Assertions about negative assertions like should(‘not.contain`)
.
Previous lessons
Lessons marked with 📡 are from the Cypress Network Testing Exercises course. Lessons marked with 🔌 are from the Cypress Plugins course.
Day 1: 📡 “Spec 08: Import the JSON fixture directly into the spec”
Day 2: 📡 “Spec 14: Reloads the page until it sees the word Bananas"Cypress
Day 3: 🔌 “Lesson a3: Log the messages from the test to the terminal“
Hi Gleb, is there a reason you still need to pass #fruit in cy.contains? I thought that since it is passed in the command before in cy.get, it already asserts that #fruit is there.