Let’s imagine a scenario where we have 100 feature file present in our project and every time we need to create corresponding runner file to execute that feature file is going to take a huge amount of testing effort.
To solve all
this issue one of the solutions is Auto Generating cucumber Runner file using
cucumber-Jvm-Parallel-Plugin.To More know about this plugin please click here.
Before going
into the implementation part let’s look into my project structure
To Implement
auto-generate Cucumber file we need to follow the below steps:
1) Inside our POM.xml file, we need to
add Cucumber-JVM-Parallel Plugin.
2) In that inside execution id and goal
should be generateRunner.
3) Rest all fields are very much self-explanatory
I have also put a comment in the plugin section as well.
4) Now once we execute our POM.Xml file
we will see that automatically all our runner files are generated corresponding
to feature file defined in Cucumber JVM parallel Plugin.
In this case, 4 Runner Files are auto-generated corresponding to my 4 feature files.
In this case, 4 Runner Files are auto-generated corresponding to my 4 feature files.
Nice implementation ..Thanks
ReplyThanks Ankur!
ReplyCan we achieve in normal BDD Cucumber Java project by adding Cucumber JVM Parallel Plugin Maven Plugin external jar?
If yes do we need to any setting to achieve this?
Could you please help me on this.
Thank you for this valuable information. Can you tell me how can we use Allure Report with junit in cucumber .plz
ReplyHow to work with cucumber 4.0 with the plugins
Replybecause it imports Runwith from cucumber.api whereas in 4.0 we have imports from import io.cucumber.junit.Cucumber;