You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, when I used the routeFromHAR method to record a specific URL in the project today, I found that after the recording was completed, when replaying from the HAR file, the real URL requested by the browser could never find a corresponding record in the HAR file.
Example
This is my URL:/user/foo/bar?t=173845678126. Among them, 173845678126 is a random number. It is generated randomly every time the page is entered and used as a query parameter for this interface. This will cause the request URL initiated from the browser to not find a corresponding record in the HAR file, because the values of their 't' parameters are different. My temporary solution is to use the patch-package library to patch the relevant code in playwright-core.
Here is my patch:
It mainly removes the ===strict check for whether the URLs are exactly the same, and instead checks whether the part before the '?' is the same.
Motivation
I hope the routeFromHAR method can support passing a parameter, for example, named strictCheck with a default value of true. However, users should be allowed to configure it as false to ignore the query parameters after the '?' and only compare whether the part of the URL before the '?' is the same. If they are the same, the response will be directly read from the HAR file.
Furthermore, perhaps it would be possible to support setting this parameter for a specific specified URL.
The text was updated successfully, but these errors were encountered:
🚀 Feature Request
Hello, when I used the routeFromHAR method to record a specific URL in the project today, I found that after the recording was completed, when replaying from the HAR file, the real URL requested by the browser could never find a corresponding record in the HAR file.
Example
This is my URL:
/user/foo/bar?t=173845678126
. Among them,173845678126
is a random number. It is generated randomly every time the page is entered and used as a query parameter for this interface. This will cause the request URL initiated from the browser to not find a corresponding record in the HAR file, because the values of their 't' parameters are different.My temporary solution is to use the patch-package library to patch the relevant code in playwright-core.
Here is my patch:
It mainly removes the
===
strict check for whether the URLs are exactly the same, and instead checks whether the part before the '?' is the same.Motivation
I hope the
routeFromHAR
method can support passing a parameter, for example, named strictCheck with a default value of true. However, users should be allowed to configure it as false to ignore the query parameters after the '?' and only compare whether the part of the URL before the '?' is the same. If they are the same, the response will be directly read from the HAR file.Furthermore, perhaps it would be possible to support setting this parameter for a specific specified URL.
The text was updated successfully, but these errors were encountered: