reportportal-js-client is a dedicated Node.js client library for integrating test automation results with the ReportPortal platform. It enables the creation of custom listeners and reporters to programmatically interact with a ReportPortal instance, facilitating the reporting of test launches, suites, and individual test cases. The current stable version is 2.2.1, with major version 2.x focusing exclusively on compatibility with Report Portal 5 and later, having dropped support for Report Portal 4 in version 2.0.0. This client is a fork of the official `client-javascript` and is specifically tailored for Node.js environments, providing methods to start and finish launches, test items, and logs. It emphasizes an asynchronous reporting model, allowing for efficient data transmission without blocking the main execution thread, and offers both synchronous and asynchronous modes for endpoint interaction. Its key differentiator is its robust API for deep integration within Node.js test frameworks for comprehensive test result visualization and analysis within ReportPortal.
npm install reportportal-js-clientVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to initialize the ReportPortal client, check connectivity, and start and finish a basic launch.
Ensure your Report Portal server instance is version 5 or higher. If not, either downgrade the client to a 1.x version or upgrade your Report Portal server.
Always format your endpoint as `http://your-instance.com:8080/api/v1` (or `v2`).
Set `endpoint: "http://your-instance.com:8080/api/v2"` in the client configuration to utilize asynchronous reporting features.
Obtain the user token from your ReportPortal profile settings and ensure it is correctly provided in the client configuration.
Always `await` or chain `.then()` and `.catch()` calls on methods that return a Promise (like `checkConnect`) to properly handle their completion or errors. For other methods, collect the `promise` property from the returned object if you need to await their completion.
Verify the `endpoint` URL format (e.g., `/api/v1`), confirm the `token` is correct, and ensure the ReportPortal server is running and accessible from the client's environment.
Use the correct ES Module import syntax: `import RPClient from 'reportportal-js-client';`.
Ensure all required parameters (`token`, `endpoint`, `launch`, `project`) are provided as properties in the configuration object when creating a new `RPClient` instance.
No dependency data recorded yet.