Skip to content

Reporter options ​

This page lists the settings the reporter (and the report CLI) applies when it builds the report. They are top-level keys of the config file, or inline reporter options:

ts
// playwright.config.ts
reporter: [
  ['playwright-ui-coverage/reporter', { outputFolder: 'ui-coverage-report', threshold: 80 }],
],

Prefer the config file: the CLI reads only the file, so settings you want to rebuild with belong there. All of these are applied at report time.

Options ​

OptionDefaultDescription
outputFolderui-coverage-reportReport location (relative to the config file).
views, viewFiltersautomaticURL patterns that name views, and URLs to leave out. Link destinations go through them too. See Views.
normalizeUrlautomatic rules(url) => viewName, for URLs no views pattern matches. See Views.
maxScreenshotsPerRoute3Screenshots per view, chosen to cover the most elements.
thresholdnoneFail the run if coverage % is below this: a number (overall), or { overall, views } for per-view minimums. See Thresholds.
countFailedTestsfalseLet interactions from tests that didn't pass mark elements as tested. See Retries and failed tests.
testIdAttributefrom configAttribute for getByTestId() in suggested locators. Default: the use.testIdAttribute of the first project that sets one, else data-testid. See Suggested locators.
viewBy'auto'Group views by page URL ('url') or by spec file ('file'). 'auto' picks 'file' for component tests. See Component testing.
htmlReportdetectedFolder of Playwright's HTML report (relative to the config file) that "Tested by" links to. Detected from the html reporter in the config; false turns the links off. See Insights and the HTML report.
saveDatatrueKeep the raw data and every screenshot in <outputFolder>/data/ for the report CLI.
baselinenoneFail only on new untested elements, compared with a committed baseline file. See Baseline.
githubSummaryfalseAppend a markdown summary to $GITHUB_STEP_SUMMARY when it's set. See Comparing runs.
elementFilters, elements, significantAttributes, attributeFilters (deprecated: ignoreSelectors)[]Report-time rules.
elementGroups, autoGroup[], all onElement grouping.
links{}How <a href> counts: link units by destination view. { external: 'ignore' } drops links to other sites; false: every link is an element. See Links and untested views.

Reporter options only ​

These can't be set in the config file:

OptionDescription
configFilePath to the config file, relative to the Playwright config; false: no file. UI_COVERAGE_CONFIG wins over it. See Where the config comes from.
profileThe profile to use. UI_COVERAGE_PROFILE wins over it.

recording can't be set in the reporter options: the recorder runs in the test workers and can't see them, so that's an error. Put it in the config file.

Output ​

The reporter writes to outputFolder:

PathContents
index.htmlThe HTML report.
coverage.jsonThe machine-readable results, see coverage.json.
screens/The screenshots the report shows.
data/Raw recordings and every screenshot (unless saveData: false), see Raw data format.

It also prints a summary to the console, and the run fails (exit code 1) when a threshold isn't met or the baseline check finds new gaps.

Released under the MIT License.