Summary
Your tests run on a perfect network; your users do not.
It hands an agent the controls to make the payment API return 503, stall the dashboard for three seconds, or cut the connection right after the order is submitted — and then reports whether the error boundary actually appeared, instead of leaving that to a screenshot.
What it is
Network chaos control over Playwright sessions: it intercepts requests matching a URL pattern and makes them fail, stall, drop or return corrupt data, then reports what the page did about it.
What you get
- API responses forced to an error status, with a fallback selector checked afterwards
- Artificial latency with jitter, to see whether loading states really appear
- Requests blocked outright, for third-party outages — analytics, CDNs, tracking
- Connections aborted after the request has gone out, mid-flight
- OS-level network error codes injected, not just HTTP statuses
- The first N requests failed and later ones allowed through, for retry logic
- Malformed responses returned, for partial or corrupted payloads
- A structured verdict: whether an error state appeared, with page errors and console errors listed
Requirements
Playwright, and a URL the browser can reach. Published on npm as playwright-network-chaos-mcp.
Setup effort
One command — npx -y playwright-network-chaos-mcp
