简体   繁体   English

在Visual Studio 2012测试资源管理器中保存结果

[英]Save Results in Visual Studio 2012 Test Explorer

I have been working on UI Automation to perform unit testing using NUnit in Visual Studio 2012. The NUnit is integrated in my VS2012 . 我一直致力于UI Automation ,在Visual Studio 2012中使用NUnit进行单元测试VS2012集成在我的VS2012
I need to store the results of the test such as pass/fail status, the error message and the other available details in the test explorer somewhere in a human readable form. 我需要以人类可读的形式在测试资源管理器中存储测试结果,例如通过/失败状态,错误消息和其他可用详细信息。
I know that VS2010 we used to get the .trx file which could be used further. 我知道VS2010我们以前得到的.trx文件可以进一步使用。 How do I get the result in VS2012? 如何在VS2012中获得结果? Is it even possible? 它甚至可能吗?

I can at least assure you that it's possible with TFS, as we did this in our company. 我至少可以向你保证TFS是可能的,就像我们在公司做的那样。 But I don't remember every detail. 但我不记得每一个细节。 The basic steps are: 基本步骤是:

  • Create a build definition to run NUnit tests (use the conrole runner for this) 创建一个构建定义来运行NUnit测试(为此使用conrole runner)
  • Transform the result XML (TestResult.xml) to VS format (.trx) using a tool. 使用工具将结果XML(TestResult.xml)转换为VS格式(.trx)。 There are several around, try to g00g1e it. 周围有几个,试试g00g1e吧。
  • Publish the transformed results to TFS (done in the build script). 将转换后的结果发布到TFS(在构建脚本中完成)。

It seems that it is not possible to somehow log all test results, when run directly in VS. 在VS中直接运行时,似乎无法以某种方式记录所有测试结果。 In this case the only chance you have, is to run the tests externally using the NUnit runners (GUI or Console) and store the TestResults.xml output file. 在这种情况下,您唯一的机会是使用NUnit运行程序(GUI或控制台)在外部运行测试并存储TestResults.xml输出文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM