Selenium screenshots in VSTS (Azure DevOps)

蓝咒 提交于 2019-12-23 10:51:14

问题


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:

  1. Screenshots are being created and saved to disk
  2. The resulting TRX file (I'm using MSTEST framework) does have a ResultFile reference (a path to the image file)
  3. 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.


回答1:


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.




回答2:


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

来源:https://stackoverflow.com/questions/52823650/selenium-screenshots-in-vsts-azure-devops

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!