Skip to content
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] coverage per frame #3920

Closed
gullerya opened this issue Sep 18, 2020 · 4 comments
Closed

[Feature] coverage per frame #3920

gullerya opened this issue Sep 18, 2020 · 4 comments

Comments

@gullerya
Copy link

Right now coverage property is found on the Page object, but not on the Frame object.
Since there are obvious use-cases, where scripts can be loaded specifically in the frames - any intention (or deliberate decision to not) to add a capability of collecting coverage on the Frame level?

@gullerya gullerya changed the title Chrome Coverage per frame? coverage per frame? Sep 18, 2020
@pavelfeldman
Copy link
Member

No deliberate decision to not support it, but no intention either. What's your code coverage use case if you don't mind sharing? We can rarely see coverage used with the end-to-end testing, so any details will help.

@gullerya
Copy link
Author

I'm working on the next version of my just-test framework, where PlayWright comes instead of Puppeteer 👍 .

The idea is to run tests in UI in dev flavor (see some control panel, test outcomes/elements in the working panel, re-run and debug via the dev-tools), and also in CI flavor - almost the same, but just run all of the tests once and report.

Report should give coverage per test. UI/dev mode also allows to re-run a single test ad-hoc just in the browser and see the results/debug. For both those use-cases it would be perfect to load and run each test-run in it's own iframe, but for that I need an ability to collect coverage on the Frame level.

Until that is possible (if any), my plan is to split the code and for the CI flavor run each test in its own Page, but obviously I'd prefer to have a unified flow logic as much as possible.

@dgozman dgozman changed the title coverage per frame? [Feature] coverage per frame Oct 1, 2020
@dgozman
Copy link
Contributor

dgozman commented Oct 1, 2020

Coverage per frame is a major effort. JavaScript VMs usually share the scripts cache between frames from the same origin, and collecting separate coverage for them might be very hard. I would not expect this feature any time soon, sorry.

@gullerya
Copy link
Author

gullerya commented Oct 1, 2020

Understandable, thanks.

@gullerya gullerya closed this as completed Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants