{"repo":"vitalets/playwright-network-cache","free":true,"listed":false,"github":"https://github.com/vitalets/playwright-network-cache","clone":"git clone https://github.com/vitalets/playwright-network-cache.git","description":"Cache and mock network requests in Playwright","language":"TypeScript","stars":98,"topics":["cache","network","playwright","playwright-javascript","requests-mock"],"license":"MIT","category":"scrapers-browser-automation","readme_excerpt":"playwright-network-cache Speed up Playwright tests by caching network requests on the filesystem. ✨ Features - Automatically cache network requests during test execution - Save responses to the filesystem in a clear, organized structure - Modify cached responses dynamically during runtime - Reuse cached data across multiple test runs - Configure TTL to automatically refresh the cache and keep responses up-to-date - View response bodies in a pretty formatted JSON - No need for manual mocks management - No mess with the HAR format — see motivation Example of cache structure: Index Click to expand - Index - Installation - Basic usage - Examples - Invalidate cache - Modify cached response - Disable cache - Force cache update - Auto-cache request for all tests - Auto-cache static assets - Additional match by HTTP status - Additional match by request fields - Split cache by test title - Split cache by request URL params - Split cache by request body - Change base dir - Multi-step cache in complex scenarios - API - Constructor - Methods - Options - Debug - Motivation - Alternatives - Changelog - Feedback - License Installation Install from npm: Basic usage 1. Setup cacheRoute fixture Extend Playwright's test instance with cacheRoute fixture: 2. Use cacheRoute inside a test For example, to cache a GET request to https://example.com/api/cats : On the first run, the test will hit real API and store the response on the filesystem: All subsequent test runs will re-use cached response and","default_branch":null,"files":null,"tree":[],"storefront":"/r/vitalets","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/vitalets/playwright-network-cache/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}