rajatthareja / ReportBuilder

Ruby gem to merge Cucumber JSON reports and build mobile-friendly HTML Test Report, JSON report and retry file.
https://reportbuilder.rajatthareja.com
MIT License
81 stars 47 forks source link

Embedded reports broken with image/png ("\\x89" from ASCII-8BIT to UTF-8 ) #98

Closed thiagotrentin closed 3 years ago

thiagotrentin commented 3 years ago

I'm getting encoding error while build a single report json file from a parallel execution with image/png embedded images.

/usr/local/bundle/gems/json-2.5.1/lib/json/common.rb:406:in `generate': "\\x89" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)
from /usr/local/bundle/gems/json-2.5.1/lib/json/common.rb:406:in `pretty_generate'
from /usr/local/bundle/gems/report_builder-1.9/lib/report_builder/builder.rb:27:in `block in build_report'
from /usr/local/bundle/gems/report_builder-1.9/lib/report_builder/builder.rb:26:in `open'
from /usr/local/bundle/gems/report_builder-1.9/lib/report_builder/builder.rb:26:in `build_report'
from /usr/local/bundle/gems/report_builder-1.9/lib/report_builder.rb:76:in `build_report'

My code:

page.save_screenshot(screenshot)
attach(screenshot, 'image/png')

Already tried to change to base64 images, but after that CucumberReports not supported the mime type of the file.

thiagotrentin commented 3 years ago

Resolved in https://github.com/rajatthareja/ReportBuilder/issues/79