I have about 100 selenium tests to run, but 2 of them cannot be run in parallel
Is it possible to disable parallelism only for those 2 tests, using xUnit?
(those 2 test cannot be parallel, because they need to simulate keyboard clicking -> so I would lose input focus using parallel execution)
Best scenario that I am looking for:
Add some attribute to 2 tests that will disable parallelism for them. Then in tests executions 98 tests will be running with 16 threads, and two remaining tests will be executed at the end using 1 thread.
I know that one of the solutions can be something like this:
But is not fitting my needs, and I wonder if I can run tests in a scenario like I describe in "best scenario"
P.S. If the is no solution for that, can I find something like that in nunit?
While Diver answer is correct it doesn't show how exactly to achieve this.
[CollectionDefinition(nameof(SystemTestCollectionDefinition), DisableParallelization = true)]
public class SystemTestCollectionDefinition { }
[Collection(nameof(SystemTestCollectionDefinition))]
public class BaseSystemTest { ... }
Now all tests within Collection will be executed in sequence.
Source: https://github.com/xunit/xunit/issues/1999
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With