Skip to content

Commit 7757727

Browse files
committed
docs: update running with Junit 5
1 parent a3caf9d commit 7757727

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

docs/usage.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,12 @@ import org.junit.platform.suite.api._
102102
key = Constants.GLUE_PROPERTY_NAME,
103103
value = "cucumber.examples.scalacalculator"
104104
)
105+
@ConfigurationParameter(key = Constants.PLUGIN_PROPERTY_NAME, value = "pretty")
105106
class RunCucumberTest
106107
```
107108

108-
Cucumber plugins can be added in the `junit-platform.properties` file (must be in the test resources classpath,
109-
usually `src/test/resources`):
109+
Some properties can also be applied for all suites by adding them in the `junit-platform.properties` file (must be in the test resources classpath,
110+
usually `src/test/resources`). For instance:
110111
```properties
111112
cucumber.plugin=pretty
112113
```
@@ -116,18 +117,12 @@ cucumber.plugin=pretty
116117
You need to enable the support of JUnit 5 in SBT:
117118
```scala
118119
// plugins.sbt
119-
addSbtPlugin("com.github.sbt.junit" % "sbt-jupiter-interface" % "0.15.0")
120+
// version 0.15.1+ is important, earlier versions have a bug preventing properly running Cucumber tests (https://github.com/sbt/sbt-jupiter-interface/issues/142)
121+
addSbtPlugin("com.github.sbt.junit" % "sbt-jupiter-interface" % "0.15.1")
120122
// build.sbt
121123
libraryDependencies += "com.github.sbt.junit" % "jupiter-interface" % JupiterKeys.jupiterVersion.value % Test
122124
```
123125

124-
And, because of an [issue in the SBT integration](https://github.com/sbt/sbt-jupiter-interface/issues/142), you need to
125-
set the following property in the `junit-platform.properties` file (must be in the test resources classpath, usually
126-
`src/test/resources`):
127-
```properties
128-
cucumber.junit-platform.discovery.as-root-engine=false
129-
```
130-
131126
### JUnit 4
132127

133128
Add the `cucumber-junit` dependency to your project.

0 commit comments

Comments
 (0)