Skip to content

Commit

Permalink
[JUnit Platform] Document how to run a single feature or scenario (#2804
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mpkorstanje authored Oct 13, 2023
1 parent 55a2328 commit db1ba2e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions cucumber-junit-platform-engine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,27 @@ tasks {
}
```

### Running a single scenario or feature from the CLI

To select a single scenario or feature the `cucumber.features` property can be
used. Because this property will cause Cucumber to ignore any other selectors
from JUnit, it is prudent to execute only the Cucumber engine.

#### Maven

To select the scenario on line 10 of the `example.feature` file use:

```shell
mvn test -Dsurefire.includeJUnit5Engines=cucumber -Dcucumber.plugin=pretty -Dcucumber.features=path/to/example.feature:10
```

Note: Add `-Dcucumber.plugin=pretty` to get test reports. Maven will not
report on tests without a class.

#### Gradle

TODO: (Feel free to send a pull request. ;))

## Suites with different configurations

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

0 comments on commit db1ba2e

Please sign in to comment.