如果从TeamCity的命令行运行测试,则形成错误的Allure报告

时间:2015-03-30 14:58:38

标签: nunit teamcity nunit-console allure

我遇到了以下问题: 我使用TeamCity的命令行通过NUnit控制台运行测试。在输出中,我得到错误的倾城报告:错误的状态,没有错误的屏幕截图。如果通过cmd手动运行,则会正确生成报告。有没有解决这个问题的方法?

Allurelog:

2015-03-30 15:03:53,535 [EventPumpThread] ERROR NUnitAllureAdapter.AllureEventListener - Exception in TestFinished "NUnit.Core.TestResult"
System.ComponentModel.Win32Exception (0x80004005): The handle is invalid
   at System.Drawing.Graphics.CopyFromScreen(Int32 sourceX, Int32 sourceY, Int32 destinationX, Int32 destinationY, Size blockRegionSize, CopyPixelOperation copyPixelOperation)
   at System.Drawing.Graphics.CopyFromScreen(Int32 sourceX, Int32 sourceY, Int32 destinationX, Int32 destinationY, Size blockRegionSize)
   at AllureCSharpCommons.Utils.AllureResultsUtils.TakeScreenShot()
   at NUnitAllureAdapter.AllureEventListener.TakeScreenshot()
   at NUnitAllureAdapter.AllureEventListener.TestFinished(TestResult result)

enter image description here

1 个答案:

答案 0 :(得分:0)

修改诱惑nunit配置文件。您必须在false上更改take-screenshots-after-failed-tests参数。