Closed anishkny closed 3 years ago
For now I have published playwright-test-coverage
to npm which can be used in a Playwright test instead of copy-pasting from this repo.
const { test, expect } = require("playwright-test-coverage"); // instead of require("@playwright/test")
// Use test and expect as usual
test('basic test', async ({ page }) => {
// Test code
});
Ideally this option will be available in Playwright directly.
Yes we evaluated this, but for now we decided to keep it in the user-land since its only a few lines of code. This experiment shows us how it gets used and if it needs adjustments / parameters in the future.
Closing out for https://github.com/microsoft/playwright/issues/7030
@mxschmitt thanks! Was looking for exactly this for my project.
It feels like this should be part of Playwright test runner usable via an option.
Alternately, this could be made into a npm package for consumption, instead of having to copy-paste from
baseFixtures.ts
. (I plan to do this for now).