network-mock-server

Intercept and mock API responses during automated tests with Playwright.

1|Updated Jan 9, 2026
One-click install
npx skills add https://github.com/anouar1991/binaryPetsClaude --skill network-mock-server
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: network-mock-server
Source: https://github.com/anouar1991/binaryPetsClaude/tree/main/plugins/playwright-toolkit/skills/network-mock-server
Command: npx skills add https://github.com/anouar1991/binaryPetsClaude --skill network-mock-server

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Intercept and mock API responses during automated tests to create deterministic, offline-capable test runs.

Core Features & Use Cases

  • Record baseline API responses from a real run to establish a stable reference.
  • Replay those responses deterministically across navigations.
  • Modify response fields, add latency, and simulate errors per endpoint.
  • Persist mocks across page navigations using Playwright's page.route and optional CDP Fetch domain.

Quick Start

Record baseline API responses for your target page, then configure deterministic mocks to replay, modify, and simulate latency or errors across navigations.

Frequently Asked Questions about network-mock-server

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I mock API responses in Playwright to create deterministic tests?

To mock API responses in Playwright, intercept network requests using page.route and the CDP Fetch domain, capture a baseline of real responses, and replay them deterministically to ensure stable, offline-capable test runs.

Can I add network latency and simulate errors per endpoint during frontend testing?

Yes, you can simulate network latency and errors per endpoint by intercepting API requests with Playwright, modifying the mocked response fields, and injecting custom delays or error status codes across page navigations.

Do I need a Chromium-based browser and Playwright MCP server to intercept network requests?

Yes, intercepting network requests for deterministic mocking requires a connected Playwright MCP server and a Chromium-based browser for CDP access to intercept API requests made by target pages.

How do API mocks persist across page navigations in Playwright?

API mocks persist across page navigations by leveraging Playwright's page.route and the optional CDP Fetch domain to continuously intercept and replay captured baseline responses during automated test runs.

What is the best way to record baseline API responses for automated testing?

The best way to record baseline API responses is to capture real API traffic during an initial run to establish a stable reference, then replay and modify those responses deterministically in subsequent automated tests.