-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add support for externalised attachments #353
Conversation
✅ Deploy Preview for cucumber-react-components ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
What happens when resources can't be fetched? |
You get an error shown in place of only that attachment - doesn't affect the rest of the step. See this story https://deploy-preview-353--cucumber-react-components.netlify.app/?story=gherkin--attachment--externalised-error |
Mmh. That error message isn't very helpful. I think it would be good to add some detail to ensure people don't come to us and ask us why their attachments can't be loaded. For example, Jenkins is commonly used and has rather restrictive CORS settings. Unless configured correctly reports with attachments are always problematic. So two scenarios that are important to be handled nicely.
|
Okay, good feedback, let me see if I can make that better. |
🤔 What's changed?
This PR adds support for externalised attachment content.
Where an attachment message has a populated
url
field, the<Attachment/>
component will now handle that accordingly depending on the media type. The specific variants are:src
attribute of the appropriate elementfetch
the content from the url and render it as normalAlso included are a general refactor of
<Attachment/>
internals to use a more React-y component structure, the addition of an error boundary to handle any errors that happen for a given attachment, and a simpler visual treatment fortext/x.cucumber.log+plain
attachments:⚡️ What's your motivation?
cucumber/html-formatter#281 (comment)
🏷️ What kind of change is this?
The next step after this will be to modify the HTML formatter implementation(s) to support externalising some kinds of attachment. I'll probably start with JS.
📋 Checklist:
This text was originally generated from a template, then edited by hand. You can modify the template here.