Skip navigation.

FitNesse - NarrativeFixture Story 1 nearing completion

The FitNesse Narratives project that I've been working on along with Andy Palmer, has reached a major milestone - our first story is functionally complete. We're finishing off some refactoring and need to automate the build but once those things are in place our 'Iteration 0' Story will be done.

I thought that you'd like a preview of the NarrativeFixture, the star of this story, so you can start to see where we are going. You'll be able to get your hands on it and use it yourself soon enough.

The approach we've taken to this exercise is to imagine that we were writing FitNesse from the ground up. We wrote our first user story as if it were the first story for the project:

A Place To Start

As a FitNessse User

I need a home page

So that I have a place to start

We then wrote the one and only acceptance test for the story. We realised that we'd left out some crucial things and have added them along the way. It now looks like this:

Given that the FitNesse wiki is a Wiki

Given that the FitNesse User is a Web User

Given that the FitNesse wiki was able to start for the first time

When the FitNesse User attempts to go to the Home Page

Then the content of the Home Page for the FitNesse User should be Welcome to the Wonderful World of FitNesse!

the end

You might be thinking... this doesn't look like a Fit Test or a Slim test for that matter. Well, that's because the NarrativeFixture enables the BDD style of writing tests. It does so in a way that makes maintenance as easy as possible by separating the who (the roles) from the what (the actions). It also handles multiple roles and multiple instances of the same role. For example, you can have two different users doing different things - say as part of a work-flow.

Here's how our test looks:

You may have noticed that the tables have only subtle borders. We've changed the style-sheet so that the tables aren't in-your-face... making it a little more readable.

I'll go into more detail about how this works another time... but one of the cool features is that it keeps track of multiple roles and "the end" automatically shuts them all down. In the above example it creates instances of the wiki and a web user. At "the end" they are simply closed automatically.

There's a lot more to come but we're very happy that (in bits of our spare time) we've got to this stage... now the only way is up :-)