Testing
Durting the execution of a template there are two different types of testing that can be done, the first are Checks, a check can be run during a flow execution on a specific flow, the second are Tests, a test can be run at the end of the flow execution to tests if the flow itself was completed successfully or not.
Both checks and testing are configured by setting an Operations, a check operation can be set only on specific seuquence context (last response message, state transition metrics) a test operation can be set only on global metrics (total/successfull/failure/timeout messages metrics).
Operations
Operations can be run during a flow execution as a check, or once a flow execution completes as a test.
There are 5 different available operations:
isEquals
isNotEquals
isLess
isGreater
isEmpty
isNotEmpty
isIn
isNotIn
isPercentOf
Formats
isEquals, isNotEquals, isLess, isGreater, isEmpty, isNotEmpty - operation({{parameter}}, value)
For example, if we want to check that a {{number}} is equals to 5 =>
isEquals({{number}}, 5)
isIn, isNotIn - operation({{parameter}}, ["item1", "item2"])
For example, if we want to check that {{parameter}} is in the following list "hello", "world" => isIn({{parameter}}, ["hello", "world"])
isPercentOf - isPercentOf({{parameter}}, percent-to-test, >/<, value)
For example, if we want to check if a {{number}} is greater than 40% out of 500 =>
isPercentOf({{number}}, 500, >, 40)
Checks
Checks validate conditions in your flow during its execution. Testers often use checks to validate that the system is responsding with the expected content. For example, a check could validate that the NGSetupResponse outcome is successful isEquals({{res.NGAPOutcome}},success}
Checks are similar to what many testing frameworks call an assert, but failed checks do not cause the test to abort or finish with a failed status by default, but can be configured to do so. Failed check are tracked and kept as part of the full report with exact context details.
Check are configured as follows:
operations - a List of Operations to be execute as part of the check
Available fields to check
Tests
A tests validate the end of execution of a flow. Testers often use tests to validate that the entire flow was exectued as expected. For example, a test to make sure that all flows within an execution were executed successfully without errors/timeouts.
Tests are configured as follows:
name - name of the test, which than is outputed as part of the report
operations - a List of Operations to be executed as part of the test
Available fields to tests
Last updated
Was this helpful?