The Start Rule Tests (All) Smart Service executes the test cases configured for all expression rules within an Appian system. To limit the testing to specific applications, see Start Rule Tests (Applications).
For additional context on how this smart service can be used to perform automated testing, see Automated Testing for Expression Rules.
Activating this smart service in the process model starts an asynchronous test run of all test cases within Appian, and immediately returns a test-run ID that can be used with the a!testRunResultForId() function to retrieve the results when the test run is finished. To check on the status of a test run, use the test-run ID with the a!testRunStatusForId() function.
The screenshot below shows a simple workflow that starts a test run, then periodically checks on the status of the test run until the test is completed. The script task, Get Test Status, which calls the a!testRunStatusForId() function, starts on a scheduled delay of 1 minute. If the test status is not
COMPLETE, the process model loops back to the Get Test Status script task, until the status is
COMPLETE. At this point, the results of the test are retrieved by the Get Test Results script task, by calling the a!testRunResultForId() function.
To learn more about reading test results, see Parsing Batch Test Results for Expression Rules.
The Start Rule Tests (All) smart service only executes the tests for the expression rules to which the user has at least viewer rights.
When initiating this smart service from a process model, you can adjust the user context used to run the smart service from the Assignment tab. See Assignments for more information.
Getting test status or test results via a!testRunStatusForId() or a!testRunResultForId() can only be performed by the user who initiated the test. In addition, users of type administrator can fetch test results for all users.
|Test-run ID||Number (Integer)||This unique id can be used by the a!testRunStatusForId() and the a!testRunResultForId() functions.|
See also: Number (Integer)
Executes test cases configured for all expression rules within an Appian system from web APIs and SAIL Interfaces
a!startRuleTestsAll( onSuccess, onError)
a!httpResponse(). The test-run ID of the executed test run is available in the function variable
fv!testRunId. This can be used to query information about the test run with a!testRunStatusForId() and a!testRunResultForId().
This example shows a web API returning a test-run ID for a test run of all expression rules in a system.
Copy and paste an example into the Expression View of the Interface Designer to see how this works.