pytest-html icon indicating copy to clipboard operation
pytest-html copied to clipboard

Support attaching arbitrary binary files

Open eqvinox opened this issue 4 years ago • 7 comments

(Our testcases produce wireshark pcap files...)

eqvinox avatar May 07 '21 10:05 eqvinox

Does it really makes sense to add this in a self-contained report?

BeyondEvil avatar Jan 26 '22 15:01 BeyondEvil

Does it really makes sense to add this in a self-contained report?

For any network-heavy software being tested, pcap files are equivalent (if not above) in importance to logfiles, so I don't really have any doubt in a "yes" to that. Especially since that's just one (pretty wide) use case, there's probably a bunch of others. Trying to think of some others, testing (de-)serialization feels like something where attaching random binaries would be pretty useful too.

eqvinox avatar Jan 26 '22 15:01 eqvinox

How would you consume that pcap file from the self-contained report? It's going to be base64 encoded.

But maybe I'm misunderstanding something here? @eqvinox

BeyondEvil avatar Jan 26 '22 15:01 BeyondEvil

How would you consume that pcap file from the self-contained report? It's going to be base64 encoded.

But maybe I'm misunderstanding something here? @eqvinox

@BeyondEvil when you click the link for the file, the browser will open a file download dialog and save it decoded. (The download dialog would probably list wireshark too, as an application to directly open the file with. The file is first saved to /tmp for that, same way all "open with" downloads work.)

eqvinox avatar Jan 26 '22 16:01 eqvinox

Ah, got it. Ok, I'll add this to next-gen. Thanks!

BeyondEvil avatar Jan 26 '22 16:01 BeyondEvil

Missed this is during initial work of v4. Will try to get to it now.

BeyondEvil avatar Nov 04 '23 16:11 BeyondEvil

How would you consume that pcap file from the self-contained report? It's going to be base64 encoded. But maybe I'm misunderstanding something here? @eqvinox

@BeyondEvil when you click the link for the file, the browser will open a file download dialog and save it decoded. (The download dialog would probably list wireshark too, as an application to directly open the file with. The file is first saved to /tmp for that, same way all "open with" downloads work.)

I'm not seeing the behavior described here.

When I click the link, it just opens a new tab displaying the path to the binary.

BeyondEvil avatar Nov 04 '23 18:11 BeyondEvil