8.3. Organizing Tests with SubwikisFitNesse, unlike many wikis, allows for a hierarchy of pages, analogous to the hierarchy of folders and files in a filing cabinet or a filing system, with pages playing both roles in FitNesse. These subwikis provide a convenient way to organize lots of tests, as well as to allow for separate software projects to be managed by the same FitNesse system. As we saw in the previous section, we can add a new page at the same level as an existing page. We simply add a wiki word to that page, which creates the link, and then click the ? to edit and save the new page. To add a subwiki, a new page within an existing page, we use a leading ^in our wiki word. For example, to add a subwiki to our TestMyTable page, add ^WithinPage as a wiki word to that page and click its ? link. A new page is created within the current page, instead of at the same level. This can be seen from the title of the page, which includes the name of both the parent page and the new page: TestMyTable.WithinPage. If we use an ordinary wiki word, such as SecondWithinPage, in our new WithinPage page and create it, SecondWithinPage will be located in the same subwiki. If we want to refer to the new SecondWithinPage page from a page not directly in that subwiki, we refer to it by its full name: .TestMyTable.SecondWithinPage. To organize test pages, you may add subwikis within subwikis as deeply as you wish. For example, from the FrontPage of FitNesse, we could have a set of subwikis for each of the main areas of test for our application. Each of those areas could contain further subwikis containing individual pages of tests. Just as with folders and files, good naming of subwikis makes it easy to find specific tests. Here are some quick pointers for organizing test pages; click the FitNesseUserGuide for further details.
|