pub struct Coverage { /* private fields */ }Expand description
A code-coverage handle for a Page.
Cheaply cloneable; all clones share the same page session.
Implementations§
Source§impl Coverage
impl Coverage
Sourcepub async fn start_js_coverage(
&self,
options: Option<JSCoverageStartOptions>,
) -> Result<()>
pub async fn start_js_coverage( &self, options: Option<JSCoverageStartOptions>, ) -> Result<()>
Begin collecting precise JS coverage. Enables the Profiler domain,
then issues Profiler.startPreciseCoverage { callCount: true, detailed: <opts> }.
Profiler.enable must precede startPreciseCoverage — CDP rejects
the latter with Profiler is not enabled otherwise.
Sourcepub async fn stop_js_coverage(&self) -> Result<JSCoverageResult>
pub async fn stop_js_coverage(&self) -> Result<JSCoverageResult>
Stop collecting JS coverage and return the accumulated report. Issues
Profiler.takePreciseCoverage (the result) then
Profiler.stopPreciseCoverage (teardown).
Sourcepub async fn start_css_coverage(&self) -> Result<()>
pub async fn start_css_coverage(&self) -> Result<()>
Begin collecting CSS rule usage tracking. Enables the CSS domain and
issues CSS.startRuleUsageTracking.
Sourcepub async fn stop_css_coverage(&self) -> Result<CSSCoverageResult>
pub async fn stop_css_coverage(&self) -> Result<CSSCoverageResult>
Stop collecting CSS coverage and return rule usage. Issues
CSS.stopRuleUsageTracking (which returns the usage list), then
disables the CSS domain.