It is possible to capture the steps of the scenario that failed?

47 views
Skip to first unread message

Rafael

unread,
Feb 17, 2015, 11:31:44 PM2/17/15
to cu...@googlegroups.com
I know it's possible to capture the name of the scenario that failed with:

If (scenario. isFailed ()) {
System.out.println ("error in the scenario:" + getName() scenario.);
}

It is possible to capture the steps of the scenario that failed?

Aslak Hellesøy

unread,
Feb 18, 2015, 1:39:56 AM2/18/15
to cu...@googlegroups.com
No. What do you need it for? 

--
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+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Paolo Ambrosio

unread,
Feb 18, 2015, 2:18:33 AM2/18/15
to cu...@googlegroups.com
Depending on the version of Cucumber that you are using, technically you might be able to write a custom formatter. Practically I suggest you don't do that unless you have a good reason to do it.

What you want to do seems very unusual. As Aslak asked, why do you need it? It might be much easier to produce a JSON report and extract information from it.


Paolo

Rafael

unread,
Feb 18, 2015, 9:58:59 PM2/18/15
to cu...@googlegroups.com

Today I'm running tests with the webdriver and cucumber-jvm, I would like to have a scenario with error already report the fault in a Bug Tracker, put the name of the scenario that failed and the steps to get on failure.

Rafael
 

Paolo Ambrosio

unread,
Feb 19, 2015, 2:11:49 AM2/19/15
to cu...@googlegroups.com
I completely disagree with what you are doing, but I won't comment on that.

Technically... I suppose you run the test suite from a CI server (Jenkins, ...) so you could write a post-run script (in any programming language you are comfortable with) that parses Cucumber's JSON output and raises tickets in the bug tracker.

Paolo

Rafael

aslak hellesoy

unread,
Feb 19, 2015, 3:51:56 AM2/19/15
to Cucumber Users
On Thu, Feb 19, 2015 at 2:58 AM, Rafael <chiave...@gmail.com> wrote:
When a scenario fails, why don't you fix it immediately rather than swiping it under the carpet and put it in a bug tracker?

Aslak
 


Rafael
 
Reply all
Reply to author
Forward
0 new messages