Practice Network Network interception
page.route()
Network practice · page.route()

Network interception playground

This page calls four API endpoints that don't actually exist on the server. Without mocks every fetch returns 404 and you'll see the empty-state UI. The whole point of the practice is to install page.route() handlers in your test, return your own JSON, and watch the UI react.

Endpoints this page calls

Refresh below to re-trigger every fetch. Each row updates with the response status (and timing) on completion.

GET /api/products Pending
GET /api/health Pending
GET /api/slow Pending
POST /api/login Idle
data-testid=endpoint-{name} · status-{name} fetch URLs=/api/products · /api/health · /api/slow · /api/login refresh=data-testid=refresh-products · refresh-all

Product catalog (driven by /api/products)

When the response is OK, products render here. With no mock, an empty state shows.

No products loaded.
The endpoint /api/products returned an error. Mock it from your Playwright test with page.route('**/api/products', ...).

Login (POST /api/login)

Submitting this form posts JSON to /api/login. Mock it to return a 200 with a fake token, or a 401 to test the error path.

Network log

Every fetch this page makes is logged here with status and timing. Useful for asserting that your mock fired.

No requests yet.