Testing / Playwright Interview questions
How do you generate an HTML report in Playwright?
The HTML reporter is built in and just needs to be enabled in the config:
// playwright.config.ts export default defineConfig({ reporter: 'html', });
After a test run, this produces a self-contained report in the playwright-report folder, showing pass/fail status per test, execution time, and - when configured - attached screenshots, videos, and traces for failed tests. It doesn't open automatically on CI, so it's typically opened locally with:
npx playwright show-report
Multiple reporters can also be combined, such as ['html', 'json'] or adding 'github' for annotated CI output, so the same run can produce a human-readable report alongside a machine-readable one for dashboards.
More Related questions...