According to my searches, it should "just work". This is the best article I found. I've followed the steps, but nowhere in the VSTS (Azure DevOps) interface does it indicate there are any screenshots attached.
I am running this on a privately hosted build server and I have verified the following:
- Screenshots are being created and saved to disk
- The resulting TRX file (I'm using MSTEST framework) does have a ResultFile reference (a path to the image file)
- The TRX file is uploaded to VSTS and I can download it and see that the ResultFile is still in the TRX.
I'm not sure what I am missing in order to get this to work. Any help would be appreciated.
Related tasks for publishing artifacts
Use these tasks to publish artifacts. Is unfortunately well hidden in the docus.
Utility: Copy Files By copying files to
$(Build.ArtifactStagingDirectory)
, you can publish multiple files of different types from different places specified by your matching patterns.Utility: Powershell Create a PowerShell Inline Task to delete the files after copy
Remove-Item –path "Path to your screenshots" –recurse
Utility: Publish Build Artifacts With this task the will publish as test artifacts
This is a known issue and Microsoft says it is fixed but pending release in a future update: Azure DevOps build test results missing attachments from tests
The work-around in the response notes says to use the option to Rerun failed tests.