-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Register custom handler to intercept URL of published report #1797
Comments
I thought I'd take a little look at this. I added a failing scenario in 2118d28. As I started to dig into the code I think that the displayed banner is actually returned by the server receiving the HTTP message stream and then written as is to STDERR, see Lines 102 to 108 in 6e958f1
@aslakhellesoy were you thinking that this resonse string should be parsed by Cucumber and the URL passed to the listener? This seems error prone. Alternatively, we could send the entire response body to the listener and leave the parsing up to the listener implementation? Should we consider changing the reports protocol to return more than just a message string? |
I did some experimenting with this today and raised a draft #1950 with my progress. As @tooky noted we don't have a definitive way to get the published URL. I did a scrappy implementation that takes the @aslakhellesoy could we make a non-breaking change to the reports API so that with a {
"url": "https://reports.cucumber.io/reports/XXXX-XXXX-XXXX-XXXX-XXXX",
"message": "<terminal-formatted message as it is now>"
} This would not break existing usages but would allow us to address this issue in newer ones. |
We could also send the report URL in a custom header. |
Is your feature request related to a problem? Please describe.
I would like to capture the URL of the published report so I can notify an external system with the report URL.
Describe the solution you'd like
I want to be able to register a function that will be called with the URL of the published report - something like this:
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 requested by a user of Cucumber Reports. See similar request here: cucumber/cucumber-jvm#2324
The text was updated successfully, but these errors were encountered: