Returns coverage is started
Optionaloptions: { resetOnNavigation?: boolean }
OptionalresetOnNavigation?: booleanWhether to reset coverage on every navigation. Defaults to true.
Returns coverage is started
NOTE Anonymous scripts are ones that don't have an associated url. These are scripts that are dynamically
created on the page using eval or new Function. If
reportAnonymousScripts
is set to true, anonymous scripts will have __playwright_evaluation_script__ as their URL.
Optionaloptions: { reportAnonymousScripts?: boolean; resetOnNavigation?: boolean }
OptionalreportAnonymousScripts?: booleanWhether anonymous scripts generated by the page should be reported. Defaults to false.
OptionalresetOnNavigation?: booleanNOTE Settings this to false may still reset on navigations.
Whether to reset coverage on every navigation. Defaults to true. Note that passing false does not guarantee
that coverage persists through navigations, due to browser architecture limitations.
Returns the array of coverage reports for all stylesheets
NOTE CSS Coverage doesn't include dynamically injected style tags without sourceURLs.
Returns the array of coverage reports for all scripts
NOTE JavaScript Coverage doesn't include anonymous scripts by default. However, scripts with sourceURLs are reported.
Coverage gathers information about parts of JavaScript and CSS that were used by the page.
An example of using JavaScript coverage to produce Istanbul report for page load:
NOTE Coverage APIs are only supported on Chromium-based browsers.