quarkiverse / quarkus-cucumber

Quarkus Cucumber extension
Apache License 2.0
15 stars 15 forks source link

Add possibility to extend method CucumberQuarkusTest.getTests #124

Open AhmedDev98 opened 1 year ago

AhmedDev98 commented 1 year ago

Hello,

I am currently using this quarkus extension, and when I had a look at the Junit surefire report, it seems that all tests (scenarios) are named "getTests" In order to make the surefire report more accurate, I tried to configure the surefire maven plugin in this way :

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <version>3.1.2</version>
  <configuration>
      <statelessTestsetReporter implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5Xml30StatelessReporter">
          <usePhrasedTestCaseMethodName>true</usePhrasedTestCaseMethodName>
      </statelessTestsetReporter>
  </configuration>
</plugin>

After doing this, I have the following test names : <FeatureName>getTests<Scenario>

So in order to not see the "getTests" in the report, I needed to use the @DisplayName(": Scenario: ") from Junit5 to have a test name more accurate, but I was not able to do so since the CucumberQuarkusTest.getTests method is package private.

Is it possible to make this method protected ? In case you are interested also by using the @DisplayName(": Scenario: ") (or something close), this will help me to have less code on my side also.

Thank you in advance for your feedback

vsevel commented 1 year ago

any news on this? cc @stuartwdouglas @christophd @tisoft

EKrol2 commented 6 months ago

I have been running into the same issue. Looking into it further this seems to be the underlying issue: surefire-issue

There are a few workarounds described here: surefire-and-gradle-workarounds Sadly I havent been able to get these workarounds to work in combination with quarkus-cucumber.

Would it be possible to add support for the junit platform suite engine for example, to allow for greater flexibility? junit-platform-suite-engine

Of course there is the cucumber report itself which is properly generated, however not everything works properly with it. In our case, we use gitlab which integrates with junit/surefire reports but not with cucumber. Having all tests in the surefire report be called gettests makes it register there as only a single test...

The underlying issues might not be quarkus issues, but it would be nice to allow for flexibility so that we can circumvent the issues.