Fixture classes from the basic FIT package (including
ColumnFixture,
ActionFixture
and
RowFixture) handle a blank check cell by printing out the actual
result, without comparing it to anything.
We can write a test without actually specifying the results
and FitNesse will print current values when we run this
test. We can now quickly turn these results into a new test
and use the values as expected outcome for the future.
To convert the results into a test, select the entire table in the browser, directly from the rendered results page, not from the HTML source nor wiki source, and copy it. Internet Explorer allows you to get just a few rows at a time, while in some versions of Firefox you have to select the entire table in order to copy it properly. Edit the test page, delete the old table and paste the contents of the clipboard into the page editor. You should see the results table with column values separated by tabs. Click the Spreadsheet to FitNesse button below the editor text box. This turns the tab-separated results table into a FitNesse test table, converting the tabs into pipes to separate cells and even putting the exclamation mark before the first row automatically. Simply save the page and you have a snapshot test.



