Skip to content

When used with JUnit 5, test reports seems incompleteΒ #403

@ThomasGrt

Description

@ThomasGrt

πŸ‘“ What did you see?

When doing sbt test in test report target/test-reports/TEST-bdd.TestValidBDD.xml
I see lots of testcases with same name :

<testcase classname="bdd.TestValidBDD" name="(It is not a test it is a sbt.testing.SuiteSelector)" time="0.298">
<testcase classname="bdd.TestValidBDD" name="(It is not a test it is a sbt.testing.SuiteSelector)" time="0.097">

βœ… What did you expect to see?

Previously (JUnit 4) I had detailed names, corresponding to scenario being tested, example :

<testcase classname="bdd.TestValidBDD" name="Authentication.Unauthenticated" time="0.289">
<testcase classname="bdd.TestValidBDD" name="Authentication.Authenticated with an invalid token" time="0.103">

πŸ“¦ Which tool/library version are you using?

SBT project

sbt plugin :

  • addSbtPlugin("com.github.sbt.junit" % "sbt-jupiter-interface" % "0.15.0")

dependencies :

  • junit BOM 5.13.4
  • "io.cucumber" % "cucumber-junit-platform-engine" % "7.26.0" % Test,
  • "com.github.sbt.junit" % "jupiter-interface" % JupiterKeys.jupiterVersion.value % Test,
  • "org.junit.jupiter" % "junit-jupiter" % junitBom.key.value % Test,
  • "org.junit.platform" % "junit-platform-suite" % junitBom.key.value % Test,

πŸ”¬ How could we reproduce it?

Create some scenarios and a Test file like :

import io.cucumber.junit.platform.engine.Constants
import org.junit.platform.suite.api.ConfigurationParameter
import org.junit.platform.suite.api.IncludeEngines
import org.junit.platform.suite.api.SelectPackages
import org.junit.platform.suite.api.Suite

@Suite
@IncludeEngines(Array("cucumber"))
@SelectPackages(Array("features")) // Load all *.feature files in the given package
@ConfigurationParameter(key = Constants.GLUE_PROPERTY_NAME, value = "glue")
@ConfigurationParameter(key = Constants.FILTER_TAGS_PROPERTY_NAME, value = "@valid")
class TestValidBDD {}

launch sbt test

look your test report file in target\test-report

πŸ“š Any additional context?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions