Suggest an editImprove this articleRefine the answer for “What does "mocking" mean in E2E tests?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**Mocking in E2E tests** is substituting real external requests and responses (usually network ones) with pre-prepared fake data, so the test runs predictably and stably. **Key point:** a mock does not test the real backend, it captures the frontend's behavior under controlled conditions, most often substituting `fetch`/`XHR`, API responses and server errors.Shown above the full answer for quick recall.Answer (EN)ImageMocking in E2E tests is substituting real external requests and responses (usually network ones) with pre-prepared fake data, so the test runs predictably and stably. ## Why it is used - eliminate dependency on the real backend, network and delays - reproduce the same behavior on every run - test scenarios that are hard or slow to get from the real API (errors, special states, etc.) ## What this looks like, essentially - the test sends a request → a fake response is substituted instead of the real server - the UI receives the data and behaves as if it were interacting with the real system ## What is mocked most often - `fetch` / `XHR` - API responses (JSON) - server errors - delays and statuses (200, 400, 500, timeout) **The key idea:** a mock does not test the real backend, it captures the frontend's behavior under controlled conditions.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.