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.
Optional
options: { Optional
Optional
reportWhether anonymous scripts generated by the page should be reported. Defaults to false
.
Optional
resetWhether to reset coverage on every navigation. Defaults to true
.
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.
Generated using TypeDoc
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.