-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[Feature] baseURL
aware routeFromHAR
?
#18185
Comments
baseUrl
aware routeFromHar
?baseURL
aware routeFromHar
?
baseURL
aware routeFromHar
?baseURL
aware routeFromHAR
?
@gabriel-finch-kr Unfortunately, this is not as easy as just rewriting the url. If some requests have |
@gabriel-finch-kr How do you replace the domains in the file? Do you create some scripts that manually goes over the har file and modify them? Or are there some hooks? |
I am in the same situation as @gabriel-finch-kr , both in terms of new to playwright and loving it, and using To answer @samratluintel2 question how how you may have replaced the domains in the file, I can at least give an example on how I solved it. I duplicated the Then I use
It is not elegant, but for us, it is a step in the right direction. I understand I may be going about using the recorded network all wrong and maybe there is a better way with using mocks and maybe fixtures. I am still learning and hopefully over time this will become more obvious. Thanks and good luck |
I believe my suggestion titled "smart matching algorithm" would cover this use case as well |
the advancedRouteFromHAR fixture supports
|
I have solved it by putting another entry in the same har file with different url so the same file can serve differnt environments. |
I love Playwright. Thank you all.
I'm setting up some tooling around the wonderful
routeFromHAR
and was banging my head for a little bit trying to determine why my HAR wasn't being replayed in my CI pipeline. I finally realized (as the documentation states clearly) that "HAR replay matches URL and HTTP method strictly" and my organization's dynamic baseUrl use (varies depending on environment) was the problem. E.g. locally tests run againstlocal.site.com
, in CI pipeline againstpipeline.site.com
etc.I can workaround this by finding/replacing domain in the HAR, but from my vantage it seems like a nice (toggle-able?) feature to allow baseUrl aware HAR recording and playback, essentially storing relative paths where appropriate rather than full URL.
Maybe this breaks the HAR spec or there is some internal constraint making it challenging? Anyhow...I for one would find it very useful.
The text was updated successfully, but these errors were encountered: