API Examples

All android tests

As part of your build pipeline you can execute the following cURL command to execute all tests on the latest android build:

curl -X POST https://api.mobileboost.io/tests/execute \
-H "Content-Type: application/json" \
-d '{
    	"organisationId": "org123",
    	"platform": "android"
    }'

Specific tests on a specific build

As part of your build pipeline you can execute the following cURL command to execute specific tests on a specific build file:

curl -X POST https://api.mobileboost.io/tests/execute \
-H "Content-Type: application/json" \
-d '{
      "organisationId": "org123",
      "uploadId": "upl123",
      "testIds": [
        "<TEST_ID>",
        "<TEST_ID>",
        ...
      ]
    }'

All critical tests on android

To initiate test executions for tests that are tagged with specific words, such as "critical" for high-priority test cases, you can include the tags array in your POST request body. Here is an example of how to trigger tests for the latest Android build that have been marked with the "critical" tag:

curl -X POST https://api.mobileboost.io/tests/execute \
-H "Content-Type: application/json" \
-d '{
      "organisationId": "org123",
      "platform": "android",
      "tags": [
        "critical"
      ]
    }'

The list of tags will execute all tests which have at least one of the provided tags. In case you would like to only trigger tests which have all of the provided tags you can use tagsQuery which accepts a string in the form of "AND(..., ...)". This will execute only tests which have all of the provided tags. The following example will execute tests with both "critical" and "ios" tags.

curl -X POST https://api.mobileboost.io/tests/execute \
-H "Content-Type: application/json" \
-d '{
      "organisationId": "org123",
      "platform": "android",
      "tagsQuery": "AND(critical, ios)"
    }'

Specific device configurations

To overwrite device configurations from your account, you can specify the device configurations directly in the payload. Here is an example of how to trigger tests for the latest Android build that have been marked with the "critical" tag on a Pixel8 device configuration:

curl -X POST https://api.mobileboost.io/tests/execute \
-H "Content-Type: application/json" \
-d '{
      "organisationId": "org123",
      "platform": "android",
      "tags": [
        "critical"
      ],
      "deviceConfigs": [
        {
          "device": "pixel8",
          "osVersion": "14.0",
          "locale": "en_US"
        }
      ]
    }'

You can provide multiple device configurations on which you would like to run the critical tests on.

Specific test input values

To provide test input values, you can specify the values directly in the payload. Here is an example of how to trigger tests for the latest Android build that have been marked with the "critical" on a Pixel8 device configuration with a test input value for "email" inside the test id "testid123".

curl -X POST https://api.mobileboost.io/tests/execute \
-H "Content-Type: application/json" \
-d '{
      "organisationId": "org123",
      "platform": "android",
      "tags": [
        "critical"
      ],
      "deviceConfigs": [
        {
          "device": "pixel8",
          "osVersion": "14.0",
          "locale": "en_US"
        }
      ],
      "testInputs": {
        "testid123": {
          "email": "test@test.com"
        }
      }
    }'

You can provide multiple test inputs.

By name from meta data

In case you provided a name attribute in the metaData field during build upload, you can trigger tests on the latest build with a specific name. Below you can see the example of critical tests being triggered on the latest build with the name "develop_234192348".

curl -X POST https://api.mobileboost.io/tests/execute \
-H "Content-Type: application/json" \
-d '{
      "organisationId": "testing",
      "build": {
        "meta": {
          "name": "develop_234192348"
        }
      },
     	"tags": [
        "critical"
      ]
    }'

Last updated