1
votes

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>
2
I assume you have referenced the SpecRun.Runner assembly in your project?chief7
Have you set the path to the custom teat runners: stackoverflow.com/questions/31511081/…DaveShaw
Can you also provide your SRProfile?Andreas Willich
@DaveShaw, in my case, the answer was to set the custom test runners path. If you want to add that as an answer, I can mark it as suchPeder Rice

2 Answers

3
votes

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

enter image description here

0
votes

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).