BDD encourages as much information as is meaningful to the business to be included in the stories and scenarios. But as these stories and scenarios grow it may become difficult to navigate through all this information. It will also become necessary to organise the growing number of stories by different criterias.
To help users better manage their stories, JBehave allow the specification of meta information, both at story and scenario level. Meta information is provided as a list of name-value properties, e.g.:
Meta: @author Mauro @themes UI Usability Scenario: A scenario in which the user can view all relevant information via UI Meta: @ignored false Given ... // normal scenario steps Scenario: A scenario which we cannot run every time due to some technical contraint Meta: @skip @ignored true Given ... // normal scenario steps
When JBehave encounters the keyword Meta:, it collects the provided name-value properties, separated by the property keyword @. Both keywords are configurable and localizable.
For each given property, the first space separates the name from the value, e.g. in the property "themes UI Usability", the name is "themes" and the value is "UI Usability". The value can also be empty, as in the case of the "skip" property.
Note that spaces are also allowed after the property keyword @, but these will be ignored in the parsing. E.g. if we wrote:
Meta: @ author Mauro @ themes UI Usability
the property names would still be "author" and "themes".It is important to note that the meta property names are not constrained so users can chose whatever names are most appropriate for the information they are trying to convey. The properties are collected as part of the story and scenario parsing and made available for different uses, e.g. meta filtering or story mapping.