-
-
Notifications
You must be signed in to change notification settings - Fork 698
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
Attaching base64 encoded data - should cucumber decide by itself for re-encoding ? #1116
Comments
note @mpkorstanje - I'm not really assigning you, I was more expecting a point of view for |
In Java you attach bytes.
So.... don't do that and use bytes? |
You might have to introduce an extra method to attach file contents instead. I don't think this can be solved with smarts without some annoying edge cases. |
Something like |
If a user attaches a base64 encoded string, they also specify the media type, for example:
In fake-cucumber we look at the See makeAttach If it's a string, the content encoding is identity, which means we don't base64 encode it. I think the problem is that in Ruby, binary data is represented as a string. So how do we determine whether or not to base64 encode a string? There is a trick to this, and it's more a convention than a 100% failsafe approach. If Makes sense? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. |
This issue has been automatically closed because of inactivity. You can support the Cucumber core team on opencollective. |
Any workaround for this issue ? Not able to attach base 64 screenshots to cucumber reports. Example : final String Screenshot =((TakesScreenshot) driver).getScreenshotAs(OutputType.BASE64); |
You can, and should, attach a byte array. Use |
fwiw in cucumber-js we handled it like this:
|
Attaching as Byte array is working , how to attach a screenshot which is encoded into base 64 , so that screenshot files are not required while sharing the report |
Yes tried in this way , still no good luck |
Since the report is made by |
Do we think this can be marked as closed now then @mpkorstanje / @davidjgoss |
I would say it lives in cucumber-ruby, given jvm doesn't have this issue and js has solved it in its own way. The original query was about how it works in other impls which is answered, so now it's a case of what - if anything - should be changed in ruby land. |
Summary
This is a follow up from cucumber-ruby#1443.
The user attaches a screenshot which is already encoded in
base64
. When we attach a file, we encode it once again asbase64
which makes the file "unreadable" (well, we can still decode it twice, but that's not what we want).I want to add a bit more intelligence to
cucumber-ruby
so when we detect that the file is encoded inbase64
, we do not try to encode it once again.How does this work for
cucumber-jvm
andcucumber-js
?Shall I add an example in the CCK to ensure that all version of
cucumber
do the same thing ?Expected Behavior
Being smart :D
Possible Solution
Steps to Reproduce (for bugs)
The text was updated successfully, but these errors were encountered: