1

Using VS2015 the Test Explorer allows you to run a single scenario outline.

Test Explorer

Now I need to do the same using NUnit3 console tool (I'm using NUnit as Unit Test Provider).

Currently I'm using the following command in order to run a test using console tool.

"C:\NUnit-3.0.1\bin\nunit3-console.exe" Path.Scripts.dll --test:Fully.Qualified.Name.TestAAAFeature.TestAAA --x86
figuedmundo
  • 375
  • 1
  • 4
  • 15

2 Answers2

0

First and foresmost, I think you should rename your test cases to be more informative as a best practice.

Coming to your question, you should use filters which can be specified by using a where clause. For running a specific test case, you can use either method or name to filter down to one or more target test case(s).

Just append the following to your command and you should be good to go.

--where "name == 'TestCase11257'"

OR

--where "method == 'TestCase11257'"

or you can even combine multiple filters like

--where "name == 'TestCase11257' || method == 'TestCase11257'"

You can read more about filters here

KatariaA
  • 752
  • 1
  • 7
  • 22
  • The name of the tests is a team convention due we have around 10000 test cases in the backlog, so its easy to looks for the test using its TFS id. And, well I tried to use nunit filters in order to run a single test of a scenario outline example, there is a way splitting the rows and adding a different category to each one of the rows. but I was looking for a way more like the one in the following [post](https://stackoverflow.com/questions/35651067/how-to-run-a-single-row-of-a-cucumber-scenario-outline-example-table-in-rubymine.) – figuedmundo Nov 15 '17 at 14:02
0

I could run a single row of a specflow scenario outline example using the --testlist: option.

# list.txt
TestC112169Feature.TestCase112169("1","atomic",null)

# cmd
"C:\NUnit-3.0.1\bin\nunit3-console.exe" Path.Scripts.dll --testlist:"c:\list.txt" --x86

And that do the trick.

figuedmundo
  • 375
  • 1
  • 4
  • 15
  • can this be used for `vstest.console` ? If yes , do you know where can I find the syntax for defining test in a file , like you did in `list.txt` – user1207289 Sep 18 '19 at 15:44