Formatting Cheat Sheet in Fitnesse

In this tutorial, we are going learn about FitNesse tool cheat codes which helps in setting up various FitNesse system properties. Given below is the classification of such cheat codes.

FitNesse Command Line:

We run the FitNesse standalone server jar file at the command line. Given below is the syntax for that and it works with the various options. In the table, those options are described in detail.

Syntax to run FitNesse server:

[Path/to/java/] java [-Dfile.encoding=UTF-8] -cp fitnesse.jar [; other.jar.or.path]... fitnesse.FitNesse [-o] [-p port#] [-d /path/to/fitnesse/root] [-r NameOfRootPage] [-e days] [-l /log/file/path/and/name] [-a {username: password | /auth/file/path/and/name}] [other arguments]
Sr. No. Option Default Description
1. -a username:password no auth This option enforces access for one user only.
2. -a /auth/file/path/and/name no auth This option enforces access for a file of users with encrypted passwords only.
3. -d /path/to/fitnesse/root . It is the path to the fitnesse wiki home where FitNesseRoot or -r name resides.
4. -e days 14 These are the number of days to retain older versions (.zip files). These are backup files.
5. -l /log/file/path/and/name off It indicates FitNesse server where to put and what to call the run log.
6. -o update This option prevents (omits) updating FitNesseRoot content.
7. -p port# 80 It is the port number for FitNesse to listen on that port.
8. -r NameOfRootPage FitNesseRoot This option helps in setting up the name of root folder in the fitnesse wiki home or -d path.
9. [-Dfile.encoding=UTF-8] off This option provides the Unicode characters support in Test History Page.
Cheat Sheet In Fitnesse

Character Formatting:

These are the formatting cheat that are present in the FitNesse tool. These can be used on the FitNesse page (static, test and suite) to format the headings and text on the page. All such codes are described below in detail with example.

Sr. No. Function Cheat Code Description
1. Comment #text It can also be used to comment-out markup on the page.
2. Italics ”text” Any text between these codes will look as Italics on the page.
3. Bold ”’text”’ Any text between these codes will look as bold on the page.
4. Style !style_(text) The style of text will be the CSS class <someStyle> on the page.
5. Strike-through –text– Any text between these codes will look as strike-through on the page.
6. “As-is”/escaping !-text-! It can also be used to insert HTML tags directly on the page.
7. “As-is” !<text>! It will escape HTML tags so that they can be displayed in the plain text on the page.
8. Alias Link text  

Example:

Fitnesse Cheat Sheet Demo 1

After we click on the save button, we can see the effect of using the cheat codes on the FitNesse page (here it is a static page).

Fitnesse Cheat Sheet Demo 2

Line & Block Formatting:

These are the Line and block formatting cheat codes that are present in the FitNesse tool. These can be used on the FitNesse page (static, test and suite) to format the line and block on the page. All such codes are described below in detail with example.

Sr. No. Function Syntax Description
1. workflow break —- …  This is used for separate the phases on the FitNesse page.
2. Horizontal Line 1. over-text—-under-text 2. over-text—–under-text 3. over-text———under-text Thinnest line between over-text and under-text.safest – no conflict with workflow phase separatorsGrows thicker between over-text and under-text as the number of dashes increase.
3. Note !note text  Taken as note on page in a format as shown below in example.
4. Headings !1 largest heading text !2 middle heading text !3 smaller heading text and so on up to !6 Heading on the page can be specified with their sizes from largest (!1) to the smallest (!6) as shown below in example.
5. Centered !c text It is used to keep the text at centre on page.
6. Formatted “as is” {{{text}}} The FitNesse test script between these opening and closing curly braces simply does not get executed when such test page is executed to run.
7. Collapsible !* [title]  multi-line wiki text  N.B.: Multiple asterisks are allowed, e.g., !**** text *! Expanded.
    !*> [title]  multi-line wiki text  N.B.: Multiple asterisks are allowed, e.g., !****> text *! Collapsed.
    !*< [title]  multi-line wiki text  N.B.: Multiple asterisks are allowed, e.g., !****< text *! Invisible. It is useful for hiding definitions, etc.

Examples:

Fitnesse Cheat Sheet Demo 3

After we click on the save button, we can see the effect of using the cheat codes on the FitNesse page (here it is a static page).

Fitnesse Cheat Sheet Demo 4
Fitnesse Cheat Sheet Demo 5

After we click on the save button, we can see the effect of using the cheat codes on the FitNesse page (here it is a static page).

Fitnesse Cheat Sheet Demo 6

Links & References:

Below are the links and references permitted in FitNesse.

Sr. No. Name Links and References Description
1. Page links .RootPage[.ChildPage] This is reference from root.
2. Page links SameLevelPage[.ChildPage] This is sibling.
3. Page links >ChildPage[.ChildPage] This is child or symbolic.
4. Page links [[AnyPagePath]] It is an alias.
5. Cross-reference & Suite Include !see AnyPagePath We can see any page path during cross reference across suites.
6. Define “in-page” label !anchor label-name Label name.
7. Jump to “in-page” label text #label-name text .#label-name [[#label-name]] In-line.Left-justified.In an alias.
8. External Links http://url-path http://files/localPath [[/files/localPath]] [[AnyPagePath#label-name]] text@text.text Web External link.Local path external link.Alias.Aliasmailto email.

Includes & Informational

Variable Usage:

Below table explains the syntax that can be used to define a variable, use a variable and evaluate an expression in FitNesse tool.

Sr. No. Function Syntax
1. Variable Definition !define name {value}
!define name (value)
!define name [value]
2.Variable Usage${name}
3.Expression Evaluation${=expression=} expression may contain variables

Global Variables:

Below are the list of Global variables present in FitNesse.

Sr. No. NAME Java Default FitLibrary (Unix) Default .NET Default
1.  COMMAND_PATTERN java -cp %p %m java -cp %p %m %m %p
2.  REMOTE_DEBUG_COMMAND REMOTE DEBUG COMMAND, or java -Xdebug -Xrunjdwp: transport=dt_socket, server=y, suspend=y, address=8000 -cp %p %m java -Xdebug -Xrunjdwp: transport=dt_socket, server=y, suspend=y, address=8000 -cp %p %m java -Xdebug -Xrunjdwp: transport=dt_socket, server=y, suspend=y, address=8000 -cp %p %m
3.  PATH_SEPARATOR : (system-dependent) : (system-dependent) ;
4.  TEST_RUNNER fit.FitServer fitlibrary.suite.FitLibraryServer dotnet\FitServer.exe
5.  REMOTE_DEBUG_RUNNER TEST_RUNNER same as for java dotnet\FitServer.exe

Testable Tables:

Listed below are the short description and syntax for the testable tables.

Sr. No. Short Description Syntax
1. Prevent Wikification ! | “as is” or escaped content |
2. Classpath include (to include Java classpath for fixtures and others required components.) !path java.path.spec
3. “Insert Fixture Table” Edit List Include !fixture path.fixture
4. Fixture Table ! | fixture specification |
5. Smallest Table | text | [ | optional table row | [ optional 2nd column | ]…] [ | optional table row | [ optional 2nd column | ]…] :

Global Properties:

Below table has the global properties details for FitNesse.

Sr. No. Properties Description
1. path.separator (system-dependent)

Wiki Page Actions:

Following are the Wiki page actions that will be noticeable in the URL when that particular action is in progress in FitNesse.

Sr. No. Action Description Action URL snippet
1. To edit the current page url?edit
2. To create a new page directly current-url.NewPageName or current url.NewPageName?edit
3. To test the current page url?test
4. Suite test this page url?suite
5. To set properties of this page url?properties
6. To see versions of this page url?versions
7. To refactor this page url?refactor
8. To search pages from here url?searchForm
9. Where the current page is referenced? url?whereUsed
10. To debug the current test page url?debug
11. Suite test this page with a suite filter “passing” url?responder=suite&suiteFilter=passing
Fitnesse Tutorial For Beginners

⇓ Subscribe Us ⇓


If you are not regular reader of this website then highly recommends you to Sign up for our free email newsletter!! Sign up just providing your email address below:


 

Check email in your inbox for confirmation to get latest updates Software Testing for free.


  Happy Testing!!!
 

Leave a Comment

Share This Post