【问题标题】:How to integrate NUnit Tests (written in C#) in TFS builds?如何在 TFS 构建中集成 NUnit 测试(用 C# 编写)?
【发布时间】:2017-03-25 00:48:54
【问题描述】:

我使用 C# 语言在 NUnit 框架中使用 Selenium 编写了测试。我想将这些测试作为 TFS 构建的一部分。因此,每当生成新版本时。这些测试将能够作为构建的一部分运行并生成/通过电子邮件发送报告。

【问题讨论】:

  • 您使用的是哪个 tfs 版本?旧的 xmal 构建还是新的 vnext 构建?
  • 我正在使用 TFS build 2015

标签: automation automated-tests nunit integration tfsbuild


【解决方案1】:

推荐你使用新的构建系统vNext build。 vNext 构建基于 JSON,您可以在 msbuild、powershell 和各种其他脚本语言中插入任务。

关于如何在 TFS 构建中集成 NUnit 测试,这篇博客清楚地描述了如何做到这一点:Running NUnit Tests in a TFS 2015 Build vNext

简单概括如下:

  1. 为 NUnit 测试适配器添加 Nuget 包
  2. 在构建定义中指定自定义测试适配器的路径

    • 在 Visual Studio TestWindows 文件夹中复制适配器

    • 使用 nunit 包指定自定义测试适配器的路径

其他一些教程供您参考:

xUnit or NUnit with Visual Studio Online Build

Running nUnit and Jasmine.JS unit tests in TFS/VSO vNext build

【讨论】:

  • 感谢您的回答
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-04-25
  • 1970-01-01
  • 1970-01-01
  • 2019-08-31
相关资源
最近更新 更多