Reputation: 71
I have created 10 Specflow feature files, each having 5 Scenarios. So, 50 Scenarios or tests in total. When I run these tests using SpecRun in parallel (3 threads), 3 scenarios in each feature file gets executed at once, which is fine.
I was using Nunit Runner Before. If we run three threads and specify the following code in app.config, the runner picks one scenario from three different feature file.
[assembly: Parallelizable(ParallelScope.Fixtures)]
But SpecRun picks three scenarios, from the same feature file. My requirement is to replicate the NUnit runner behaviour for Specrun. Thus, executing, 3 feature files in parallel at a time. Is there a way to do this?
I have tried the following links:
How to run feature files in parallel when using specflow/specrun?
How to run specflow feature files in parallel?
SpecFlow Parallel and non Parallel tests
Upvotes: 2
Views: 749
Reputation: 31
First, You have to implement context injection or any dependency injection since specrun with specflow context doesn't support parallel execution.
Also, [assembly: Parallelizable (ParallelScope.Fixtures)]
is defined for Nunit and not for Specrun. If you implement specflow context injection then you can get what you want by increasing thread count. Specflow context injection will execute each feature in parallel depending on your thread count.
I hope this gives you clarity.
Upvotes: 0