Skip to content
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 externalising large binary attachments #282

Open
osolomin90 opened this issue Oct 6, 2021 · 3 comments
Open

Support for externalising large binary attachments #282

osolomin90 opened this issue Oct 6, 2021 · 3 comments

Comments

@osolomin90
Copy link

Is your feature request related to a problem? Please describe.
Hi, my tests records enormous HAR files (~20mb for each scenario), plus we use https://playwright.dev/docs/trace-viewer and as output we have big zip files, and videos time to time. This info helps us localise issues very fast, but we can not attach video or zip files to report to download them later. Also network logs are attached as a text and it is very uncomfortable to have 10 000+ lines attachment in BDD reporting.
Describe the solution you'd like
I would like to be able to add file as a binary, like it works in Allure Report, and then later just download.
Describe alternatives you've considered
Alternative reporting 'Allure' but version for cucumber 7 is still in development.
Currently we just add as a text to report path to artefacts we stored with our cicd. But then we have to go in another place in system and find proper files by name.
Additional context
As I understand cucumber report is a single json or html file, thats why it may be a bit difficult to add there a lot of heavy binaries. But I think in case with html format we can store those files just in the same directory.

@aurelien-reeves
Copy link
Contributor

Hi @osolomin90

Thanks for your feature request.

Actually, it will depends a lot on the formatter you are actually using.

  • message: this is a machine-friendly formatter. The format is close to the cucumber internals. Here, you can attach whatever data you want: images, videos, logs, binary files: it is up to you. The cons here is that the size of the report will be big ... sometimes very big. But that is actually another issue, and not that critical as the message formatter relies on streams.
  • html: this is the html report. It relies on cucumber-react. That one actually embeds all the messages - the same ones as you would have with the message formatter - and embed a react app to present these beautifully using HTML. This is the piece which have to consider the different possibilities for attachements. At the moment, it supports videos, images, and plain or json text attachments. That is the piece that may need to be enhanced to fit your needs
  • json: this formatter is in maintenance mode, we won't enhance it anymore, but actually what my comment on the message formatter apply here too

Now regarding the fact that you may have to attach enormous files, I think that may be the topic for a new feature request. At the moment I would suggest something like:

  • sending the files to a hosting server
  • attaching its URL to the formatter

That would allow users to find those files more easily.

Does that answer - even a little bit - your questions?

@osolomin90
Copy link
Author

Hi, Is it possible to use, message json to create fancy html report?

@aurelien-reeves
Copy link
Contributor

You can use message formatter to do whatever you want indeed
Actually you could also create a custom formatter of your own. You would have exactly the same inputs than you would have with the message formatter.

Some info here: https://github.com/cucumber/cucumber-js/blob/main/docs/custom_formatters.md

@davidjgoss davidjgoss transferred this issue from cucumber/cucumber-js Jan 19, 2024
@davidjgoss davidjgoss changed the title More attachments needed. support for externalising large binary attachments Jan 19, 2024
@davidjgoss davidjgoss changed the title support for externalising large binary attachments Support for externalising large binary attachments Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants