Saturday, 14 July 2018

SE - 17 - Run BDD(cucumber) tests in Parallel

We will discuss the approaches to run Cucumber test cases in parallel in BDD framework. The first approach is pretty simple where we can create a separate runner class for each feature file. This approach is not so good as we will have to create too many runner classes. There will be hundreds of runner classes which will be hard to maintain.

Now the second approach is better as compared to the first one. We need 2 plugins for parallel execution through cucumber. They are :
(i) Cucumber JVM Parallel Plugin
(ii) maven-failsafe-plugin

The maven-failsafe-plugin is used to configure the parallel execution. We can configure the threadcount and parallel classes. T
he Cucumber JVM Parallel Plugin is used to generate the runners. We need to set parallelScheme and the customVmTemplate in it. The parallelScheme must be Feature because we run feature files in parallel. There are few more configurations which needs to be done here. We need to set the Glue package where step definitions are located.

No comments:

Post a Comment