pw-test-logs-reporter is a specialized Playwright test reporter designed to automatically send details of failed test cases to a configurable external API endpoint. Currently at version 1.0.1, this package offers a simple, purpose-built solution for integrating Playwright's test results into external logging or incident management systems, with a specific focus on capturing and reporting only test failures. It integrates directly into Playwright's configuration via a string reference in the `reporter` array, and requires the `FAILED_TEST_RESULTS_ENDPOINT` environment variable to be set for operation. Its release cadence is likely stable and infrequent, given its targeted functionality. It differentiates itself by its singular focus on failed tests and straightforward API reporting, providing a lean alternative to more comprehensive, all-encompassing reporting solutions.
npm install pw-test-logs-reporterVerified import paths — ran on the pinned version, not inferred.
This configuration shows how to add `pw-test-logs-reporter` to your Playwright test setup, alongside the standard 'list' reporter. It sets up a basic Playwright project and emphasizes the critical `FAILED_TEST_RESULTS_ENDPOINT` environment variable.
Ensure `FAILED_TEST_RESULTS_ENDPOINT` is set in your environment before running tests. Example: `export FAILED_TEST_RESULTS_ENDPOINT='https://your-api.com/failed-tests'` or in a `.env` file.
Run `npm install pw-test-logs-reporter` or `yarn add pw-test-logs-reporter` to install the package. Verify that it's listed in your `node_modules` and accessible to Playwright.
Set the `FAILED_TEST_RESULTS_ENDPOINT` environment variable in your shell or CI/CD pipeline. For example, `export FAILED_TEST_RESULTS_ENDPOINT='http://your.api.com/logs'` before running your Playwright tests.
If using `require()`, ensure you access the default export correctly: `const PwTestLogsReporter = require('pw-test-logs-reporter').default;`.No dependency data recorded yet.