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.

This API requires the Agent token.


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-sessions

Request details

Request body

Parameter
Description
Default value
Is mandatory?

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

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

Parameter
Description
Is mandatory?

testSessionId

Test Session ID

Mandatory

type

enum:

  • name - Default type if not specific.

  • externalId

Request/Response Samples

Request

Response

Sample Shell command and response

Get Exclude Tests v2

Getting a list of tests that should be excluded

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 can be called several times during a session to report tests in bulk.

Request details

Request parameters

Parameter
Description
Is mandatory?

testSessionId

Test Session ID

Mandatory

Request Body

Parameter
Description
Is mandatory?

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

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

Parameter
Description
Is mandatory?

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.

Request details

Request parameters

Parameter
Description
Is mandatory?

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

Parameter
Description
Is mandatory?

enable

Boolean indicator, indicates if next run will be full run or not

Mandatory

Request Samples

Sample Shell command and response

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

Parameter
Description
Is mandatory?

appName

App name

Mandatory

branchName

Branch name

Mandatory

testStage

Test Stage name

Mandatory

Optional parameters
Parameter
Description
Is 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/Response Samples

Request

Response

Sample Shell command and response:

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

Parameter
Description
Is mandatory?

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 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

Parameter
Description
Is mandatory?

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

Parameter
Description
Is mandatory?

bsid

Build session Id

Mandatory

labId

Lab Id

Mandatory

testStage

Test Stage

status

enum:

  • created

  • pendingDelete / deleting

  • ended

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

Parameter
Description
Is mandatory?

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

Parameter
Description
Is mandatory?

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

Parameter
Description
Is mandatory?

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

Get a list of previous builds that the TIA can re-calculate against them

Request details

Request parameters

Parameter
Description
Is mandatory?

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

This specific API is in beta mode. Please contact your Customer Success representative for details.

Re-calculation of recommendations to specific build and test stage

Request details

Parameter
Description
Is mandatory?

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

Parameter
Description
Is mandatory?

appName

App Name

Mandatory

branchName

Branch Name

Mandatory

testStage

Test Stage name

Mandatory

Request body

Parameter
Description
Default value
Is mandatory?

testSelectionStatus

Enable/Disable TIA

Mandatory

Request Samples

Sample Shell command and response

Last updated

Was this helpful?