Closed maxjoehnk closed 1 year ago
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 https://github.com/cucumber/react-components/issues/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.
Released in https://github.com/cucumber/cucumber-js/releases/tag/v9.3.0
π€ 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.