Azure DevOps

 + Endtest

You can use the Endtest API and a Shell Script task in order to integrate Endtest with Azure DevOps.

YAML snippet

- task: ShellScript@2
    #args: '' # Optional
    #disableAutoCwd: false # Optional
    #cwd: '' # Optional
    #failOnStandardError: false

Create at the root of your repo. We recommend creating this file from a Linux environment (such as a real Linux machine or Windows Subsystem for Linux) so that line endings are correct. Also, don't forget to chmod +x before you commit it.

hash=$(curl -X GET --header "Accept: */*" "${3}")
for run in {1.."${4}"}
  sleep 30
  result=$(curl -X GET --header "Accept: */*" "${1}&appCode=${2}&hash=${hash}&format=json")
  if [ "$result" == "Test is still running." ]
    # Don't print anything
  elif [ "$result" == "Processing video recording." ]
    # Don't print anything
  elif [ "$result" == "Stopping." ]
  elif [ "$result" == "Erred." ]
    echo $status
  elif [ "$result" == "" ]
    # Don't print anything
     echo "$result" | jq
     exit 0

This sample script would require the following arguments:

  1. The App ID for your account.
  2. The App Code for your account.
  3. The API Request for starting the test execution.
  4. The number of times the API request for fetching the results will be sent once every 30 seconds.

For example, if you know that your test execution usually takes 3 minutes, you should use the value 7.

7 x 30 seconds = 210 seconds > 3 minutes

Don't forget to make your Shell script executable by running the following command:

sudo chmod +x

And you would also need to install the jq package:

sudo apt-get install jq

The command for running the sample Shell script would have the following format:

./ app-id app-code api-request-to-start-test-execution number-of-loops

Let's pretend we have the following values:

App ID = 44233559

App Code = 22381137

Endtest API Request to start test execution = ""

Number of loops = 10

The command for running the sample Shell script would look like this:

./ 44233559 22381137 "" 10

The JSON with the results contains the following keys:

  • test_suite_name {string} - The name of the test suite.
  • configuration {string} - The configuration of the machine or mobile device on which the test was executed.
  • test_cases {int32} - The number of test cases.
  • passed {int32} - The number of assertions that have passed.
  • failed {int32} - The number of assertions that have failed.
  • errors {int32} - The number of errors that have been encountered.
  • start_time {timestamp} - The timestamp for the start of the test execution.
  • end_time {timestamp} - The timestamp for the end of the test execution.
  • detailed_logs {string} - The detailed logs for the test execution.
  • screenshots_and_video {string} - The URLs for the screenshots and the video recording of the test execution.

You can also use the value of the hash variable to generate the link to the Results page for that test execution:


More details about our API are available in the Endtest API chapter.