Uhm, then perhaps you could try using the OutcomesTable: http://jbehave.org/reference/stable/outcomes-table.html

At the moment, though, the outcomes are only shown upon failure but could try and make this behaviour configurable (not sure if and how it'd work in 3.x).

In general, the failureCause is a simply a Java Throwable and you can add to the message whatever you feel is most appropriate. Or throw your own subclass instance with a given result object and in the FTL retrieve and show the result.

Else, please open a JIRA issue for a new 4.x request providing some example of your required functionality. E.g. some scenarios and the desidered output.

On 29/10/2012 03:10, Foley, Brooks (GE Healthcare) wrote:

Mauro

Thanks for getting back to me on this. I work in a regulated industry and as a part of recording objective evidence that the application is performing as designed, I cannot just have the results imply success by the absence of a failure indication. This is why both the expected and actual results need to be displayed along with a success or failure indication.

Is there an example for how to write a result to step.failureCause? if so can you point it out to me.

Thanks

Brooks

*From:*Mauro Talevi [mailto:[email protected]]
*Sent:* Saturday, October 27, 2012 8:08 AM
*To:* [email protected]
*Subject:* Re: [jbehave-user] How to use a custom report.ftl

No, at the moment (3.x) it's only failures that reported back. The successful step is meant to be self-explanatory in its language.

The 4.x refactor of the story execution will make it easier to incorporate extensions to the data and metadata incurred during execution.

Feel free to share your ideas on what info you'd like to make available. In particular, please explain your use cases.

The example below is not very illustrative IMO: the info that the result of the step execution is passed is already there as is the parameter used.

Why would you feel the need to add more info? I assume you have other use cases.

Cheers

On 26/10/2012 22:35, Foley, Brooks (GE Healthcare) wrote:

    Sorry one more question in the custom-html-output.ftl I would like
    the output on success to display a result like the following:

    *Scenario: MyTest*

    Given I go to "http://www.google.com"; <http://www.google.com>

    When I sign in with "myaccount" and "mypassword"

    Then I expect to see "[email protected]"
    <mailto:[email protected]> (PASSED Result = "[email protected]
    <mailto:[email protected]>")

    I can see in the custom-html-output.ftl the line for the failure case.

    <#if step.getFailure()??><pre
    class="failure">${step.failureCause}</pre></#if>

    Is there one for the success case like

    <#if step.getSuccess()??><pre
    class="success">${step.successCause}</pre></#if>

    And how do I write to the step.failureCause/step.successCause from
    my stories.java file?

    Alternately is there a way to write to the Jbehave project html
    via system.out.print ?

    Thanks,

    Brooks

    *From:*Foley, Brooks (GE Healthcare)
    *Sent:* Friday, October 26, 2012 2:50 PM
    *To:* [email protected] <mailto:[email protected]>
    *Subject:* [jbehave-user] How to use a custom report.ftl

    I can see from the Trader example how to implement a
    custom-html-output.ftl. How would I do this for the a
    custom-report.ftl replacing the jbehave-reports.ftl?

    Thanks,

    Brooks


Reply via email to