{"id":15366,"library":"playwright-console-reporter","title":"Playwright Console Reporter","description":"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.","status":"active","version":"1.0.2","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","playwright","reporter","console","testing","typescript"],"install":[{"cmd":"npm install playwright-console-reporter","lang":"bash","label":"npm"},{"cmd":"yarn add playwright-console-reporter","lang":"bash","label":"yarn"},{"cmd":"pnpm add playwright-console-reporter","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This reporter extends Playwright's functionality; PlaywrightTestConfig types and the Playwright test runner are essential for its operation and configuration.","package":"@playwright/test","optional":false}],"imports":[{"note":"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.","wrong":"import { PlaywrightConsoleReporter } from 'playwright-console-reporter';","symbol":"Reporter Configuration String","correct":"reporter: [['playwright-console-reporter', {}]]"},{"note":"Essential for type-checking and correctly configuring the Playwright test runner in TypeScript projects.","wrong":"import PlaywrightTestConfig from '@playwright/test';","symbol":"PlaywrightTestConfig","correct":"import { PlaywrightTestConfig } from '@playwright/test';"},{"note":"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.","wrong":"const ConsoleReporter = require('playwright-console-reporter');","symbol":"ConsoleReporter (Class)","correct":"import { ConsoleReporter } from 'playwright-console-reporter';"}],"quickstart":{"code":"import { PlaywrightTestConfig } from '@playwright/test';\n\nlet reporters: PlaywrightTestConfig['reporter'] = [\n  ['junit', { outputFile: 'build/results.xml' }],\n  ['html', { outputFolder: 'build/html-report', open: 'never' }],\n  ['list']\n];\n\n// Add the console reporter\nreporters.push(['playwright-console-reporter', {}]);\n\nconst config: PlaywrightTestConfig = {\n  reporter: reporters,\n  // other Playwright configurations...\n};\n\nexport default config;\n\n// To ensure detailed reports are printed line by line, set this environment variable before running tests:\n// PLAYWRIGHT_FORCE_TTY=false","lang":"typescript","description":"Demonstrates how to integrate the playwright-console-reporter into your existing Playwright configuration file, alongside other reporters."},"warnings":[{"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.","message":"Detailed 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.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-21T00:00:00.000Z","next_check":"2026-07-20T00:00:00.000Z","problems":[{"fix":"Set the environment variable `PLAYWRIGHT_FORCE_TTY=false` before running your Playwright tests. For example: `PLAYWRIGHT_FORCE_TTY=false npx playwright test`.","cause":"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).","error":"Detailed reporter output is truncated or missing in the console."}],"ecosystem":"npm"}