Skip to content
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.

HTML/DOM Collection #44

Open
benjamingr opened this issue Oct 4, 2020 · 3 comments
Open

HTML/DOM Collection #44

benjamingr opened this issue Oct 4, 2020 · 3 comments

Comments

@benjamingr
Copy link
Contributor

benjamingr commented Oct 4, 2020

Talking to @gioragutt regarding HTML collection and writing things down:

  • add a per-step hook (like screenshots/console-logs) that calls Page.captureSnapshot as mhtml and save it (don't use fast-mhtml yet). Make sure to add it to the config file and make sure it's off by default.
  • Open a PR.
  • On top of it - add fast-mhtml and add a step (in the viewer) that parses the mhtml using it to display the output of Page.captureSnapshot.

Takeaways:

  • Probably better to use Page.captureSnapshot and not DOMSnapshot given the standard format and the lack of info on parsing the output of DOMSnapshot.
  • Probably better to save the MHTML as a separate file like screenshots rather than inline it in the results file.
@gioragutt
Copy link
Contributor

Impl related question - CDPSession, can I acquire it early (as early as attach) and keep reference to it in the hook? Or should I get it every time I invoke the hook (probably not)?

In the util.ts code you showed me, I didn't see you closing the session, and I don't get the feeling from CDPSession['attach'] that you have to call to free up resources or whatever.

@benjamingr
Copy link
Contributor Author

benjamingr commented Oct 4, 2020

You can probably access the existing CDP session from the page - though caching (a WeakMap of Page is fine)

@Bnaya
Copy link
Contributor

Bnaya commented Oct 13, 2020

This is merged, but we leave that issue open until we have docs in place

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants