@@ -35,6 +35,7 @@ erDiagram
35
35
"Jupiter Test Engine" ||--|{ "Test Classes": "discovers and executes"
36
36
```
37
37
38
+ In practice, integration is still limited so we discuss the most common workarounds below.
38
39
39
40
### Maven Surefire and Gradle
40
41
@@ -53,15 +54,15 @@ The JUnit Platform Suite Engine can be used to run Cucumber. See
53
54
[ Suites with different configurations] ( #suites-with-different-configurations )
54
55
for a brief how to.
55
56
57
+ ##### Maven and Gradle workarounds
58
+
56
59
Because Surefire and Gradle reports provide the results in a ` <Class Name> - <Method Name> `
57
60
format, only scenario names or example numbers are reported. This
58
61
can make for hard to read reports.
59
62
60
- To improve the readability of the reports provide the
61
- ` cucumber.junit-platform.naming-strategy ` configuration parameter to
62
- Gradle. This will include the feature name as part of the test name.
63
-
64
- ##### Maven
63
+ To improve the readability of the reports use the
64
+ ` cucumber.junit-platform.naming-strategy ` configuration parameter. This will
65
+ include the feature name, scenario name, example number, ect in the report.
65
66
66
67
``` xml
67
68
<plugin >
@@ -78,15 +79,31 @@ Gradle. This will include the feature name as part of the test name.
78
79
</plugin >
79
80
```
80
81
81
- ##### Gradle
82
-
83
82
``` kotlin
84
83
tasks.test {
85
84
useJUnitPlatform()
86
85
systemProperty(" cucumber.junit-platform.naming-strategy" , " long" )
87
86
}
88
87
```
89
88
89
+ ##### IDEA workarounds
90
+
91
+ When running features through IDEA, the Cucumber CLI is used. The CLI looks for
92
+ configuration properties in ` cucumber.properties ` while JUnit looks for
93
+ ` junit-platform.properties ` . To avoid duplication you can use the
94
+ ` @ConfigurationParametersResource ` annotation to include ` cucumber.properties `
95
+ into a Suite.
96
+
97
+ ``` java
98
+ @Suite
99
+ @IncludeEngines (" cucumber" )
100
+ @SelectPackages (" com.example" )
101
+ @ConfigurationParameter (key = GLUE_PROPERTY_NAME , value = " com.example" )
102
+ @ConfigurationParametersResource (" cucumber.properties" )
103
+ public class RunCucumberTest {
104
+ }
105
+ ```
106
+
90
107
#### Use the JUnit Console Launcher ###
91
108
92
109
You can integrate the JUnit Platform Console Launcher in your build by using
@@ -259,8 +276,6 @@ public class RunCucumberTest {
259
276
}
260
277
```
261
278
262
-
263
-
264
279
## Parallel execution ##
265
280
266
281
By default, Cucumber runs tests sequentially in a single thread. Running tests
0 commit comments