-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support network request interception #219
Comments
Hey @redabacha! I am myself very keen on the idea that lost-pixel supports something like MSW out of the box so you can just write your handlers and render different pages with different responses! Could you elaborate a little bit more on your use case? I think in Storybook you'd already be able to use MSW to render different stories with different responses. You'd use msw plugin storybook. Still, I would want to know a bit more about the problem you are trying to solve and see how we can be of help! |
hi @d-ivashchuk, msw is great however since it runs in a service worker it doesn't have access to the nodejs environment which is very useful when needing to interact with the local filesystem for example and it also doesn't have a capability of being able to record / replay network requests unlike alternatives such as polly.js (which has a working playwright integration https://netflix.github.io/pollyjs/#/adapters/playwright). being able to record / replay network requests is very helpful on larger apps where the maintenance burden of writing mocks for many requests is quite high. |
Okay, gotcha! So you want to have more access to native playwright integrations when it comes to working with network? |
yes exactly, that would be awesome if that could be supported! 😅 |
we can definitely look into it! If you will have any idea on specific tools or maybe would want to do a PR to enable this - I'd be more than happy to assist you! |
Mode
Storybook
Feature description
would be nice if there was a config option allowing us to setup custom page routes before loading the page https://playwright.dev/docs/network#modify-requests. however, the current storybook solution uses
file://
urls when loading pages which are known to be problematic with this, see microsoft/playwright#8412.The text was updated successfully, but these errors were encountered: