question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Register custom UrlReporter for Cucumber Reports

See original GitHub issue

Is your feature request related to a problem? Please describe.

I would like to capture the URL of the published report and send a message to an external service (Slack) with the URL of the report.

Describe the solution you’d like

I want to be able to specify an alternative implementation of UrlReporter, perhaps using a system property:

-Dcucumber.publish.urlreporter=com.acme.MyUrlReporter 

Work involved:

  • Split the current UrlReporter class to a UrlReporter interface and a DefaultUrlReporter class
  • Use java.util.ServiceLoader to instantiate the class, taken from the cucumber.publish.urlreporter system property

Describe alternatives you’ve considered

Redirecting STDERR to a file, then parse it with a shell script and send the message. That’s quite a roundabout way of doing this.

Additional context

This is actually something that’s requested by a user of Cucumber Reports.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
ahmetchakmakcommented, Aug 12, 2021

I am very surprised this feature is not implemented already. Clicking on a console output shouldn’t be the only way to reach report. There is basically no way to share report link with others with your automation code.

1reaction
aslakhellesoycommented, Jun 22, 2021

I wasn’t suggesting implementing the slack logic - I only mentioned slack as an example. All I’m suggesting is to allow users to specify an implementation class of their own.

It could be used to send the result to a variety of destinations, depending on the users’ needs. Some possible use cases:

  • Send a request to a HTTP API
  • Append to a file
  • Send an email

The idea is to open up the API so users can capture the URL in their own team/environment/organisation specific way.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reporting - Cucumber Documentation
Cucumber uses reporter plugins to produce reports that contain information ... This page documents built-in formatter plugins, custom formatters and some ...
Read more >
Create custom reports in Cucumber - LinkedIn
By default cucumber provide below plugin but we can write one of our own may be to generate some custom reports. Built-in reporter...
Read more >
How to Generate Cucumber Reports in Framework - Tools QA
How to Generate Cucumber Reports in Framework. How to create Cucumber HTML Reports. Steps to generate Junit XML Report in Cucumber.
Read more >
Cucumber Reports - Customizing Report Format
Let's create our custom folder where we put our custom template files. Let's name it templates. Create template for the report to override....
Read more >
Cucumber 4 - Is there any alternate for Reporter Interface for ...
Currently I am using Cucumber Options with plugin to invoke Custom Report Class implements Reporter. How to do it in newer Cucumber 4...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found