Support generation of HAR for entire test run
Hello, Love the project - fantastic idea.
Would it possible to modify the API such that a HAR file can be generated after the Chromeless run has completed?
There's a lot of beneficial data in the HAR file - e.g. how long an HTTP request/response cycle took? The format has a full timing based breakdown as well.
Normally the HAR file can be saved via the Chrome web inspector so I'm not sure if that's possible with headless Chrome.
Also not sure if this issue is related to #91 ?
Looks like there is an existing NodeJS tool called chrome-har-capturer that provides an API for doing exactly this with headless Chrome.
@adieuadieu Would you accept a PR for this feature?
A HAR file can be generated after the Chromeless run has completed.
chrome-har-capturer solves the problem but I don't think the library "at the current state" can be reused into this project.
https://github.com/cyrus-and/chrome-har-capturer/blob/master/lib/page.js#L113-#L214
Thoughts?
Hi @ppcano — yes of course we'd welcome a PR! The challenge with chrome-har-capturer would be figuring out how it best fits (if at all) into Chromeless. Behind the scenes, Chromeless uses the same chrome-remote-interface package that chrome-har-capturer uses, but it doesn't seem like the har-capturer project's API let's you pass in an already existing CDP client..
I create a branch to log response here which is not a full har format. And I am not satisfied with it. More work is required. Any detail about these features?
This might be a useful reference (in terms of the events that need to be listened for and use of chrome-har to generate the HAR from those events): https://github.com/GoogleChrome/puppeteer/issues/1916#issuecomment-368452496