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
{{ message }}
Repository navigation
[Feature] routeFromHar should also apply to apiRequestContext #22869
Let us know what functionality you'd like to see in Playwright and what your use case is.
Do you think others might benefit from this as well?
Currently for routeFromHar
If we turn on the option update , it will record all the requests in side browserContext including apiRequestContext into har file.
However, when we turn off, it intercepts all the requests except apiRequestContext.
It is not symmetrical and makes trouble for teams which need fully simulation on the network in both browser side and node side.
Did some investigation:
when recording har, this PR #11502 added the apiRequestContext into trace
when replaying har, Playwright is done by the Fetch domain of chrome devtool protocol, but apiRequestContext is implemented by native http(s) module of nodejs, which obviously cannot be mainipulated by CDP events.
We have actually the same problem, which makes playwright unusuable for certain tests.
We need to make some PUT call prior to the test, which needs to be recorded and replayed. The recording works, but the request is never replayed.
//This request is getting recorded but never replayed
const putResponse= await page.request.put('http://some.url/v1/testdata', {
data: {
isManager: false
}
})
const putResponseBody= await putResponse.json();
//Here we need the ID of the recorded request in order to proceed with the test
await page.goto(`http://some.url#some-location=%2Fusermanagement%2F${putResponseBody.userId}`);
Reacted by gaw, Noah McIvor, Gwendolyn Faraday, Kevin Tan, Marc-Hansen, Julie Matic and Jan Beck
Thank you for your involvement. This issue was closed due to limited engagement (upvotes/activity), lack of recent activity, and insufficient actionability. To maintain a manageable database, we prioritize issues based on these factors.
If you disagree with this closure, please open a new issue and reference this one. More support or clarity on its necessity may prompt a review. Your understanding and cooperation are appreciated.
Activity
thomasrepnik commentedon Jul 25, 2023
We have actually the same problem, which makes playwright unusuable for certain tests.
We need to make some PUT call prior to the test, which needs to be recorded and replayed. The recording works, but the request is never replayed.
pavelfeldman commentedon Apr 22, 2024
Why was this issue closed?
Thank you for your involvement. This issue was closed due to limited engagement (upvotes/activity), lack of recent activity, and insufficient actionability. To maintain a manageable database, we prioritize issues based on these factors.
If you disagree with this closure, please open a new issue and reference this one. More support or clarity on its necessity may prompt a review. Your understanding and cooperation are appreciated.
fix(routeFromHar): address review feedback on interceptAPIRequests
feat(routeFromHar): add interceptAPIRequests option (#41294)