Skip to content

TestExecutionTestStepLabels

Create test execution test step labels

Attempt to create test step labels for a test execution

Request

post /test-steps-test-step-labels

Request body

Attribute Type Required Notes
testStepId integer yes defines the test step id
testStepLabelIds array yes array containing integers that define the test step label ids

Request body example

{
  "testStepId": 1,
  "testStepLabelIds": [
    1
  ]
}
curl --location 'https://example.juno.one/test-steps-test-step-labels' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0QGp1bm8ub25lIiwidGVuYW50SUQiOiJkZXZlbG9wbWVudCIsImV4cCI6MTY4NDQ4MzYyNn0.cYdUo4oiHnkdAywSAb7EFus9PFg-2FYHZPj4gdMML-mKgUVZw9fewOo4QK6U3PqCzGWjFVksz8HULzyKMnV8AA' \
--header 'X-tenantID: example' \
--header 'Content-Type: application/json' \
--data '{
    "testStepId": 1,
    "testStepLabelIds": [
    1
    ]
    }'
import requests
import json

url = "https://example.juno.one/test-steps-test-step-labels"

payload = json.dumps({
  "testStepId": 1,
  "testStepLabelIds": [
    1
  ]
})
headers = {
  'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0QGp1bm8ub25lIiwidGVuYW50SUQiOiJkZXZlbG9wbWVudCIsImV4cCI6MTY4NDQ4MzYyNn0.cYdUo4oiHnkdAywSAb7EFus9PFg-2FYHZPj4gdMML-mKgUVZw9fewOo4QK6U3PqCzGWjFVksz8HULzyKMnV8AA',
  'X-tenantID': 'example',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
val client = OkHttpClient()
val mediaType = "application/json".toMediaType()
val body = "{\n    \"testStepId\": 1,\n    \"testStepLabelIds\": [\n    1\n    ]\n    }".toRequestBody(mediaType)
val request = Request.Builder()
  .url("https://example.juno.one/test-steps-test-step-labels")
  .post(body)
  .addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0QGp1bm8ub25lIiwidGVuYW50SUQiOiJkZXZlbG9wbWVudCIsImV4cCI6MTY4NDQ4MzYyNn0.cYdUo4oiHnkdAywSAb7EFus9PFg-2FYHZPj4gdMML-mKgUVZw9fewOo4QK6U3PqCzGWjFVksz8HULzyKMnV8AA")
  .addHeader("X-tenantID", "example")
  .addHeader("Content-Type", "application/json")
  .build()
val response = client.newCall(request).execute()

Response

Successful response of test execution test step labels create has the status 200 with following response body:

[
  {
    "id": 22,
    "name": "test",
    "previous_name": "prevtest",
    "color": "#c0507e",
    "previous_color": "#c0507e",
    "created_at": "2022-09-05T18:59:37.000Z",
    "updated_at": "2022-09-05T18:59:37.000Z",
    "projectId": 13,
    "gitlabLabelId": 2,
    "deleted": true,
    "deleted_at": "2022-09-05T18:59:37.000Z"
  }
]

400 Bad Request

{
    "timestamp": "2022-02-16T17:11:34.422+00:00",
    "status": 400,
    "error": "Bad Request",
    "message": "The request is missing testStepId parameter",
    "path": "/test-steps-test-step-labels"
}

404 Not found

{
    "timestamp": "2022-02-16T17:11:34.422+00:00",
    "status": 404,
    "error": "Not Found",
    "message": "Test step with id 30 was not found.",
    "path": "/test-steps-test-step-labels"
}

406 Insufficient permision

{
    "timestamp": "2022-02-16T17:11:34.422+00:00",
    "status": 406,
    "error": "Missing permission for action",
    "message": "You do not have a permission for this action",
    "path": "/test-steps-test-step-labels"
}

412 Precondition failed

{
    "timestamp": "2022-02-16T17:11:34.422+00:00",
    "status": 412,
    "error": "Precondition failed",
    "message": "You do not have permission for this action",
    "path": "/test-steps-test-step-labels"
}

500 Unknown error

{
    "timestamp": "2022-02-16T17:11:34.422+00:00",
    "status": 500,
    "error": "Unknown",
    "message": "There was a problem with your request. Please contact your administrator.",
    "path": "/test-steps-test-step-labels"
}