How to run tests in parallel with Serenity/Cucumber Runner/Maven

1,979 views
Skip to first unread message

Gerhard Schuster

unread,
Jul 5, 2016, 10:57:44 AM7/5/16
to Serenity BDD Users Group
Hi there,

recently I've postet something about running the tests in parallel, which was utterly, totally wrong.
This should be correct.

- Write one java class anotiated @RunWith(CucumberWithSerenity.class) per featurefile. Use @CucumberOptions(features=...) to define the path to the feature file.
- Start the tests with mvn clean verify
- In the pom file use
<parallel>classes</parallel> in the configuration area for maven-failsave-plugin

Your tests will run in parallel, whether you run against a Selenium GRID or not

I've noticed the following problems:
- If you run maven with the -Dcucumber.options="--tags @ATag" settup, tests will not run in parallel

Viacheslav Timonov

unread,
Jul 12, 2016, 3:34:41 AM7/12/16
to Serenity BDD Users Group
Hi, also you can use parameters for maven-failsafe-plugin as,
<threadCount>4</threadCount>
<forkCount>4</forkCount>
 More info you can find here http://maven.apache.org/surefire/maven-failsafe-plugin/examples/fork-options-and-parallel-execution.html

Joe Colantonio

unread,
Jul 14, 2016, 1:53:17 PM7/14/16
to Serenity BDD Users Group
Thanks Viacheslav - this fixed my selenium grid parallel test running issue!!!!!!!

Matthew Chan

unread,
Jul 28, 2016, 9:34:16 PM7/28/16
to Serenity BDD Users Group
Seems to be a bit of a pain manually creating a runner class per feature file.

Have you tried something like this?

Reply all
Reply to author
Forward
0 new messages