Add/Edit Condition Dialog

The Add/Edit Condition dialog allows test list conditions to be added or edited. Conditions are evaluated at runtime to determine whether the test groups or functions they contain should be run or not.

The Add/Edit condition dialog is launched from the XJRunner Tests pane of the XJRunner Setup screen

Edit Condition Dialog

The Name field is where a name should be given for the condition. The name appears in the test list to identify the condition but has no other significance. It can contain any characters, including spaces.

The rest of the dialog is a field where the XJEase expression can be entered. Whitespace is unimportant in XJEase so the expression can be formatted as you wish, even over multiple lines. The expression can be any valid XJEase expression that evaluates to an integer, and can contain but is not limited to:

  • Literal values, e.g. 42, 0xFF.
  • Constants and global variables in the project, e.g. VARIANT_NAME
  • Built-in functions, e.g. HAS_RUN, HAS_PASSED, MESSAGEBOX
  • Arithmetic operators.
  • Logical operators, e.g. &&?, &&.
  • Function calls.

The dialog has support for inserting two of the most common types of expression:

Insert Global
Inserts the name of a global variable from the project into the expression.
Insert Test Function
Opens a dialog to select a test function from the test list and create an expression that incorporates it. See the following description.

Add Function Condition

This dialog allows expressions incorporating test functions to be easily inserted.

Add Function Condition Dialog

Select a test function from the list and then select one of the expression types at the bottom:

Ran
Creates an expression that queries whether the function has been run, e.g. HAS_RUN("Test").
Fail
Creates an expression that queries whether the function failed, e.g. !HAS_PASSED("Test").
Pass
Creates an expression that queries whether the function passed, e.g. HAS_PASSED("Test").
Return value is Equal to
Creates an expression that queries whether the return value of the function is equal to a specific value.
The inserted expression is of the form RESULTOF("Test") = 42.
Return value is Not equal to
Creates an expression that queries whether the return value of the function is not equal to a specific value.
The inserted expression is of the form RESULTOF("Test") != 42.
Return value is Greater than
Creates an expression that queries whether the return value of the function is greater than a specific value.
The inserted expression is of the form RESULTOF("Test") > 42.
Return value is Less than
Creates an expression that queries whether the return value of the function is less than a specific value.
The inserted expression is of the form RESULTOF("Test") < 42.
Return value is One of the values
Creates an expression that queries whether the return value of the function is one of a list of possible values. Possible values should be separated by commas.
The inserted expression is of the form (RESULTOF("Test") = 1 || RESULTOF("Test") = 2 || ...).
Return value is Not one of the values
Creates an expression that queries whether the return value of the function is not one of a list of possible values. The values should be separated by commas.
The inserted expression is of the form (RESULTOF("Test") != 1 && RESULTOF("Test") != 2 && ...).
Return value is Between
Creates an expression that queries whether the return value of the function is between two values.
The inserted expression is of the form (RESULTOF("Test") > 5 && RESULTOF("Test") < 10).
Return value is Not between
Creates an expression that queries whether the return value of the function is not between two values.
The inserted expression is of the form (RESULTOF("Test") < 5 || RESULTOF("Test") > 10).

See Also