reportportal / client-javascript

This Client is to communicate with the ReportPortal on Node.js.
https://www.npmjs.com/package/@reportportal/client-javascript
Apache License 2.0
16 stars 51 forks source link

Exposing launch link or launch UUID for use in upstream clients #195

Closed barking-timber closed 6 months ago

barking-timber commented 8 months ago

Hi folks, a very initial feature request.

From the reportportal/agent-js-playwright perspective, we're currently relying on logLaunchLink option to provide a quick and direct link to the actual test run. We obtain it in a post-action, which is a script following the main test execution by grepping the STDOUT essentially. It's not tidy, as it eventually requires us to maintain another reporting realm, separate from the test framework reporting.

Do you think it would be a possible nice feature to expose the launch link outside the reportportal/client-javascript somehow? The only way of doing it I can think of would be the client-javascript setting an environment variable to be picked up. I don't think it's the cleanest option but would work, right?

This way we would benefit from Report Portal and report links in any reporting we could imagine (slack, github etc).

PS. One thing that needs checking, is how the test frameworks order the test reporters.

AmsterGet commented 7 months ago

Hi @barking-timber ! Thanks for highlighting this. It looks like https://github.com/reportportal/agent-js-webdriverio/issues/50. We just implemented such an option within https://github.com/reportportal/client-javascript/pull/197, so it will be published in the next version of the client and will apply to all agents, including agent-js-playwright.

AmsterGet commented 6 months ago

Hi @barking-timber ! Released in version 5.1.3. So you can use this feature by simply reinstalling the agent-js-playwright version. The documentation has been updated accordingly.

barking-timber commented 6 months ago

You guys are awesome thank you 👏 I will take a look cause it'd be so simple now. For the record (maybe someone will use it) I've found a workaround which I call the RP GET /api/v1/:projectName/launch with a unique attribute to find the correct launch and get the launch uuid to build launch the launch link (which then I can use in further reporters like Slack).