RunTestsResult
A RunTestsResult object has the following properties:
Name | Type | Description |
---|---|---|
apexLogId | string |
The ID of an ApexLog object that is created at the end of a test run. The ApexLog object is created if there is an active trace flag on the user running an Apex test, or on a class or trigger being executed. This field is available in API version 35.0 and later. |
codeCoverage | CodeCoverageResult[] |
An array of one or more CodeCoverageResult objects that contains the details of the code coverage for the specified unit tests. |
codeCoverageWarnings | CodeCoverageWarning[] |
An array of one or more code coverage warnings for the test run. The results include both the total number of lines that could have been executed, as well as the number, line, and column positions of code that was not executed. |
failures | RunTestFailure[] |
An array of one or more RunTestFailure objects that contain information about the unit test failures, if there are any. |
flowCoverage | FlowCoverageResult[] | An array of results from test runs that executed flows. This field is available in API version 44.0 and later. |
flowCoverageWarnings | FlowCoverageWarning[] | An array of warnings generated by test runs that executed flows. This field is available in API version 44.0 and later. |
numFailures | int | |
numTestsRun | int | |
successes | RunTestSuccess[] |
An array of one or more RunTestSuccess objects that contain information about successes, if there are any. |
totalTime | double |
The total cumulative time spent running tests, in milliseconds. This can be helpful for performance monitoring. |
CodeCoverageResult
The RunTestsResult object contains this object. It contains information about whether or not the compile of the specified Apex and run of the unit tests was successful.
A CodeCoverageResult object has the following properties:
Name | Type | Description |
---|---|---|
dmlInfo | CodeLocation[] |
For each class or trigger tested, for each portion of code tested, this property contains the DML statement locations, the number of times the code was executed, and the total cumulative time spent in these calls. This can be helpful for performance monitoring. |
id | ID |
The ID of the CodeLocation. The ID is unique within an organization. |
locationsNotCovered | CodeLocation[] |
For each class or trigger tested, if any code is not covered, the line and column of the code not tested, and the number of times the code was executed. |
methodInfo | CodeLocation[] |
For each class or trigger tested, the method invocation locations, the number of times the code was executed, and the total cumulative time spent in these calls. This can be helpful for performance monitoring. |
name | string | |
namespace | string |
The namespace that contained the unit tests, if one is specified. |
numLocations | int | |
numLocationsNotCovered | int |
The number of code locations not covered by any class or trigger. |
soqlInfo | CodeLocation[] |
For each class or trigger tested, the location of SOQL statements in the code, the number of times this code was executed, and the total cumulative time spent in these calls. This can be helpful for performance monitoring. |
soslInfo | CodeLocation[] |
For each class tested, the location of SOSL statements in the code, the number of times this code was executed, and the total cumulative time spent in these calls. This can be helpful for performance monitoring. |
type | string |
Do not use. In early, unsupported releases, used to specify class or package. |
CodeCoverageWarning
The RunTestsResult object contains this object. It contains information about the Apex class which generated warnings.
RunTestFailure
The RunTestsResult object returns information about failures during the unit test run.
This object has the following properties:
FlowCoverageResult
This object contains information about the flow version and the number of elements executed by the test run. This object is available in API version 44.0 and later.
FlowCoverageWarning
This object contains information about the flow version that generated warnings. This object is available in API version 44.0 and later.
RunTestSuccess
The RunTestsResult object returns information about successes during the unit test run.
This object has the following properties:
CodeLocation
The RunTestsResult object contains this object in a number of fields.