Hi,
we have a problem that when Cucumber scenario fails, we see duplicate error in the JUnit report in Jenkins.
Here's a sample scenario(no matter what it does, just for reference):
Feature: Step definitions for timetable
 Scenario: Create minimalistic timetable with overnights
  Given Timetable
   | station | arrival | departure |
   | MH    |     | 06:03   |
   | MIH   |     | 05:03   |
   | FF    |     | 04:03   |
   | EDO   | 03:00  |      |
  Then Timetable equals
   | station | arrivalDate | arrival | departureDate | departure |
   | MH    |       |     | 2015-08-25   | 06:03   |
   | MIH   | 2015-08-26  | 05:00  | 2015-08-26   | 05:03   |
   | FF    | 2015-08-27  | 04:00  | 2015-08-27   | 04:03   |
   | EDO   | 2015-08-28  | 03:01  |        |      |
This scenario fails as arrival time in EDO is 03:00, not 03:01.
We execute tests via JUnit:
@RunWith(Cucumber.class)
@ContextConfiguration(classes = CucumberConfiguration.class)
public class RunCucumberTest {
}
When tests are run via Gradle build on the CI server (Jenkins), we get this failing scenario reported twice. Once as "Scenario: Step definitions for timetable.Then Timetable equals" and once as "Scenario: Step definitions for timetable.classMethod". This is how it looks like in Jenkins:
And here's the generated JUnit report:
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="Scenario: Create minimalistic timetable with overnights" tests="3" skipped="0" failures="2" errors="0" timestamp="2016-06-16T11:40:51" hostname="ip-10-43-151-79" time="0.14">
 <properties/>
 <testcase name="Given Timetable" classname="Scenario: Create minimalistic timetable with overnights" time="0.0"/>
 <testcase name="Then Timetable equals" classname="Scenario: Create minimalistic timetable with overnights" time="0.009">
  <failure message="org.junit.ComparisonFailure: ..." type="org.junit.ComparisonFailure">...</failure>
 </testcase>
 <testcase name="classMethod" classname="Scenario: Create minimalistic timetable with overnights" time="0.157">
  <failure message="org.junit.ComparisonFailure: ..." type="org.junit.ComparisonFailure">...</failure>
 </testcase>
 <system-out>...</system-out>
 <system-err><![CDATA[...]]></system-err>
</testsuite>
As you see, classMethod is present here as a test case.
We'd like to get rid of the second "classMethod" report. Does anyone have an idea how to do this?
Best wishes,
Alexey