Skip to main content

Module coverage

Module coverage 

Source
Expand description

Coverage — JS and CSS code-coverage collection for a page.

Speaks CDP’s coverage domains directly on the page session:

  • JS coverage via the Profiler domain: Profiler.startPreciseCoverage (with callCount + detailed) on start, Profiler.takePreciseCoverage then Profiler.stopPreciseCoverage on stop.
  • CSS coverage via the CSS domain: CSS.enable + CSS.startRuleUsageTracking on start, and CSS.stopRuleUsageTracking (which returns rule usage) on stop.

Mirrors the shape of Playwright’s page.coverage().

Structs§

CSSCoverageEntry
A single CSS style sheet reported by CSS coverage.
CSSCoverageResult
The result of Coverage::stop_css_coverage: rule usage grouped by sheet.
CSSCoverageRule
A single CSS rule’s coverage record.
Coverage
A code-coverage handle for a Page.
JSCoverageEntry
A single script reported by JS coverage.
JSCoverageFunction
A single function within a JS coverage entry.
JSCoverageRange
A covered byte range inside a JS function.
JSCoverageResult
The result of Coverage::stop_js_coverage: one entry per script.
JSCoverageStartOptions
Options for Coverage::start_js_coverage.