Test Sessions API (a.k.a TIA API)
You can integrate any Testing framework with Sealights to capture Tests Events like Start and End of Test Stage, Tests results, etc using the API described on this page. This API includes getting the list of tests recommended to be skipped by Sealights for Test Optimization (TIA) and forcing a Full-Run on the next execution of a Test Stage.
For your reference, you’ll find a few sample integrations with various Testing frameworks listed on Integrating Test Executions from various Testing Frameworks.
Creating Test Session
Create a test session with a specific Labid and test stage, if there is no labId - use BSId instead
Calling this request to create a new test session for the current run
POST /sl-api/v1/test-sessionsRequest details
Request body
labId
Lab Id
Mandatory
testStage
Test Stage
Mandatory
bsid
Build Session Id
sessionTimeout
Session Timeout (seconds), max timeout 86400 (24 hours)
14,400 (4 hours)
testGroupId
Test group id
Request Samples
Response Sample
Sample Shell command and response
Get Exclude Tests v1 (deprecated)
Getting a list of tests that should be excluded
Test Optimization must be turned on for the Test Stage in order to receive a non-empty response.
Calling this request to get a list of test names that should be excluded in the current run (by default with test names)
You can specify to get only the External Tests IDs (instead of Test Names) to be returned in the response
Request details
Request parameters
testSessionId
Test Session ID
Mandatory
type
enum:
name- Default type if not specific.externalId
Request/Response Samples
Request
Response
Request
Response
Sample Shell command and response
Get Exclude Tests v2
Getting a list of tests that should be excluded
Test Optimization must be turned on for the Test Stage in order to receive a non-empty response.
Calling this request to get a list of test names that should be excluded in the current run (by default with test names)
Request details
Request parameters
Parameter
Description
Is mandatory?
testSessionId
Test Session ID
Mandatory
Request/Response Samples
Request
Response
Sample Shell command and response
Sending Test Events
Sending test events with status
Calling this request for reporting SeaLights test event result.
This API must be called before closing/deleting the session.
Please notice this specific endpoint uses a
v2URL
Request details
Request parameters
testSessionId
Test Session ID
Mandatory
Request Body
The tests skipped per the recommendation (GetExcluded Tests API above) must be explicitly included in the results of the test sent to Sealights (with the status
skipped)Skipped tests must be provided with start and end parameters, as well. We recommend providing them with
start = end = now()value.
body
Array of Test run events (even for a single test)
Mandatory
Test run event
name
Test Name
Mandatory
externalId
(Optional) Test ID from the Test Management platform/framework . This identifier must be Unique and a string long up to 48 characters.
start
Starting time of the test (milliseconds since epoch)
Mandatory
end
Ending time of the test (milliseconds since epoch)
Mandatory
status
Test status: passed, failed or skipped
Mandatory
In case of Invalid parameters, API will return an Error code 400 INVALID. For example, if the timestamps are not sent in milliseconds format, API will return with code 400 and a message Invalid timestamp
Request Samples
Sample Shell command and response
Delete Test Session
Delete test session when sending of test events has been done.
Calling this request will close the test session and update the coverage.
Request details
Request parameters
testSessionId
Test Session ID
Mandatory
Request Samples
Sample Shell command and response
Force “Full-Run” on a Test Stage
This request will schedule a “full run” for the subsequent execution of a specified Test Stage.
This API call should be executed BEFORE creating the test session.
Request details
Request parameters
appName
App to schedule full run for
Mandatory
branchName
Branch to schedule full run for
Mandatory
testStage
Test Stage to schedule full run for
Mandatory
Request Body
enable
Boolean indicator, indicates if next run will be full run or not
Mandatory
Request Samples
Sample Shell command and response
Get Recommended Tests (White List)
This API call does not require a test session.
Get Recommended Tests for the latest build from a specific app/branch
Get recommendations for the latest build for a specific app/branch: it returns a list of test names recommended to be run.
Request details
Request parameters
appName
App name
Mandatory
branchName
Branch name
Mandatory
testStage
Test Stage name
Mandatory
Request/Response Samples
Request
Response
Sample Shell command and response:
Get Recommended Tests by BSID and Test-Stage
Get recommendations for a specific build according to buildSessionId: it will return a list of test names that are recommended to be run for the given build.
Request details
Request parameters
bsId
Build session Id
Mandatory
testStage
Test Stage name
Mandatory
offset
Result offset - used for pagination
limit
Result limit - used for pagination (max limit 100,000 records)
search
Free text to filter the recommednations by
sortBy
Sort recommnedations bym options are:
testName
sortDirection
Sort recommendations direction, options are:
asc
desc
facet
Saved filters according to recommendations` types, options are:
all (default)
impacted
dependent
recentlyFailed
previouslyRecommendedAndNotExecuted
pinned
other
Request Samples
Response Sample
Sample Shell command and response:
Get Recommended Tests by app name, branch name, build name and Test Stage
Get recommendations for a specific build according to app/branch/build-name.
Calling this request for getting a list of test names that are recommended to be run for the given build.
Request details
Request parameters
appName
App name
Mandatory
branchName
Branch name
Mandatory
buildName
Build name
Mandatory
testStage
Test Stage name
Mandatory
offset
Result offset - used for pagination
limit
Result limit - used for pagination (max limit 100,000 records)
search
Free text to filter the recommednations by
sortBy
Sort recommnedations bym options are:
testName
sortDirection
Sort recommendations direction, options are:
asc
desc
facet
Saved filters according to recommendations` types, options are:
all (default)
impacted
dependent
recentlyFailed
previouslyRecommendedAndNotExecuted
pinned
other
Request Samples
Response Sample
Sample Shell command and response:
Get Executions Status List
Calling this request will respond with a status of all executions that are suitable for the request.
This API provides you the ability to handle unexpected end of the execution of your tests that may not trigger the graceful closure of the test session to Sealights (via delete Session API call). If the Timeout set at the creation of the execution is not sufficient to ensure automatic closure, you can use this API to list the executions left open and close them one by one gracefully before opening new sessions.
Request details
Request parameters
You must provide LabId or/and BuildSessionID (bsid)
bsid
Build session Id
Mandatory
labId
Lab Id
Mandatory
testStage
Test Stage
status
enum:
createdpendingDelete/deletingended
Request Samples
Response Sample
Sample Shell command and response:
Get Test Runs
Get Test Runs by buildSessionId and Test-Stage
Get test runs for a specific build according to the build session ID and test stage.
Request details
Request parameters
bsId
Build session Id
Mandatory
testStage
Test Stage name
Mandatory
testGroupId
Id of the test group
offset
Result offset - used for pagination
limit
Result limit - used for pagination (max limit 100,000 records)
Request Samples
Response Sample
Sample Shell command and response:
Get Test Runs by app name, branch name, build name and Test Stage
Get test runs for a specific build according to the app name, branch name, build name and test stage.
Request details
Request parameters
appName
App Name
Mandatory
branchName
Branch Name
Mandatory
buildName
Build Name
Mandatory
testStage
Test Stage name
Mandatory
testGroupId
Id of the test group
offset
Result offset - used for pagination
limit
Result limit - used for pagination (max limit 100,000 records)
Request Samples
Response Sample
Sample Shell command and response:
Get Test Runs by latest build on app name, branch name and Test Stage
Get test runs for a specific build according to the app name, branch name, build name and test stage.
Request details
Request parameters
appName
App Name
Mandatory
branchName
Branch Name
Mandatory
testStage
Test Stage name
Mandatory
testGroupId
Id of the test group
offset
Result offset - used for pagination
limit
Result limit - used for pagination (max limit 100,000 records)
Request Samples
Response Sample
Sample Shell command and response:
Recalculation
Get Previous Build to Recalculate
This specific API is in beta mode. Please contact your Customer Success representative for details.
Get a list of previous builds that the TIA can re-calculate against them
Request details
Request parameters
bsId
Build Session Id
Mandatory
testStage
Test stage name
Mandatory
offset
Result offset - Used for pagination
limit
Result limit - Used for pagination (max limit 100,000 records)
branchName
Limit query to a specific branch
Request Sample
Response Sample
Sample Shell command and response:
Re-calculate Recommendations Based on Baseline BuildSessionId
Re-calculation of recommendations to specific build and test stage
Request details
bsId
Build Session Id
Mandatory
testStage
Test stage name
Mandatory
baselineBsId
Build Session ID against which to recalculate
Mandatory
Request Sample
Response Sample
Sample Shell Command and Response:
Enable/Disable TIA
Enable/Disable TIA for a given app/branch
Request details
Request parameters
appName
App Name
Mandatory
branchName
Branch Name
Mandatory
testStage
Test Stage name
Mandatory
Request body
testSelectionStatus
Enable/Disable TIA
Mandatory
Request Samples
Sample Shell command and response
Last updated
Was this helpful?

