Skip to content

Commit 60f1d56

Browse files
committed
Note that using cucumber.features with Gradle will run scenarios twice
1 parent e6966ff commit 60f1d56

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

cucumber-junit-platform-engine/README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,18 +185,23 @@ Define Cucumber properties before running the test to ensure that your `build.gr
185185

186186
```groovy
187187
tasks.test {
188-
systemProperty("cucumber.features", System.getProperty("cucumber.features"))
189-
systemProperty("cucumber.filter.tags", System.getProperty("cucumber.filter.tags"))
190-
systemProperty("cucumber.filter.name", System.getProperty("cucumber.filter.name"))
188+
systemProperty("cucumber.features", System.getProperty("cucumber.features"))
189+
systemProperty("cucumber.filter.tags", System.getProperty("cucumber.filter.tags"))
190+
systemProperty("cucumber.filter.name", System.getProperty("cucumber.filter.name"))
191+
systemProperty("cucumber.plugin", System.getProperty("cucumber.plugin"))
191192
}
192193
```
193194

194195
Then to select the scenario on line 10 of the `example.feature` file use:
195196

196197
```shell
197-
gradle test -Dcucumber.features="path/to/example.feature:10"
198+
gradle test --rerun-tasks --info -Dcucumber.plugin=pretty -Dcucumber.features=path/to/example.feature:10
198199
```
199200

201+
Note: Because both the Suite Engine and the Cucumber Engine are included, this
202+
will run tests twice. (If you know how to prevent this, please send a pull
203+
request).
204+
200205
## Suites with different configurations
201206

202207
The JUnit Platform Suite Engine can be used to run Cucumber multiple times with

0 commit comments

Comments
 (0)