network mocking
Intercepting a test’s outgoing network requests and answering them with fixed fake responses.
In more detail
Mocking slow or unreliable third-party services, such as a payment gateway, makes tests fast and deterministic. Keep your own backend real in end-to-end tests so they still test the integration.
Related terms
- Playwright — Microsoft's open-source tool for automating Chromium, Firefox and WebKit browsers, widely used for end-to-end and visual tests.
- flaky test — A test that sometimes passes and sometimes fails on the same code, because it depends on something it does not control.
- deterministic — Always producing the same result from the same inputs, with nothing left to chance or timing.
Taught in
- End-to-End Testing with Playwright: Multi-Tier Suites — Production Full-Stack Engineering