Send Test Results via the Wolfpack API

It is possible to send test results directly via the Wolfpack API. For this, you will need an API key (see here for how to obtain one).

Wolfpack provides two endpoints for sending test results: one for sending a single test and another for sending multiple results in bulk.

1. Sending an Individual Test Result

URL

POST https://api.wolfpackqa.com/test-runs

Description

This endpoint allows you to send a single test result to the Wolfpack platform. You can use this endpoint to add information such as the test status, environment, and associated release.

Authentication

The request header must include a valid API token:

    
    x-api-token: YOUR_API_TOKEN
    

Request Body

The request body must contain the following information:

  • name: The name of the test.
  • status: The test status (passed or failed).
  • environmentKey: The key of the environment where the test was executed.
  • releaseId (optional): The ID of the associated release.
  • suite (optional): The suite to which the test belongs.
  • testDefinitionId (optional): The ID of the test, if it already exists and you wish to associate it directly.

Since API keys are tied to a specific project, it is not necessary to specify the project.

Typically, test executions are automatically associated with the test. See part 3 for the rules.

Example Request Body

    
{
  "name": "Login Test",
  "status": "passed",
  "environmentKey": "staging",
  "suite": "auth-tests"
}
    

Responses

  • 200 OK: The test has been successfully recorded.
  • 400 Bad Request: The test status is invalid or required information is missing.

2. Sending Test Results in Bulk

URL

POST /test-runs/bulk

Description

This endpoint allows you to send multiple test results in a single request. It is designed to handle batches of tests to optimize bulk submissions.

Authentication

The request header must include a valid API token:

    
    x-api-token: YOUR_API_TOKEN
    

Request Body

The request body must contain an array of objects, where each object represents an individual test with the same fields as for an individual request.

Example Request Body

    
[
  {
    "name": "Login Test",
    "status": "passed",
    "environmentKey": "staging",
    "releaseId": "789def123ghi456",
    "suite": "auth-tests"
  },
  {
    "name": "Registration Test",
    "status": "failed",
    "environmentKey": "staging",
    "releaseId": "789def123ghi456",
    "suite": "auth-tests"
  }
]
    

Responses

  • 200 OK: All tests have been successfully recorded.
  • 400 Bad Request: Errors were detected in some of the submitted results.

3. Creating and Managing Test Definitions

When a test result is sent, Wolfpack determines if an existing test (linked to the testDefinitionId) already exists or if a new one needs to be created.

Retrieving the Test Definition

  • If a testDefinitionId is provided:
    Wolfpack uses the test definition associated with this identifier.
  • If no testDefinitionId is provided:
    Wolfpack attempts to find a test based on the provided information, such as the name, suite, and project. If no matching test is found, Wolfpack automatically creates a new one.

Error Conditions

  • Invalid Status: If the status field contains a value other than passed or failed, a 400 Bad Request error is returned.
  • Missing Project: If the project field is missing and the API token does not contain project information, a 400 Bad Request error is returned.

This API is designed to simplify centralized test tracking in your project and ensure traceability of your test results on the Wolfpack platform.

envoyer-des-resultats-de-tests-via-lapi-wolfpack