{"repo":"mxschmitt/playwright-test-coverage","free":true,"listed":false,"github":"https://github.com/mxschmitt/playwright-test-coverage","clone":"git clone https://github.com/mxschmitt/playwright-test-coverage.git","description":"Playwright Test (@playwright/test) demo to collect coverage information via Istanbul","language":"TypeScript","stars":143,"topics":["playwright","istanbul","playwright-test","react","vite","vitejs"],"license":"MIT","category":"scrapers-browser-automation","readme_excerpt":"Use Istanbul coverage collection with Playwright Test 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. Verified with: React 19, Vite 8, TypeScript 6, Playwright 1.60, vite-plugin-istanbul 9, nyc 18. Why not Playwright's built-in coverage? Playwright exposes page.coverage which wraps Chromium's V8 coverage. That works for a single Chromium page but has limitations for app-level e2e coverage: - It is Chromium-only — no Firefox or WebKit. - It produces V8 coverage that is awkward to merge across tests and runs. - Source maps need to be applied manually (e.g. via v8-to-istanbul ) to get per-file line/branch numbers that match your source. The Istanbul approach in this repo instruments the source at build time, so coverage is collected the same way in every browser, merges cleanly across tests, and reports against your original source files out of the box. Prerequisites - The web application which you are using needs to have vite-plugin-istanbul configured during the build process. vite-plugin-istanbul v9 requires Vite ≥7 and is ESM-only, so the Vite config in this repo lives at vite.config.mts . - It's recom","default_branch":null,"files":null,"tree":[],"storefront":"/r/mxschmitt","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mxschmitt/playwright-test-coverage/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}