-
Notifications
You must be signed in to change notification settings - Fork 253
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
Support for attachments / embeddings as per Cucumber and Behave #617
Comments
@Johnlon I'd be happy to spend some time on that, perhaps you can help by providing some more expectations. It would be very helpful to see an example report (in cucumber JSON "messages" format?) that does what you need (has attachments where they can be defined) in standard-compliant format. |
Hi take a look at cucumber JVM JSON report output..... "embeddings" [ In the JVM api see the api like .. Scenario.attach(name, mimetype, data) The newer "messages" format in Cucumber JVM has the EmbedEvent which also represents this data. Additionally the new Cucumber HTML formatter (Cucumber React) consumes these embedding messages and displays them correctly. Re the attach API .. The same kind of thing is in the main branch of Behave but because Behave looks like it's dying (ie it doesn't make prod releases anymore, 7 years) then I guess folk build their own dist of Behave containing that feature. |
The cuke json schema isnt maintained ... cucumber/cucumber-json-schema#6 but the cuke JVM tools and the Behave patches populate the JSON report with the embeddings I mentioned. In the messages format the ndjson file format has an object "attachment". |
I think this https://github.com/cucumber/messages (json schema) is the current main reporting format (and it is used in godog internally). What I'm interested in is a full example file that exhibits variable attachments in different places (also if possible the case of multiple attachments per step result), because I'm not super fluent in these semantics and where attachments should be applicable and how the relation is built. |
From the implementation perspective I think we can introduce something like |
Steps may add multiple attachments. There is a cucumber compatibility kit that would help I suspect make the Json report compatible. -- I already started looking myself. I'm looking at godog and various tickets in he backlog and wondering if a much more severe treatment of godog is needed to move it forward, a treatment that would probably allow for attachments along the way. But it might mean forking it (at least for a bit) to make my life easier. Why don't you also kick the wheels on a fix and we can compare notes when either of us have anything to show for it. |
I don't think that's right. On some other ticket I wrote up this problem. The ticket where aslak is saying we should use the "message" format. Some events in godog aren't in that module and the ones that have similar names have different properties. |
Re my previous comment. This is why I think that godog possibly needs more radical work Likely support for messages #341 would require a solution for attachments as attachments are part of the model. |
I've had a go at it myself here : #623 Something strange about the coverage - stuff I've not touched being reported and lines I know are tested aren't being counted? |
will close when released |
🤔 What's the problem you're trying to solve?
In cucumber the Scenario class provides a means to attach(bytes, mediatype, name) but we can't see the same capability in godog.
How do we add typed attachments to the output report file?
✨ What's your proposed solution?
Add the necessary API and docs
⛏ Have you considered any alternatives or workarounds?
None known
📚 Any additional context?
No response
The text was updated successfully, but these errors were encountered: