SpecFlow + VSTS/TFS 2015

[亡魂溺海] 提交于 2019-12-08 03:26:24

问题


Using the new build system in TFS2015/VSTS, my SpecFlow tests aren't getting picked up. Within the same project, classes and methods decorated with [TestClass] and [TestMethod], respectively, are picked up and tested by TFS. What are the basic requirements for TFS2015/VSTS to run a SpecFlow 2.0 test?

EDIT: Adding packages.config contents. As you can see, I have SpecRun installed, and from within Visual Studio, I'm able to run SpecFlow tests as I'd expect (i.e. they all appear in Test Explorer)

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="NUnit" version="3.0.1" targetFramework="net452" />
  <package id="SpecFlow" version="2.0.0" targetFramework="net452" />
  <package id="SpecRun.Runner" version="1.3.0" targetFramework="net452" />
  <package id="SpecRun.SpecFlow" version="1.3.0" targetFramework="net452" />
</packages>

回答1:


Edit you VS Test Task and set the Path to Custom Test Adapters` to where in Source Control your "packages" folder lives.

For example:

$(Build.SourcesDirectory)\packages




回答2:


Already looked at this answer? Built tests are not added to the Visual Studio Test Explorer window

  1. Close all Visual Studio instances
  2. Go to %TEMP%\VisualStudioTestExplorerExtensions\
  3. Delete all the folders in here
  4. Try again

This helped me out this morning (VS2017, SpecFlow Version:2.1.0.0, SpecFlow+ Excel Version:1.4.2.0).



来源:https://stackoverflow.com/questions/35184417/specflow-vsts-tfs-2015

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