-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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]: Conditionally save HAR recordings #33559
Comments
When the test is running, would you like to use the network resources or read them off the old HAR? |
@pavelfeldman The approach we use is setting an environment variable for The goal here is that when we are running in @olivierbeaulieu Has documented this approach quite a bit in this issue: #18288 (comment). We have improved the matching logic much more since that original comment, but that at least provides a little bit of info into how some of the matching works. |
Got it. |
🚀 Feature Request
This has previously been discussed in #28825
Our company uses HAR recordings extensively for network replay in end-to-end tests so we have predictable network traffic when running our tests. When updating the HAR recordings with actual network traffic, we only want to update the saved HAR file on disk if the test passes. Currently, we have hacks to revert changes to the HARs if the test failed to prevent incomplete HARs from being committed.
Adding a function that accepts the test case and test result to allow conditionally saving the HAR based on test status, or other test information would be very helpful in enabling more network recording workflows like ours.
cc @olivierbeaulieu
Example
Motivation
While a full network recording and playback solution is not currently in the scope of Playwright as has been discussed previously (#31809 (comment)), this feature would allow creating network recording/playback solutions much easier in user land.
The text was updated successfully, but these errors were encountered: