Behave JSON result
Import test result only
POST /ds/test-executions/behave
Parameters and request body
Param | Type | Required | Description |
---|---|---|---|
projectKey | string |
| 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 Behave report that is going to be imported. Learn more about Behave testing framework here.
Example
curl -X 'POST' \
'https://api.agiletest.app/ds/test-executions/behave?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.
Import test result with new execution details
POST /ds/test-executions/behave/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
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.
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
curl -X 'POST' \
'https://api.agiletest.app/ds/test-executions/behave/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.
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 .
Should you need any assistance or further AgileTest inquiries, contact here!