{"repo":"mswjs/playwright","free":true,"listed":false,"github":"https://github.com/mswjs/playwright","clone":"git clone https://github.com/mswjs/playwright.git","description":"Mock APIs in Playwright using Mock Service Worker.","language":"TypeScript","stars":267,"topics":["api","mock","msw","network","playwright","request","response","test","e2e"],"license":"MIT","category":"scrapers-browser-automation","readme_excerpt":"@msw/playwright Mock Service Worker binding for Playwright. Motivation While you can use MSW in Playwright following the default Browser integration, the cross-process messaging in Playwright makes it clunky to work with the worker instance in one process (your tests; Node.js) to affect another (your app; browser). This package aims to provide a better developer experience when mocking APIs in Playwright. Until we ship cross-process request interception, @msw/playwright will rely on the page.route() API to provision the request interception in your tests. That means you don't have to initialize the worker script to use this package. That also means that any page.route() limitations now affect this library. Treat this as an implementation detail that is likely to change in the future. Usage Limitations - Since context.routeWebSocket() provides no means of knowing which page triggered a WebSocket connection, relative WebSocket URLs in ws.link(url) will be resolved against the latest created page in the browser context. Comparison playwright-msw playwright-msw is a community package that, just like @msw/playwright , aims to provide a better experience when mocking APIs in your Playwright tests. While playwright-msw is a fantastic tool and a huge inspiration for this package to exist, I believe it approaches the idea at a rather complex angle. That introduces a layer of abstraction that is subjected to the \"left behind\" problem as it needs to map to any MSW changes explicitly. pl","default_branch":null,"files":null,"tree":[],"storefront":"/r/mswjs","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mswjs/playwright/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."}