Question

We want to use JBehave to write automated system tests. Enterprise politics mandate that all system tests must be documented and tracked in HP ALM (The specifc tool actually doesn't matter, but I'd appreciate some sympathy in the comments :-). Therefore we are asked to keep a reference (Link / ID) in the JBehave stories to the HP ALM entries.

So far I see the following options to do this:

  1. use coul use a comment:

    !-- ALM:4711
    Given ...
    

    But this is only visible in the story file. It will never show up in reports where it really would be useful.

  2. make a pseudo step possibly using an addition AND at the end of the story:

    Given ...
    When ...
    Then ...
    And this implements ALM 4711
    

    This makes the reference available in code and in the reports which is good, but it feels dirty since obviously it isn't any kind of real assertion.

Is there a better way to have this kind of meta data in the stories? Maybe it is possible to define a custom keyword to get something like:

    Given ...
    When ...
    Then ...
    ALM-Ref 4711
Was it helpful?

Solution

My suggestion is to use Meta, that can be applied both at story and scenario level. this way you can filter by them and can have it in reports. see doc here.

eg:

Meta: @ALM 4711

Scenario: my scenario Meta: @ignored false @ALM 4712

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top