Section 8.3. Organizing Tests with Subwikis


8.3. Organizing Tests with Subwikis

FitNesse, 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.

  • As tests evolve, we inevitably need to rename the corresponding pages. A FitNesse page can be renamed by clicking the Refactor button on the left-hand side of the page and filling in the new name in the Rename this page section.

  • If a page has a lot of pages within it, it can be inconvenient to manage the list of them. Include the command !contents in the page, and FitNesse will generate a table of contents of all those pages in alphabetical order.

  • If it is necessary to move a whole subwiki from one place in the FitNesse page hierarchy to another, it is not necessary to recreate all the pages. Click the Refactor button and fill in the new name in the Move this page section.

  • By default, FitNesse uses the special pages .PageHeader and .PageFooter to display the header and footer information on other FitNesse pages. And PageHeader and PageFooter pages added within any subwiki in the page hierarchy are used instead in all pages within that subwiki.



    Fit for Developing Software. Framework for Integrated Tests
    Fit for Developing Software: Framework for Integrated Tests
    ISBN: 0321269349
    EAN: 2147483647
    Year: 2005
    Pages: 331

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net