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 pdf attachments #2277

Closed
maxjoehnk opened this issue Apr 21, 2023 · 2 comments · Fixed by #2300
Closed

Support for pdf attachments #2277

maxjoehnk opened this issue Apr 21, 2023 · 2 comments · Fixed by #2300
Assignees

Comments

@maxjoehnk
Copy link

🤔 What's the problem you're trying to solve?

The test suite we've built is capable of downloading a pdf and checking for certain texts.
When the pdf generation or a step has failed though we don't really have an idea what might be the issue.

With the usual steps we can just check the attached screenshots but as the pdf is never rendered we can't create a screenshot of it. Instead of rendering the pdf (right now we're just parsing it with pdfjs) I would like to attach the pdf to the report so I can download it and check for any issues after the run has finished.

✨ What's your proposed solution?

Allow PDFs as an attachment media type. Don't display it in the html report but offer a way to download the file (probably just a link to the base64 encoded buffer).

⛏ Have you considered any alternatives or workarounds?

I could try to render the pdf and attach each page as a single image.

📚 Any additional context?


This text was originally generated from a template, then edited by hand. You can modify the template here.

@davidjgoss
Copy link
Contributor

davidjgoss commented Apr 29, 2023

Thanks for raising @maxjoehnk.

Attaching the PDF to the test run will itself work okay:

await this.attach(buffer, 'application/pdf');

But this won't be rendered usably in our HTML report at the moment as you've hinted at. This is covered in cucumber/react-components#80, so going to continue tracking that issue (which overs all language implementations). There may be a little work needed here once that’s done.

@davidjgoss
Copy link
Contributor

Released in https://github.com/cucumber/cucumber-js/releases/tag/v9.3.0

  • You can now download PDF attachments from the HTML report as a file
  • You can also optionally specify a filename when you attach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants