Search code examples
azure-devopsspecflowtfs-2015azure-pipelines

SpecFlow + VSTS/TFS 2015


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>

Solution

  • 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