Duration
2 min
Access
Pro
Transcript
Available

Our tests should not be brittle and break just before the data returned from the API changed slightly. As an example - imagine testing Twitter with their ever-changing feed.

When writing e2e tests it's important to have a known state of the app at the beginning of each test so that potential failures depend specifically on the thing we're trying to test.

In this lesson we're going to learn how to use cy.server() and cy.route() to control API response in a cypress test.