Question

Here is the example that I could get working. http://ivanz.com/2011/05/25/java-bdd-with-jbehave-and-watij-in-eclipse-with-junit/

Questions:

  1. This example has one story. If i need to have more than one story,
    Can i write it in the same file or should I create a new .story file for every story that I have?
  2. One story can have more than one scenarios, how to handle this kind of scenario

Please help...

No correct solution

OTHER TIPS

Generally speaking, a story contains one or more scenarios about a specific behaviour/feature of the software. For example, a "Login Story" handles all cases of a user trying to log in, with valid data, expired accounts, already logged in, and so forth. Trying to cover the logout feature is, pun intended, a different story.

Hence, by convention, one story file contains only the scenarios of one story. The framework does not limit you to put in the logout scenarios into the same story file handling the login scenarios, but there's only one block of narrative available. It furthermore allows you to separate the corresponding steps better; e.g. the necessary binding steps for logout do not need to be available during the login story.

As for adding further scenarios into a story file, simply separate them with a new line and start with the "Scenario: " keyword.

e.g.:

Scenario: Successfull login
Given ...
When ...
Then ...

Scenario: Login with no password
Given ...
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top