Recall & Review
beginner
What is fixture-based response mocking in Cypress?
It is a way to simulate server responses by using predefined data files called fixtures. This helps test how the app behaves with specific data without needing a real server.
Click to reveal answer
beginner
How do you load a fixture file in a Cypress test?
Use
cy.fixture('filename').then((data) => { ... }) to load the fixture data and use it in your test.Click to reveal answer
beginner
Why use fixture-based mocking instead of real API calls?
It makes tests faster, more reliable, and independent from the server. You control the data, so tests don’t fail because of network or server issues.
Click to reveal answer
intermediate
Which Cypress command is used to intercept a network request and respond with fixture data?
Use
cy.intercept('GET', '/api/endpoint', { fixture: 'data.json' }) to mock the response with fixture data.Click to reveal answer
beginner
What is the folder name where Cypress fixture files are stored by default?
The default folder is
cypress/fixtures. Place your JSON or other data files there for easy access.Click to reveal answer
Which command loads fixture data in Cypress?
✗ Incorrect
The correct command to load fixture data is cy.fixture('file.json').
Where should fixture files be placed in a Cypress project?
✗ Incorrect
Fixture files go inside the cypress/fixtures folder by default.
What does cy.intercept() do when used with a fixture option?
✗ Incorrect
cy.intercept() can mock network requests by responding with fixture data.
Why is fixture-based mocking useful in tests?
✗ Incorrect
Fixture mocking avoids real network calls, making tests faster and reliable.
How do you access fixture data inside a .then() callback?
✗ Incorrect
Use cy.fixture('file').then((data) => { ... }) to access fixture data.
Explain how to use fixture-based response mocking in Cypress to test an API call.
Think about intercepting requests and using saved data files.
You got /4 concepts.
Describe the benefits of using fixture-based mocking in your tests.
Consider what problems mocking solves.
You got /4 concepts.