Uploading attachments from nunit report file via CLI automation

Hi, I am trying to upload attachments included in nuint .xml report files to Testiny via CLI automation, but an struggling to get the CLI to detect them.

I’ve tried various different ways to record the attachment path and file in the nunit file, moved the location of the attachments, and also tried the --attachment-path option, but they always result in something like:

 Processing nunit file: ./reports/results_nunit.xml

  Submitted 2/2 results and 0 attachments

Here is a snippet example of a couple of attachments inside a nuint report file:

….

<attachments><attachment><filePath>.\test_output_folder\tests-login-test-py-test-login-chromium\test-finished-1.png</filePath><description>Screenshots and Videos</description></attachment><attachment><filePath>.\test_output_folder\tests-login-test-py-test-login-chromium\video.webm</filePath><description>Screenshots and Videos</description>

….

I can provide more details if needed.

edit: Folder structure

/reports/
 - nunit-report.xml
 - bunch of other report files
/reports/test-output-folder/tests-login-test-py-test-login-chromium/
	 - attachment1
	 - attachment2
	 - etc
/reports/test-output-folder/other-test2/
	 - attachment1
	 - attachment2
	 - etc
Etc

Thanks

Hi David,

Could you send us a small example (without the attachments, we only need to know the folder structure relative to the report file), to [email protected]

Thanks,
Michael

Thanks for the test file - the NUnit importer currently has the limitation that it only imports attachments for failed tests, thats why your attachments won’t show up.

You could try and set result="Failed" in your test file to see if the paths are resolved correctly, it shoud show “Submitting attachment: ..”

I think it also makes sense to remove this NUnit-specifc limitation and always import attachments.

Regarding NUnit, we have found the issue:
Some frameworks/tools seem to be generating <filePath> elements (which is the spec-correct one) and others <filepath> elements (which is incorrect but NUnit elements are almost all lowercase so..), so we will just support both variants, this should fix your issue.

Regarding JUnit, we currently only support Jenkins-style attachments:

Which tool are you using to create the JUnit file? pytest?

Regards,
Michael