Registry / testing / playwright-console-reporter

playwright-console-reporter

JSON →
library1.0.2jsnpmunverified

playwright-console-reporter is a custom console reporter for Playwright tests, currently at version 1.0.2. It enhances the standard Playwright console output by capturing detailed test steps and results, then transforming them into structured, human-readable reports directly within the terminal. This provides developers with immediate, in-depth insights into test suite performance and execution flow, allowing for quick analysis of failures and bottlenecks without the need to navigate external HTML or JUnit report files. The package is actively maintained, with releases likely following Playwright's own update cadence or as features and bug fixes are introduced. Its key differentiator lies in its focus on comprehensive, structured console logging, contrasting with Playwright's built-in `list` or `dot` reporters which offer less detail, or `html`/`json` reporters which require opening separate files for detailed review. It aims to streamline debugging and daily development workflows by keeping all relevant test information visible in the terminal.

npm install playwright-console-reporter
INSTALL
IMPORT
SIG · PLAYWRIGHT-CONSOLE
P
playwright-console-reporter
testingjavascriptv1.0.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Reporter Configuration String
reporter: [['playwright-console-reporter', {}]]
import { PlaywrightConsoleReporter } from 'playwright-console-reporter';
The primary way to enable this reporter is by referencing its package name as a string in the Playwright configuration array. Playwright internally loads the module based on this string.
PlaywrightTestConfig
import { PlaywrightTestConfig } from '@playwright/test';
import PlaywrightTestConfig from '@playwright/test';
Essential for type-checking and correctly configuring the Playwright test runner in TypeScript projects.
ConsoleReporter (Class)
import { ConsoleReporter } from 'playwright-console-reporter';
const ConsoleReporter = require('playwright-console-reporter');
For advanced scenarios like extending the reporter's functionality or programmatic instantiation (though less common for direct users), the reporter class is typically exported as `ConsoleReporter`. Most Playwright projects are ESM-first, so `require` is generally incorrect.

Demonstrates how to integrate the playwright-console-reporter into your existing Playwright configuration file, alongside other reporters.

import { PlaywrightTestConfig } from '@playwright/test'; let reporters: PlaywrightTestConfig['reporter'] = [ ['junit', { outputFile: 'build/results.xml' }], ['html', { outputFolder: 'build/html-report', open: 'never' }], ['list'] ]; // Add the console reporter reporters.push(['playwright-console-reporter', {}]); const config: PlaywrightTestConfig = { reporter: reporters, // other Playwright configurations... }; export default config; // To ensure detailed reports are printed line by line, set this environment variable before running tests: // PLAYWRIGHT_FORCE_TTY=false
playwright-console-reporter --version
Debug
Known issues
gotchaDetailed console output from the reporter may not appear as expected if the `PLAYWRIGHT_FORCE_TTY` environment variable is not set correctly. Playwright's default TTY detection can sometimes prevent full console reports in CI/CD environments or certain local setups.
fix
Ensure `PLAYWRIGHT_FORCE_TTY=false` is set in your environment variables before executing Playwright tests to force detailed reports to print line by line.
affects: >=1.0.0
Errors
Common errors & fixes
Detailed reporter output is truncated or missing in the console.
The Playwright test runner's TTY detection is active, which can suppress detailed console output from custom reporters in non-interactive terminal environments (e.g., CI/CD, or some IDE terminals).
fix
Set the environment variable `PLAYWRIGHT_FORCE_TTY=false` before running your Playwright tests. For example: `PLAYWRIGHT_FORCE_TTY=false npx playwright test`.
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies
@playwright/testrequiredThis reporter extends Playwright's functionality; PlaywrightTestConfig types and the Playwright test runner are essential for its operation and configuration.
Agent activity
2 hits · last 30 days
node
2
Resources
playwright-console-reporter — npm install playwright-console-reporter · libregistry