Skip to main content
Skip table of contents

Cucumber JSON result

Import test result only

POST /ds/test-executions/cucumber

Parameters and request body

Param

Type

Required

Description

projectKey

string

(tick)

Key of the project where test result will be imported.

milestoneId

integer

Milestone id to link to Test execution.

To retrieve Milestone id go to Milestone feature and click Copy Id.

Check out Milestone Document.

testExecutionKey

string

Test execution key to import test report.

testPlanKeys

array[string]

Test plan key to import test report.

If you specify the Test Plan, the Tests will be added automatically to the Test Plan if they're not part of it.

testEnvironments

array[string]

A string containing a list of test environments separated by ",".

fixVersions

array[string]

A string containing a list of fixVersions separated by “,”.

revision

string

Revision to link to Test execution.

Request body will contain a JSON file which is Cucumber report that is going to be imported. Learn more about Cucumber testing framework.

Example

BASH
curl -X 'POST' \
  'https://api.agiletest.app/ds/test-executions/cucumber?projectKey=ATP' \
  -H 'accept: application/json' \
  -H 'Authorization: JWT <token>' \
  -H 'Content-Type: application/json' \
  --data-binary '@my-report.json'

In that, <token> is the result from previous step Get Authenticated.

Make sure your test report file includes the relevant issue keys in the form of tags; otherwise, the import will fail. For further details, please refer to our GitHub repository.

Keep in mind that if the referenced test cases are not of the Gherkin type, test step details will be excluded from the parsed results.

Test result example
JSON
[
  {
    "line": 2,
    "elements": [
      {
        "start_timestamp": "2024-11-05T04:54:24.230Z",
        "line": 5,
        "name": "Applying a discount to the total amount",
        "description": "",
        "id": "billing-management;applying-a-discount-to-the-total-amount",
        "type": "scenario",
        "keyword": "Scenario",
        "steps": [
          {
            "result": { "duration": 536000, "status": "passed" },
            "line": 6,
            "name": "the total amount is $100",
            "match": {
              "arguments": [{ "val": "100", "offset": 21 }],
              "location": "com.shoppingapp.steps.BillingSteps.the_total_amount_is$(int)"
            },
            "keyword": "Given "
          },
          {
            "result": { "duration": 30000, "status": "passed" },
            "line": 7,
            "name": "I apply a discount of 10%",
            "match": {
              "arguments": [{ "val": "10", "offset": 22 }],
              "location": "com.shoppingapp.steps.BillingSteps.i_apply_a_discount_of(int)"
            },
            "keyword": "When "
          },
          {
            "result": { "duration": 4571000, "status": "passed" },
            "line": 8,
            "name": "the final amount should be $90",
            "match": {
              "arguments": [{ "val": "90", "offset": 28 }],
              "location": "com.shoppingapp.steps.BillingSteps.the_final_amount_should_be$(int)"
            },
            "keyword": "Then "
          }
        ],
        "tags": [{ "name": "@ATP-1871" }, { "name": "@ATP-1869" }]
      },
      {
        "start_timestamp": "2024-11-05T04:54:24.246Z",
        "line": 11,
        "name": "Validating a payment card",
        "description": "",
        "id": "billing-management;validating-a-payment-card",
        "type": "scenario",
        "keyword": "Scenario",
        "steps": [
          {
            "result": { "duration": 48000, "status": "passed" },
            "line": 12,
            "name": "a valid card number",
            "match": {
              "location": "com.shoppingapp.steps.BillingSteps.a_valid_card_number()"
            },
            "keyword": "Given "
          },
          {
            "result": { "duration": 21000, "status": "passed" },
            "line": 13,
            "name": "I validate the card number",
            "match": {
              "location": "com.shoppingapp.steps.BillingSteps.i_validate_the_card_number()"
            },
            "keyword": "When "
          },
          {
            "result": { "duration": 19000, "status": "passed" },
            "line": 14,
            "name": "the validation should be successful",
            "match": {
              "location": "com.shoppingapp.steps.BillingSteps.the_validation_should_be_successful()"
            },
            "keyword": "Then "
          }
        ],
        "tags": [{ "name": "@ATP-1871" }, { "name": "@ATP-1870" }]
      }
    ],
    "name": "Billing Management",
    "description": "",
    "id": "billing-management",
    "keyword": "Feature",
    "uri": "file:src/test/resources/features/Billing.feature",
    "tags": [
      {
        "name": "@ATP-1871",
        "type": "Tag",
        "location": { "line": 1, "column": 1 }
      }
    ]
  },
  {
    "line": 2,
    "elements": [
      {
        "start_timestamp": "2024-11-05T04:54:24.249Z",
        "line": 5,
        "name": "Adding multiple products to the cart",
        "description": "",
        "id": "cart-management;adding-multiple-products-to-the-cart",
        "type": "scenario",
        "keyword": "Scenario",
        "steps": [
          {
            "result": { "duration": 134000, "status": "passed" },
            "line": 6,
            "name": "the cart is empty",
            "match": {
              "location": "com.shoppingapp.steps.CartSteps.the_cart_is_empty()"
            },
            "keyword": "Given "
          },
          {
            "result": { "duration": 89000, "status": "passed" },
            "line": 7,
            "name": "I add multiple products to the cart",
            "match": {
              "location": "com.shoppingapp.steps.CartSteps.i_add_multiple_products_to_the_cart()"
            },
            "keyword": "When "
          },
          {
            "result": { "duration": 991000, "status": "passed" },
            "line": 8,
            "name": "the total price should be the sum of all products' prices",
            "match": {
              "location": "com.shoppingapp.steps.CartSteps.the_total_price_should_be_the_sum_of_all_products_prices()"
            },
            "keyword": "Then "
          },
          {
            "result": { "duration": 17000, "status": "passed" },
            "line": 9,
            "name": "the cart should contain all added products",
            "match": {
              "location": "com.shoppingapp.steps.CartSteps.the_cart_should_contain_all_added_products()"
            },
            "keyword": "And "
          }
        ],
        "tags": [{ "name": "@ATP-1872" }, { "name": "@ATP-1875" }]
      },
      {
        "start_timestamp": "2024-11-05T04:54:24.253Z",
        "line": 12,
        "name": "Removing items from the cart",
        "description": "",
        "id": "cart-management;removing-items-from-the-cart",
        "type": "scenario",
        "keyword": "Scenario",
        "steps": [
          {
            "result": { "duration": 20000, "status": "passed" },
            "line": 13,
            "name": "the cart has products",
            "match": {
              "location": "com.shoppingapp.steps.CartSteps.the_cart_has_products()"
            },
            "keyword": "Given "
          },
          {
            "result": { "duration": 14000, "status": "passed" },
            "line": 14,
            "name": "I remove a product",
            "match": {
              "location": "com.shoppingapp.steps.CartSteps.i_remove_a_product()"
            },
            "keyword": "When "
          },
          {
            "result": { "duration": 9000, "status": "passed" },
            "line": 15,
            "name": "the product should no longer be in the cart",
            "match": {
              "location": "com.shoppingapp.steps.CartSteps.the_product_should_no_longer_be_in_the_cart()"
            },
            "keyword": "Then "
          },
          {
            "result": { "duration": 14000, "status": "passed" },
            "line": 16,
            "name": "the total price should be updated accordingly",
            "match": {
              "location": "com.shoppingapp.steps.CartSteps.the_total_price_should_be_updated_accordingly()"
            },
            "keyword": "And "
          }
        ],
        "tags": [{ "name": "@ATP-1872" }, { "name": "@ATP-1876" }]
      }
    ],
    "name": "Cart Management",
    "description": "",
    "id": "cart-management",
    "keyword": "Feature",
    "uri": "file:src/test/resources/features/Cart.feature",
    "tags": [
      {
        "name": "@ATP-1872",
        "type": "Tag",
        "location": { "line": 1, "column": 1 }
      }
    ]
  },
  {
    "line": 2,
    "elements": [
      {
        "start_timestamp": "2024-11-05T04:54:24.256Z",
        "line": 5,
        "name": "Setting a delivery date",
        "description": "",
        "id": "delivery-management;setting-a-delivery-date",
        "type": "scenario",
        "keyword": "Scenario",
        "steps": [
          {
            "result": { "duration": 198000, "status": "passed" },
            "line": 6,
            "name": "I have an order to be delivered",
            "match": {
              "location": "com.shoppingapp.steps.DeliverySteps.i_have_an_order_to_be_delivered()"
            },
            "keyword": "Given "
          },
          {
            "result": { "duration": 876000, "status": "passed" },
            "line": 7,
            "name": "I set the delivery date to \"2024-12-25\"",
            "match": {
              "arguments": [{ "val": "\"2024-12-25\"", "offset": 27 }],
              "location": "com.shoppingapp.steps.DeliverySteps.i_set_the_delivery_date_to(java.lang.String)"
            },
            "keyword": "When "
          },
          {
            "result": { "duration": 30000, "status": "passed" },
            "line": 8,
            "name": "the delivery date should be set correctly",
            "match": {
              "location": "com.shoppingapp.steps.DeliverySteps.the_delivery_date_should_be_set_correctly()"
            },
            "keyword": "Then "
          }
        ],
        "tags": [{ "name": "@ATP-1873" }, { "name": "@ATP-1877" }]
      },
      {
        "start_timestamp": "2024-11-05T04:54:24.259Z",
        "line": 11,
        "name": "Retrieving delivery details",
        "description": "",
        "id": "delivery-management;retrieving-delivery-details",
        "type": "scenario",
        "keyword": "Scenario",
        "steps": [
          {
            "result": { "duration": 3756000, "status": "passed" },
            "line": 12,
            "name": "I have set a delivery address and date",
            "match": {
              "location": "com.shoppingapp.steps.DeliverySteps.i_have_set_a_delivery_address_and_date()"
            },
            "keyword": "Given "
          },
          {
            "result": { "duration": 10421000, "status": "passed" },
            "line": 13,
            "name": "I retrieve the delivery details",
            "match": {
              "location": "com.shoppingapp.steps.DeliverySteps.i_retrieve_the_delivery_details()"
            },
            "keyword": "When "
          },
          {
            "result": { "duration": 32000, "status": "passed" },
            "line": 14,
            "name": "the correct delivery information should be returned",
            "match": {
              "location": "com.shoppingapp.steps.DeliverySteps.the_correct_delivery_information_should_be_returned()"
            },
            "keyword": "Then "
          }
        ],
        "tags": [{ "name": "@ATP-1873" }, { "name": "@ATP-1878" }]
      }
    ],
    "name": "Delivery Management",
    "description": "",
    "id": "delivery-management",
    "keyword": "Feature",
    "uri": "file:src/test/resources/features/Delivery.feature",
    "tags": [
      {
        "name": "@ATP-1873",
        "type": "Tag",
        "location": { "line": 1, "column": 1 }
      }
    ]
  },
  {
    "line": 2,
    "elements": [
      {
        "start_timestamp": "2024-11-05T04:54:24.276Z",
        "line": 5,
        "name": "Adding multiple products to the cart",
        "description": "",
        "id": "cart-management;adding-multiple-products-to-the-cart",
        "type": "scenario",
        "keyword": "Scenario",
        "steps": [
          {
            "result": { "duration": 18000, "status": "passed" },
            "line": 6,
            "name": "the cart is empty",
            "match": {
              "location": "com.shoppingapp.steps.CartSteps.the_cart_is_empty()"
            },
            "keyword": "Given "
          },
          {
            "result": { "duration": 10000, "status": "passed" },
            "line": 7,
            "name": "I add multiple products to the cart",
            "match": {
              "location": "com.shoppingapp.steps.CartSteps.i_add_multiple_products_to_the_cart()"
            },
            "keyword": "When "
          },
          {
            "result": { "duration": 21000, "status": "passed" },
            "line": 8,
            "name": "the total price should be the sum of all products' prices",
            "match": {
              "location": "com.shoppingapp.steps.CartSteps.the_total_price_should_be_the_sum_of_all_products_prices()"
            },
            "keyword": "Then "
          },
          {
            "result": { "duration": 7000, "status": "passed" },
            "line": 9,
            "name": "the cart should contain all added products",
            "match": {
              "location": "com.shoppingapp.steps.CartSteps.the_cart_should_contain_all_added_products()"
            },
            "keyword": "And "
          }
        ],
        "tags": [{ "name": "@ATP-1874" }, { "name": "@ATP-1875" }]
      },
      {
        "start_timestamp": "2024-11-05T04:54:24.278Z",
        "line": 12,
        "name": "Removing items from the cart",
        "description": "",
        "id": "cart-management;removing-items-from-the-cart",
        "type": "scenario",
        "keyword": "Scenario",
        "steps": [
          {
            "result": { "duration": 16000, "status": "passed" },
            "line": 13,
            "name": "the cart has products",
            "match": {
              "location": "com.shoppingapp.steps.CartSteps.the_cart_has_products()"
            },
            "keyword": "Given "
          },
          {
            "result": { "duration": 9000, "status": "passed" },
            "line": 14,
            "name": "I remove a product",
            "match": {
              "location": "com.shoppingapp.steps.CartSteps.i_remove_a_product()"
            },
            "keyword": "When "
          },
          {
            "result": { "duration": 8000, "status": "passed" },
            "line": 15,
            "name": "the product should no longer be in the cart",
            "match": {
              "location": "com.shoppingapp.steps.CartSteps.the_product_should_no_longer_be_in_the_cart()"
            },
            "keyword": "Then "
          },
          {
            "result": { "duration": 17000, "status": "passed" },
            "line": 16,
            "name": "the total price should be updated accordingly",
            "match": {
              "location": "com.shoppingapp.steps.CartSteps.the_total_price_should_be_updated_accordingly()"
            },
            "keyword": "And "
          }
        ],
        "tags": [{ "name": "@ATP-1874" }, { "name": "@ATP-1876" }]
      }
    ],
    "name": "Cart Management",
    "description": "",
    "id": "cart-management",
    "keyword": "Feature",
    "uri": "file:src/test/resources/features/Product.feature",
    "tags": [
      {
        "name": "@ATP-1874",
        "type": "Tag",
        "location": { "line": 1, "column": 1 }
      }
    ]
  }
]
Output example
JSON
{
    "id": "321016",
    "key": "ATP-1856",
    "url": "https://company.atlassian.net/browse/ATP-1856"
}

If your test cases are created using the Cucumber framework but the test results are generated in JUnit format, use the /ds/test-executions/junit endpoint instead. For more details, visit: JUnit XML result

Import test result with new execution details

POST /ds/test-executions/cucumber/multipart

Parameters and request body

This request does not require any parameters. Instead, you need to submit two separate files: one containing the test execution details and the other containing the imported test report.

Test Execution file structure

  1. fields object:

    • summary: Summary of Test execution issue that will be created.

    • project.id: Project id in which the Test execution will be created.

    • issuetype.id: The identifier specifying the type of issue to be created.

  2. agileTestFields object:

    • milestoneId: The identifier of the milestone that this test execution should be associated with.

    • testPlanKeys: An array of issue keys of Test plan that this test execution is related to.

Each of these fields serves a specific purpose in creating and organizing the test execution:

  • The fields object contains standard issue creation information like what project it belongs to and what type of issue it is.

  • The agileTestFields object contains Agile Test-specific information for linking the execution to milestones and test plans.

For the report, it will be similar to Import test result only.

Example

BASH
curl -X 'POST' \
  'https://api.agiletest.app/ds/test-executions/cucumber/multipart' \
  -H 'accept: application/json' \
  -H 'Authorization: JWT <token>' \
  -H 'Content-Type: multipart/form-data' \
  -F 'results=@my-report.json;type=application/json' \
  -F 'testExecution=@test-execution.json;type=application/json'

In that, <token> is the result from previous step Get authenticated.

Regarding the test result, we will reuse the previous example.

Test execution details
JSON
{
  "fields": {
    "summary": "Regression test",
    "project": {
      "id": "17110"
    },
    "issuetype": {
      "id": "16396"
    }
  },
  "agileTestFields": {
    "milestoneId": 5555,
    "testPlanKeys": ["ATP-364", "ATP-362"]
  }
}

In this example, make sure all details provided are accurate and relevant; otherwise, the request will fail. For example, if the issuetype.id you specify does not exist in the project with ID 17110, the system will return an error with the corresponding error code 400 .

Example output
JSON
{
  "id": "321348",
  "key": "ATP-1859",
  "url": "https://company.atlassian.net/browse/ATP-1859"
}


Should you need any assistance or further AgileTest inquiries, contact here!

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.