2

I want to run the same test with different parameters, like @Parameterized.Parameters in junit. Does fitnesse have ability to do this?

2 Answers2

1

Absolutely--that is probably the fundamental capability of FitNesse. Consider the basic test table in FitNesse:

!|Evaluate Inputs          |
|Param1|Param2|Calculation?|
|0     |1     |1           |
  • The first row identifies the method under test--in this case EvaluateInputs.
  • The second row names the inputs and outputs. Outputs are distinguished by the presence of a question mark (?) suffix. Thus, this method has two inputs (Param1 and Param2) and one output (Calculation).
  • The third row specifies the inputs to the test and the expected outcome: in pseudo-code this case yields EvaluateInputs( 0, 1 ) => 1.

To test other combinations of valid inputs for this method, just add additional rows to the test table:

!|Evaluate Inputs          |
|Param1|Param2|Calculation?|
|0     |1     |1           |
|1     |0     |1           |
|0     |0     |0           |
|1     |1     |0           |

(For more examples, see the first section of part 6 of my series of articles Acceptance Testing with FitNesse published on Simple-Talk.com.)

Michael Sorens
  • 35,361
  • 26
  • 116
  • 172
1

I know this , however I don't how to use it in my case.I want to run my tests three times using different "NetworkManager" each time, which is created in "Create NetworkManager with connector type JSON"

!define groupAdminName {ALEX_ADMIN}

!|Script|com.playtech.openapi.core.fitnesse.tests.NetworkManagerSetUp|
|Create NetworkManager with connector type JSON                      |
|Create NetworkManager with connector type PROTOBUF                  |
|Create NetworkManager with connector type PROTOSTUFF                |


!2 1)Create member which will be admin of the group
!| Script|com.playtech.openapi.core.fitnesse.tests.Fixtures|
|Create context                                            |
|Create member with name ${groupAdminName}