0
votes

I am attempting to run my SpecFlow/xUnit tests on the command line, as described here:

http://gasparnagy.com/2016/02/running-specflow-scenarios-in-parallel-with-xunit-v2/

If I type this:

.\packages\xunit.runner.console.2.3.1\tools\net452\xunit.console.exe --help

One of the flags described is this:

-trait "name=value"    : only run tests with matching name/value traits
                       : if specified more than once, acts as an OR operation

I have a SpecFlow scenario with the trait @justthisone which I would like to run on its own. The Visual Studio test explorer lists this as having the trait Category [justthisone] I have tried this:

.\packages\xunit.runner.console.2.3.1\tools\net452\xunit.console.exe .\MyProj.Tests\bin\Debug\MyProj.Tests.dll -trait "name=justthisone"

But I get this output:

=== TEST EXECUTION SUMMARY ===
   Order.UserInterface.Tests.dll  Total: 0

How should I write the -trait flag/option to tell xUnit which tests I want to run?

1

1 Answers

0
votes

Turns out I just had to specify the correct file name:

.\packages\xunit.runner.console.2.3.1\tools\net452\xunit.console.exe .\MyProj.Tests\bin\Debug\MyProj.Tests.dll -trait "**Category**=justthisone"

As shown here:

https://github.com/techtalk/SpecFlow/issues/938