在TFS2017中运行NUnit / SpecFlow测试

时间:2017-05-06 00:20:54

标签: selenium tfs specflow tfs2017

我不确定问题是否与NUnit或SpecFlow有关,但每当我向构建添加“运行功能测试”任务时,在TFS2017中运行构建时出现以下错误...

2017-05-06T00:11:00.4676774Z ##[warning]DistributedTests: Test discovery started.
2017-05-06T00:11:00.4676774Z ##[warning]DistributedTests: Test Run Discovery Aborted . Test run id : 5
2017-05-06T00:11:00.4676774Z ##[warning]DistributedTests: UnExpected error occured during test execution. Try again.
2017-05-06T00:11:00.4676774Z ##[warning]DistributedTests: Error : NUnit Adapter 3.7.0.0: Test discovery complete
2017-05-06T00:11:00.4676774Z 
2017-05-06T00:11:00.4676774Z ##[warning]DistributedTests: Test run aborted. Test run id: 5
2017-05-06T00:11:00.4676774Z ##[error]System.Exception: The test run was aborted, failing the task.
2017-05-06T00:11:00.5175379Z ##[error]PowerShell script completed with 1 errors.

有谁知道问题是什么?

非常感谢,

1 个答案:

答案 0 :(得分:0)

Run Functional Tests task用于以下方案。

  

典型方案包括:

     
      
  • 需要在测试计算机上进行其他安装的测试,例如Selenium测试的不同浏览器
  •   
  • 编码的UI测试
  •   
  • 需要特定操作系统配置的测试
  •   
  • 使用多台测试机器更快地执行大量单元测试
  •   

如果您使用的是specflow,则需要确保使用MS Test实现。

无论您使用哪个单元测试提供程序 SpecFlow ,因为所有主要的单元测试框架都为它提供了必要的适配器(这与您运行测试所需的适配器相同) Visual Studio Test Explorer窗口)

因此,您需要在此方案中使用Visual Studio Test任务(也用于处理标准单元测试)。有关设置的详细信息,请参阅此博客:SpecFlow Tips--Run only specific scenarios in TFS/VSTS build

相关问题