
GivWenZen allows a user to use the BDD Given When Then vocabulary and plain text sentences to help a team get the words right and create a ubiquitous language to describe and test a business domain. The IdeaThe idea was taken from Cucumber and my desire to create Cucumber like specifications and tests in FitNesse. Like Cucumber, GivWenZen does not distinguish between Given When Then or and but you should. Regular expression parsing is used to determine what step method should be executed for each given when then step in a test. Regular expression parsing is also used to find parameters to the step method. Also see how other ideas from Cucumber map to FitNesse. Example1) Start with an example fixture actual class found in the givwenzen_test.jar.2) In a FitNesse table it could look like this.import and start should go in SetUp or SuiteSetUp|import|
|org.givwenzen|
|script|
|start|giv wen zen for slim| this is your test|script|
| given| a ToDo item is due tomorrow |
| when | the date changes to tomorrow |
| then | a notification exists indicating the ToDo is due | 3) The following is an example step class and test step methodpackage bdd.steps;
@DomainSteps
public class ExampleSteps {
@DomainStep( “a ToDo item is due (.*)” )
public void createToDoWithDueDateOf(CustomDate date) {
// do something
}
@DomainStep( “the date changes to (.*)” )
public void theDateIs(CustomDate date) {
// do something
}
@DomainStep( “a notification exists indicating the ToDo is due” )
public boolean verifyNotificationExistsForDueToDo() {
// do something
return false;
}
}
More ExamplesMore example can be found in the FitNesseRoot in source. It is easy to get started. Simple scenarios More complex scenarios Groups:http://groups.google.com/group/givwenzen_user http://groups.google.com/group/givwenzen_developer
|