You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example demonstrates how to use vite-plugin-istanbul to collect coverage data during runtime with your end-to-end tests which will be stored on the filesystem. When applying the shown parts, you are able to view the coverage report e.g. as HTML, or convert it to the lcov format for upload to Coveralls or other similar providers. In this example, we are using GitHub Actions to run the tests and upload them to Coveralls.
Prerequisites
The web application which you are using needs to have vite-plugin-istanbul configured during the build process. This is not needed anymore in the Vite App, since we do it inside the playwright-ct.config.ts under ctViteConfig instead.
Usage
Place baseFixtures.ts into your test directory. Instead of requiring @playwright/experimental-ct-react to get the test object, use ./baseFixtures.
Modify the playwright-ct.config.ts so it includes the Istanbul plugin in the ctViteConfig.
This will collect the corresponding coverage files into the .nyc_output directory which can be used from the Istanbul CLI.