agent-ruby icon indicating copy to clipboard operation
agent-ruby copied to clipboard

Screenshots not appearing in ReportPortal

Open mjnohai opened this issue 5 years ago • 2 comments

For some reason, screenshots aren't getting saved correctly in ReportPortal, even those the screenshots are saved locally using the Capybara.current_session.save_screenshot method and I can pull them up using Finder.

Screen Shot 2020-07-09 at 3 01 48 PM

  • after clicking the thumbnail

Screen Shot 2020-07-09 at 3 01 57 PM

  • I even tried clicking the link for attachment and just a black screen comes up.

  • the code to generate screenshot in framework

Screen Shot 2020-07-09 at 3 03 42 PM

Note: the text file gets saved correctly without any issue.

mjnohai avatar Jul 09 '20 19:07 mjnohai

Here is code that is called from embed and that sends a file to Report Portal - https://github.com/reportportal/agent-ruby/blob/master/lib/reportportal.rb#L82 Embedding screenshots worked fine for me (though we use embed(base64_string, 'image/png;base64'). You can try to put breakpoints in the local copy of the gem to understand what's going on.

abotalov avatar Jul 10 '20 17:07 abotalov

Here is code that is called from embed and that sends a file to Report Portal - https://github.com/reportportal/agent-ruby/blob/master/lib/reportportal.rb#L82 Embedding screenshots worked fine for me (though we use embed(base64_string, 'image/png;base64'). You can try to put breakpoints in the local copy of the gem to understand what's going on.

Thank you for the quick response!!! I did try and debug it, everything appears to be fine, however, I'm just not familiar with the octet-stream that is in the payload that gets sent or multipart for that matter. Here is some more screenshots. Any additional help is welcomed :)

On the left is the file saved locally after Capybara saved it. Also, here is the object in the HTTP::FormData::File Screen Shot 2020-07-10 at 3 01 57 PM

Next, here is the send_file method with what appears to be all the correct values: Screen Shot 2020-07-10 at 3 03 04 PM

Also, the file that appears in the mini-io data folder is corrupt when I try and open it. Running everything locally in docker, not sure if that matters.

mjnohai avatar Jul 10 '20 19:07 mjnohai