I should clarify what might not be obvious from the code:
This builds two sets of pages in the wiki:
- Features, which are basically just a dump of the features files into wiki format, added as children of the main "Features" page (confluence lets you have parent/child relationships, which is great for this sort of thing - no need to create an index page)
- Stories, which are our user stories; these are written by hand, and the script looks for story tags on each scenario, and if it finds a matching story in the wiki, it inserts the scenario into that wiki page (and links it back to the matching feature page).
So, for example, I might have features:
----
Feature: top level tabs (in tabs.feature)
@story-f-001 @story-f-002 @qa
Scenario: visit the foo tab
Given I am viewing the main page
When I navigate to the "Foo" tab
Then I should be on the "Foo" panel
----
Feature: foo wrangling (in foo.feature)
@story-f-001 @qa
Scenario: display all foos
Given I am viewing the "Foo" panel
When I select "view all"
Then I should see all foos in the system
Running "cucumber --dry-run --format WikiFormatter" will build new wiki pages "tabs" and "foo", and if there is a story page called "foo-1" it will add the tagged scenarios to it as well. (in a special "qa" section in this case)
- Korny