How to run parallel test jUnit5 in spring boot - cucumber version 5 and more
You can provide options by adding a junit-platform.properties
file to your classpath root. For example:
src/test/resources/junit-platform.properties
cucumber.execution.parallel.enabled=truecucumber.execution.parallel.config.strategy=fixedcucumber.execution.parallel.config.fixed.parallelism=10
You can also pass options to the JUnit Platform via Surefires/Failsafes configurationParameters parameter field.
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> <version>3.0.0-M3</version> <configuration> <properties> <configurationParameters> cucumber.execution.parallel.config.fixed.parallelism=24 </configurationParameters> </properties> </configuration></plugin>
And because Cucumber is a JUnit Platform Engine you can also use any of the other ways you'd pass configuration parameter to the JUnit Platform.
Note that -D
will not work because surefire starts a new JVM, you'd have to use `-DargLine='....' for this.