Discussion:
[Cucumber] Failed scenario is duplicated by a Scenario.classMethod in JUnit report
Add Reply
Aleksei Valikov
2016-06-16 11:58:23 UTC
Reply
Permalink
Raw Message
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:

<Loading Image...>


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
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Rye L
2016-07-22 18:22:18 UTC
Reply
Permalink
Raw Message
Same issue here. Did you figure it out Alexey?
Post by Aleksei Valikov
Hi,
we have a problem that when Cucumber scenario fails, we see duplicate
error in the JUnit report in Jenkins.
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.
@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
<https://lh3.googleusercontent.com/-XE1hmbD_JTs/V2KSpkLb1QI/AAAAAAAACiA/WMuXOlSfbGkFhncEzuspuHe7QQ2KIH3CwCLcB/s1600/45.PNG>
<?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
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
c***@smart-trade.net
2017-05-16 14:41:21 UTC
Reply
Permalink
Raw Message
I don't know if you still need help, but adding "junit:target/cucumber.xml"
Post by Aleksei Valikov
Hi,
we have a problem that when Cucumber scenario fails, we see duplicate
error in the JUnit report in Jenkins.
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.
@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
<https://lh3.googleusercontent.com/-XE1hmbD_JTs/V2KSpkLb1QI/AAAAAAAACiA/WMuXOlSfbGkFhncEzuspuHe7QQ2KIH3CwCLcB/s1600/45.PNG>
<?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
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Renato Ćurić
2018-01-23 09:23:58 UTC
Reply
Permalink
Raw Message
Hi Aleksei,

Did you manage to solve the issue? I have the same problem.

Best regards,
Renato
Post by Aleksei Valikov
Hi,
we have a problem that when Cucumber scenario fails, we see duplicate
error in the JUnit report in Jenkins.
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.
@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
<https://lh3.googleusercontent.com/-XE1hmbD_JTs/V2KSpkLb1QI/AAAAAAAACiA/WMuXOlSfbGkFhncEzuspuHe7QQ2KIH3CwCLcB/s1600/45.PNG>
<?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
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Yang Zhao
2018-02-02 01:18:33 UTC
Reply
Permalink
Raw Message
Did you solve this problem? I have the same issue.
Post by Aleksei Valikov
Hi,
we have a problem that when Cucumber scenario fails, we see duplicate
error in the JUnit report in Jenkins.
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.
@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
<https://lh3.googleusercontent.com/-XE1hmbD_JTs/V2KSpkLb1QI/AAAAAAAACiA/WMuXOlSfbGkFhncEzuspuHe7QQ2KIH3CwCLcB/s1600/45.PNG>
<?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
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...