How do you run SpecFlow scenarios from the command line using MSTest?

后端 未结 5 773
一向
一向 2020-12-01 19:06

I\'ve got Visual Studio 2010, and we have two VS solutions we work with. The first is the web application, and the second is strictly for SpecFlow tests. Having two instance

5条回答
  •  离开以前
    2020-12-01 19:37

    I tried the tags technique but it didn't work, I'm using an older version of SpecFlow. So, I went to the .feature.cs file related to a feature file and searched for TestMethodAttribute()

    [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
    

    I added the TestCategory attribute on top of this, just like the following:

    [Microsoft.VisualStudio.TestTools.UnitTesting.TestCategory("MyCat")]
    

    Build and compile and the command worked like a charm with

    /Category:MyCat 
    

    I hope someone will find the answer useful.

提交回复
热议问题