Adrian-Tamas / reportportal-behave-integration-client-lib

Report Portal Integration Client for Python Behave
MIT License
4 stars 4 forks source link

Screenshots are invalid #6

Open NetanelMosheCohen opened 2 years ago

NetanelMosheCohen commented 2 years ago

I'm using the latest version 1.1.1 and running the tests on MAC.

When add_screenshot bool is set to True, an invalid screenshot is attached to the report: image

I tried to figure out why, and I saw that the attachment is sent with 'mime': 'application/octet-stream':

self.service.log_step_result(end_time=timestamp(), message=error_msg, level='ERROR', attachment={ 'name': step_name, 'data': open(screenshot_name, 'rb'), 'mime': 'application/octet-stream' }, item_id=item_id )

When I change it to 'mime': 'image/png' it works as expected: image