1

How can I order my scenarios to run in a given order?

I have a series of scenarios that depend on the previous scenario having run.

I'm running my specflow tests using nunit3console.

I haven't found anything online that seems to work.

And yes my tests do need to run in a particular order otherwise it's pointless.

Scenario: I perform first scenario

Scenario: I perform second scenario

elllo
  • 79
  • 2
  • 9

1 Answers1

1

NUnit by default runs tests in alphabhetical order. As of NUnit 3 you can try running these in order, reference here.

It is not considered good practice to limit scenarios to run in a particular order though as each and every one of them sould be able to run independently of one another.

Other posts with similar information, can be found here and here.

magicode118
  • 1,444
  • 2
  • 17
  • 26
  • I mean in theory except if I require something to have happened in a organized workflow I do want things to run in a particular order. Unless specflow and nunit aren't the tools I should use for my testing and there's something else out there or I have to abandon nunit and specflow and create a custom application to run a series of documented tests...? – elllo Apr 25 '19 at 16:31
  • I guess it depends on what you want achieve by having tests ordered in a particular way. You could also sort the ordering in your reporting system after all tests have run in theory too (if you want to present your tests in a particular, customized way to business, for example). – magicode118 Apr 26 '19 at 08:48