Search within testresults of a run
This API resources allows you to search a testresult within all testresults of a specific run.
Request
URL
/api/v1/default/runs/{runId}/testresults?search={search}&status={status}&sortBy={sortBy}&skip={skip}&take={take}
Example:
The following request returns ten testresults that have the status SUCCESS or FAILED, sorted by status ascending and testId descending. Additionally they should have the string “compare” anywhere within the test name./api/v1/default/runs/23/testresults?search=%23compare&status=SUCCESS,FAILED&sortBy=sortBy=asc(status),desc(testId)&skip=0&take=10
Verb
GET
URL-Parameters
Following are the parameters used in the URL or the QueryString showed by a placeholder with curly brackets. Replace the full parameter with the actual value including the curly brackets.
Parameter | Type | Description |
---|---|---|
runId | Int64 | The ID of the run whose testresults should be searched. |
search | string | The search-query to use when searching within testresults. Please ensure that the search-query should be URL-encoded when it contains special characters. Use the percentage character % as a wildcard placeholder. |
status | String | A comma separated list of the testresult status that should be filtered for. Use one or all of the following status.EXECUTING = The test is still running.SUCCESS = The testing condition was met.FAILED = The testing condition was not met.NOTEVALUATED = The test couldn’t be evaluated for any reason.DIFFERENTDIMENSIONALITY = Two or more probes had a different dimensionality whereas the testmethod required them to be of the same shape.CANCELED = The test or the whole run was cancelled.NOTENOUGHPROBES = There were not enough probes to complete the test. The amount of required probes depends on the kind of testmethod. E.g. when comparing data, the test needs at least two probes.EXCEPTION = An exception occured while running the test. |
sortBy | Int64 | A comma separated list of the attributes that should be used for sorting the result. Use the attributes that are shown in the response for sorting. Enclose these attributes in either asc(…) or desc(…) to sort define the sort-direction. E.g. sortBy=asc(status),desc(testId) means that the response is sorted by the status in ascending order and within the status by the testId in descending order. |
skip | Int32 | The amount of testresults that should be skipped in the response. |
take | Int32 | The amount of testresults that should be returned in the response. |
Header
Parameter | Description |
---|---|
Authorization | The Access-Token as explained in Authentication. |
Body
not needed
Response
{ "items": [ { "testResultId": 11319, "testId": 3, "testName": "10.4 - KPI Comparison", "testDescription": "Queries multiple KPI's (aggregates from the sales-tables) and compares them between the DWH and the ERP.", "methodId": "fc008ca3-30d6-4c45-89fd-46a4292de98c", "methodUniqueName": "ExactEqual", "status": "FAILED", "message": "The test failed because the probe values are not equal.", "messageId": 103, "hasPayloadXml": false, "executionSequence": 0, "createdAt": "2020-07-06T09:13:26.713308" } ], "skip": 0, "take": 100, "total": 12, "filteredTotal": 2, "status": "OK" }
Element | Type | Description |
---|---|---|
status | String | Returns the status of the API request. OK means that the request could be completed successfully. |
filteredTotal | Int64 | The total amount of testresults respecting the search-query. |
skip | Int32 | The amount of testresults that were skipped to present the response. |
take | Int32 | The amount of testresults that were returned in the result. |
total | Int64 | The total amount of testresults *not* respecting the search-query. |
The items-Array contains as many testresult-elements as requested by the take-parameter. Each element has the following attributes.
Element | Type | Description |
---|---|---|
testResultId | Int64 | The ID of the testresult. |
testId | Int64 | The ID of the test. |
testName | String | The name of the test. |
testDescription | String | The description of the test. |
methodId | String | The ID (=GUID) of the testmethod used within the test. |
methodUniqueName | String | The unique name of the testmethod used within the test. |
status | String | The status of the test. Usually the outcome of the test. EXECUTING = The test is still running. SUCCESS = The testing condition was met. FAILED = The testing condition was not met. NOTEVALUATED = The test couldn’t be evaluated for any reason. DIFFERENTDIMENSIONALITY = Two or more probes had a different dimensionality whereas the testmethod required them to be of the same shape. CANCELED = The test or the whole run was cancelled. NOTENOUGHPROBES = There were not enough probes to complete the test. The amount of required probes depends on the kind of testmethod. E.g. when comparing data, the test needs at least two probes. EXCEPTION = An exception occured while running the test. |
message | String | Depending on the testmethod, there could be a message attached to the testresult. This is the message itself if available. |
messageId | Int64 | Depending on the testmethod, there could be a message attached to the testresult. This is the ID of the message if available. |
exception | String | When an exception occured while running the test, the exception-message is available in this attribute. |
comment | String | When a comment was added to the testresult (see scripting), it appears in this attribute. |
hasPayloadXml | Boolean | This attribute is “true” when the testresult has some payload attached. A payload could be a document with additional information. |
executionSequence | Int32 | When a test runs multiple times during the same run, there is a sequence number, that defines the order of the testresults regarding the test. |
createdAt | DateTime | The point in time when the testresult was recorded. |
Example: PowerShell
The following example shows a way to query testresults of a specific run for a string in the tests names. So all testresults that contain “compar” in their name will be printed to the console.
# The base-url of the BiG EVAL API and instance. $bigevalUrl = "https://mybigevalserver/" $baseUrl = $bigevalUrl+"api/v1/default/" # Note that you need to request the AccessToken first. We do not show that in this example. $accessToken = "123123123" # Query all testresults of the run 123123 that contain "compare" in the tests name. $runResults = Invoke-RestMethod -Uri ($baseUrl + "runs/123123/testresults?search=%23compare&status=SUCCESS,FAILED,EXECUTING,NOTEVALUATED,DIFFERENTDIMENSIONALITY,CANCELED,NOTENOUGHPROBES,EXCEPTION&sortBy=&skip=0&take=10") -Headers @{"Authorization"="Bearer $accessToken"} # Write all test-results (could be multiple) to the console $runResults.items | ForEach-Object { Write-Host Write-Host ("Test-ID: " + $_.testId) Write-Host ("Test-Name: " + $_.testName) Write-Host ("Test-Status: " + $_.status) }