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
{{ message }}
Repository navigation
Commit c411bc6
Browse filesBrowse the repository at this point in the historyBrowse files
Remove playwright subpath export, add fixture recipe to README
The subpath added no real value once reduced to a plain helper function.
The full fixture setup is simple enough to paste directly, and keeping it
in the README means users own the code and can adapt it freely.
// CSS coverage is collected and written to disk when the test finishes
94
104
})
95
105
```
96
106
97
-
The fixture starts coverage when the test begins and stops it when the test ends. JSON files are written to the output directory and attached to the Playwright HTML report.
98
-
99
-
**Enable for an entire test file** with a single line:
107
+
Or enable it for an entire file with a single line:
100
108
101
109
```ts
102
-
import { test, expect } from'./fixtures.js'
103
-
104
110
test.beforeEach(async ({ cssCoverage }) => {})
105
-
106
-
test('first test', async ({ page }) => { ... })
107
-
test('second test', async ({ page }) => { ... })
108
111
```
109
112
110
-
**Configure the output directory** (optional) via the `dir` option:
111
-
112
-
```ts
113
-
awaitsave_css_coverage(coverage, {
114
-
dir: 'css-coverage', // default
115
-
title_path: testInfo.titlePath,
116
-
})
117
-
```
118
-
119
-
Or set it globally in `playwright.config.ts` by passing the configured path to `save_css_coverage` from a shared fixture.
120
-
121
-
Pass the directory to the `css-coverage` CLI to analyze results:
113
+
Pass the output directory to the `css-coverage` CLI to analyze results:
0 commit comments