feat(html): add configurable groupBy for the HTML report#41762
Open
jonrohan wants to merge 1 commit into
Open
Conversation
The report could already regroup tests by their top-level describe, but it was gated behind the hidden localStorage 'mergeFiles' setting with no way to reach it from config, URL, or a visible control. Promote it to a supported feature: a 'groupBy' HtmlReporterOptions default threaded into the report JSON, a visible 'Group by' control in the report header, and a ?groupBy= URL param. Supports 'file' (default), 'suite', 'project', and 'tag'. Default stays 'file', so existing reports render unchanged. Fixes microsoft#41761
Author
|
@microsoft-github-policy-service agree company="GitHub" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In a monorepo we generate hundreds of tests inside one shared spec file, each wrapped in
test.describe('@scope/<package>'). In the merged HTML report every test collapses under that single file header, so you can't tell which package a failure belongs to. The grouping I want already exists — it's the hiddenmergeFileslocalStorage toggle from #38870 — but it's per-viewer, can't be shared via link, and can't be baked into a CI-published report.This promotes that capability to a supported, configurable feature.
What
groupByoption on thehtmlreporter:'file'(default),'suite','project','tag'. Threaded into the report JSON viaHTMLReportOptions(plus aPLAYWRIGHT_HTML_GROUP_BYenv override).mergeFilessetting.?groupBy=URL param > per-viewer setting > config default >'file'.createMergedFilesModelinto onegroupBy-driven grouping function.Why
CI-published reports can now open already grouped by describe/project/tag, and a grouping can be deep-linked. Default stays
'file', so existing reports and blob merge-reports render exactly as before.Closes #41761