FitNesse. UserGuide. FitLibraryUserGuide.
TreeList [add child]
Table cells may contain HTML lists. Consider the following tests:

fitlibrary.specify.DoTree

check tree
  • a
  • BB

check tree Top
  • a
  • BB

show tree

show tree <ul><li>A</li><li>B</li></ul>

For such lists to be handled correctly, the corresponding types (method arguments and return types) have to be subtypes of the special FitLibrary type Tree. This, in turn is a MetaTypeAdapter.

The methods of DoTree are as follows:

public class DoTree extends fitlibrary.DoFixture {
public ListTree tree() {
ListTree tree = new ListTree("");
tree.addChild(new ListTree("a"));
tree.addChild(new ListTree("BB"));
return tree;
}
public ListTree tree(String s) {
return ListTree.parse(s);
}
...


This works because class ListTree is a subtype of Tree. The fixture treats the HTML list as a tree structure. Here's ^AnotherTreeExample.

It's easy to define new subtypes of Tree. How to do this will be documented later.

Planned Changes