How to run cucumber feature files in parallel ?

1,391 views
Skip to first unread message

80Vikram

unread,
Sep 23, 2016, 1:26:13 AM9/23/16
to Serenity BDD Users Group
Hi All,

I need to run cucumber feature files in parallel mode

For junit test cases had used @RunWith(SerenityRunner.class) and maven-surefire-plugin to run in parallel.


In case of cucumber feature file have used @RunWith(CucumberWithSerenity.class) but not sure how to run these in parallel ?

Thanks in advance.

Regards,
Vikram

John Smart

unread,
Sep 23, 2016, 1:33:02 AM9/23/16
to 80Vikram, Serenity BDD Users Group
You can do the same thing to run the Cucumber test runners in parallel. Cucumber has no support for running the individual feature files or scenarios in parallel.
 
--
You received this message because you are subscribed to the Google Groups "Serenity BDD Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thucydides-use...@googlegroups.com.
To post to this group, send email to thucydid...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

80Vikram

unread,
Sep 23, 2016, 1:52:56 AM9/23/16
to Serenity BDD Users Group, vikra...@gmail.com
Hi John,

Thanks for clarification  , maven-surefire-plugin failed for me as I was using   skipITs flag and it was causing to skip all the test cases

Just now I found about  cucumber-jvm-parallel-plugin & reading about it.

Have you tried using it earlier; any benefits compared to surefire plugin and is it supported with Serenity ?

Regards,
Vikram


John Smart

unread,
Sep 23, 2016, 1:57:12 AM9/23/16
to 80Vikram, Serenity BDD Users Group
Unfortunately the cucumber-jvm-parallel-plugin won’t work because it will not generate classes that use the Serenity Cucumber runner.

80Vikram

unread,
Sep 23, 2016, 12:08:35 PM9/23/16
to Serenity BDD Users Group, vikra...@gmail.com
Hi John,

Thanks for detailed clarification on this.

Just for reference to others

http://thucydides.info/docs/articles/an-introduction-to-serenity-bdd-with-cucumber.html more info refer to below

3.2 "The Scenario Runner"

Regards,
Vikram

80Vikram

unread,
Sep 29, 2016, 11:50:28 AM9/29/16
to Serenity BDD Users Group, vikra...@gmail.com
Here is my pom.xml portion which does the magic in running parallel on single box and as well with Grid setup + Docker

<!--  http://techblog.bva-auctions.com/testing/parallel-testing-with-maven-fail-safe/ -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.19.1</version>
                <configuration>
                   <includes>
                        <include>**/cucumber/*.java</include>
                    </includes>
                    <!-- http://stackoverflow.com/questions/32987998/junit-and-surefire-parallel-tests-forkcount-threadcount -->
                    <parallel>classes</parallel>
                    <threadCount>1</threadCount>
                    <reuseForks>${run.parallel}</reuseForks>
                    <argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
                    <systemPropertyVariables>
                        <tags>${tags}</tags>
                    </systemPropertyVariables>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

In case someone has better solution , please share as well.

Regards,
Vikram
Reply all
Reply to author
Forward
0 new messages