Home » Fitnesse » Basic Fit Fixtures

Basic Fit Fixtures

Today we will discuss the  types of Basic FIT Fixtures and their table format.But before that please go through these links for better understanding.

  1. Fitnesse – Introduction
  2. Fitnesse Installation/ Environment Setup
  3. Sample project for Fitnesse
  4. Understand Fixtures and Usability Recommendations in Fitnesse

Following are basic fixtures in FIT

  • Column Fixture
  • Action Fixture
  • Row Fixture
  • Table Fixture
  •  Import
  • Summary Fixture


 ColumnFixture maps table columns directly to properties, methods and fields of the fixture class. It is very useful for repetitive verification for example-when same test needs to be repeated for different combinations of input arguments.

Table Format

The first row of the table is the test class name. The second row lists column names, specifying a field or method that the column is related to. Output values must have a question mark ?or parentheses ()after the field or method name.

Java Source Code

Usage

======>>>Column Fixtureis great for describing calculation-based business rules and state machines. It should be used when the same type of calculation should be verified for a range of different input values, and user knows in advance all the different combinations.

ActionFixture was originally intended for workflow-style tests that are not repetitive. It uses a UI metaphor to automate other fixtures.

Table Format

The first row of an ActionFixture table always initializes the fixture class, in this case the ActionFixture itself and not a custom subclass. All rows after the first begin with a command cell, followed by command arguments in the remaining cells. Some rows will have two and some will have three cells. The second row is typically used for the start command, which expects one argument — the class name for the actual fixture to automate.

Java Source Code

Usage

=====>>ActionFixture is used to describe UI-style verification.

RowFixture tests dynamic lists of objects. It will compare the expected list (FitNesse table) with the actual result (from fixture code) and report any additional or missing items.

Table Format

The first row of the table is the fixture class name. The second row describes the structure of objects in the list (the properties or methods that you want to verify). All rows after that describe expected objects in the array.

Java Source Code

Usage

======>>Row Fixture is used to test and verify lists of objects, or to execute a method on every object in the list. Do not use RowFixture when the element order is important. (Use Array Fixture instead)

Table Fixture is an additional class in the FitNesse package. It is used to execute free-form tables that do not have a repetitive structure.

Table Format

With TableFixture, user can decide the format and which cells are actually used as part of the test. The only limitation is that the first row has to point to the class name of the fixture. This class can be used to turn existing invoices, reports or documents into FitNesse tests.

Java Source Code

Usage

===>>TableFixture is used when tests are in a business-specific table format that cannot easily work with any other fixture type. This is especially convenient if existing documents can be exported to HTML tables, since you can paste that HTML directly into FitNesse.

Import fixture can be used to tell FitNesse where to look for fixture classes. After importing a namespace or package it does not require fully-qualified fixture class names, thus making the tables more readable.

Table Format

The first row of the table should be Import. All following rows list namespaces or packages to import — one cell per row.

Usage

=====>>Import fixture is used to create test pages easier to read. It is a good practice to put this table into the SetUp pages for test suites.

Summary Fixture is a way to display a little bit of extra data on the page. Add a fit. SummaryFixture table at the bottom of a page and it will add a three-row table to the results, giving the standard counts for the page (right, wrong, ignored, and exceptions) as well as the run date and the run elapsed time for the fixture. Though it is not very useful, but handy when looking at a build report in order to message the relative efficiency and running time of each individual page.

In the next blog, we would discuss about another type of fixtures available ‘FitLibrary Fixtures’.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.