4

I have a set of acceptance tests written for the Cucumber-JVM. In order to reduce the feedback time I would like to run the scenarios (of a feature) in parallel. How do I do that in the simplest and most convenient way?

(I would prefer to be able to express this in Java code, as a regular JUnit test/runner, i.e. I would prefer not to resort to some workaround using the maven-surefire or maven-failsafe plugin which would require(?) twiddling and merging of the Cucumber reports afterwards.)

keyoxy
  • 4,423
  • 2
  • 21
  • 18
  • I use surefire to run cucumber tests in parallel and use it with Jenkins plugin. Why do you need to merge cucumber reports? – nilesh Jun 17 '14 at 01:49
  • you can also do this with gradle, if you are using it? – Dude May 07 '15 at 06:33
  • also faced the same issue. it's hard to find the solution in original answer. might help somebody in future - use 'cucumber-jvm-parallel-plugin' with 'SCENARIO' in configuration – user3535807 Jan 24 '18 at 15:34

1 Answers1

2

Due to the nature of the cucumber-jvm package, test parallelization is limited for the time being. There are tentative plans for the future to change the API (gherkin3, cucumber-jvm v2), but nothing is available for full parallelization now on the cucumber-jvm.

There is still a way to attain a degree of parallelism on the cucumber-jvm. The Zucchini package (https://github.com/Comcast/Zucchini) can help by providing context-level parallelism, which could help if you have to run a battery of tests against Android / iOS / Chrome / etc. Test results are then merged into a single report.

To start using Zucchini, create a new test class that extends AbstractZucchiniTest and is tagged with @CucumberOptions and ZucchiniOutput. The class should then implement the List<TestContext> getTestContexts() method that returns a list of your specialized contexts.

Zucchini also provides other features such as cross-context barrier synchronization and aggregated test output into an HTML report. If you already have cucumber tests, there isn't much involved in upgrading them to Zucchini tests.

Andrew Benton
  • 506
  • 2
  • 12
  • There is an example available under: https://github.com/dimaj/zucchini-sample. It shows how to use Selenium web drivers for Chrome and Firefox with Zucchini and the repo should build for any platform, though execution of the chromedriver is dependent on the OS. – Andrew Benton Oct 14 '15 at 04:08