Expect

When you make a test, you may of course have different expectations to the result of your test. This could for example be that you expect a numeric or a boolean value from a variable, a device, an instrument or a switch.

In SeqZap you will find the two steps Expect Boolean and Expect Numeric, which expect respectively a boolean and a numeric value.

1 Right-click on the line in your procedure where you wish to insert an expectation step and select for example the command Insert Step ( Expect Boolean in the shortcut menu.

The above is an example of a very simple test expectation in the document window.

2 Type the properties for your expectation in the properties window as shown in the figure below.

In the very simple example shown, it is tested whether 1 equals 1, which is hopefully the case. We also expect that the result of the expression 1==1 equals TRUE which means that the test is going well and that the procedure would respond with a FAIL if this was not the case.

TIP Notice that you in SeqZap, as in other high-level languages ​​such as C++ and C#, type two equals signs to make a comparison and that a single equals sign is used to assign a value to for example a variable.

An example of a very simple test expectation in the properties window.

3 Double-click on the procedure header to run the procedure.

The result of the test is shown, among other places, in the execution log – in the above example the test was carried out as expected.

As you can see on the tab Execution Log the test result matched our expectations and therefore the test gives the result PASS. This is visible both in the actual execution log and because a green bar is shown with the text Pass in the window Execution State and in the status line in SeqZap.

4 Now try to change the expression to 1==2 in the properties window and execute your procedure again.

Since 1 does not equal 2, the test should fail, which you can also see in the three before mentioned places i.e. the execution log, the Execution State window and in the status line where the green bar is now replaced by a red one.

The result of the test is, among other places, shown in the execution log – here the result was as expected.

If you have several expectations in the same procedure, the procedure will fail if just one of these expectations is not met.

Two different expectations in the same procedure.

5 Try for example to insert an expression of expectations as shown in the figure above and run your procedure after that.

Regardless of the order of the above steps, the procedure as a whole will fail since there has been at least one FAIL result along the way.

TIP Mark a line and press Alt+Up or Alt+Down, if you wish to move the current line up or down in your procedure to change the order of the lines in the procedure.

NOTE You can also use the step Set Verdict to directly indicate one of test results Inconclusive, Fail or Error.

Leaving out selected lines and procedures

Sometimes it can be an advantage if you - usually temporarily - can leave out one or more lines from your procedures or even the entire procedure from your script files. Instead of deleting the line or the procedure and then retyping it later, you can exclude it from being executed.

This can be done in the following way:

1 Right-click on the line or in the procedure header for the procedure that you wish to exclude (if you want to exclude multiple lines, you must first select them and then right-click on one of the selected lines).

Excluding a line from running in a procedure.

2 Select the command Exclude or Exclude Procedure to exclude one or more lines or a procedure in your script file from being run.

Notice that the excluded lines and procedures are displayed with a grey background, just as you will see a checkmark next to the command Exclude or Exclude Procedure in the shortcut menu.

3 Right-click on a line or a procedure header, and select the command Exclude or Exclude Procedure again to reactivate one or more lines or a procedure so that it again is included in the execution of your script file.