From 4150c37d7153582137e3015d42a438e88e9664ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Jourdan-Weil?= Date: Wed, 20 Aug 2025 15:19:42 +0200 Subject: [PATCH] docs: update running with Junit 5 --- docs/usage.md | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/docs/usage.md b/docs/usage.md index 6c7a898..a544e30 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -102,11 +102,12 @@ import org.junit.platform.suite.api._ key = Constants.GLUE_PROPERTY_NAME, value = "cucumber.examples.scalacalculator" ) +@ConfigurationParameter(key = Constants.PLUGIN_PROPERTY_NAME, value = "pretty") class RunCucumberTest ``` -Cucumber plugins can be added in the `junit-platform.properties` file (must be in the test resources classpath, -usually `src/test/resources`): +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, +usually `src/test/resources`). For instance: ```properties cucumber.plugin=pretty ``` @@ -116,18 +117,12 @@ cucumber.plugin=pretty You need to enable the support of JUnit 5 in SBT: ```scala // plugins.sbt -addSbtPlugin("com.github.sbt.junit" % "sbt-jupiter-interface" % "0.15.0") +// 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) +addSbtPlugin("com.github.sbt.junit" % "sbt-jupiter-interface" % "0.15.1") // build.sbt libraryDependencies += "com.github.sbt.junit" % "jupiter-interface" % JupiterKeys.jupiterVersion.value % Test ``` -And, because of an [issue in the SBT integration](https://github.com/sbt/sbt-jupiter-interface/issues/142), you need to -set the following property in the `junit-platform.properties` file (must be in the test resources classpath, usually -`src/test/resources`): -```properties -cucumber.junit-platform.discovery.as-root-engine=false -``` - ### JUnit 4 Add the `cucumber-junit` dependency to your project.