Skip to content

Commit db1ba2e

Browse files
authored
[JUnit Platform] Document how to run a single feature or scenario (#2804)
1 parent 55a2328 commit db1ba2e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

cucumber-junit-platform-engine/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,27 @@ tasks {
144144
}
145145
```
146146

147+
### Running a single scenario or feature from the CLI
148+
149+
To select a single scenario or feature the `cucumber.features` property can be
150+
used. Because this property will cause Cucumber to ignore any other selectors
151+
from JUnit, it is prudent to execute only the Cucumber engine.
152+
153+
#### Maven
154+
155+
To select the scenario on line 10 of the `example.feature` file use:
156+
157+
```shell
158+
mvn test -Dsurefire.includeJUnit5Engines=cucumber -Dcucumber.plugin=pretty -Dcucumber.features=path/to/example.feature:10
159+
```
160+
161+
Note: Add `-Dcucumber.plugin=pretty` to get test reports. Maven will not
162+
report on tests without a class.
163+
164+
#### Gradle
165+
166+
TODO: (Feel free to send a pull request. ;))
167+
147168
## Suites with different configurations
148169

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

0 commit comments

Comments
 (0)