Menu

qTest Scenario APIs

URI structure

URIs for resources provided by qTest Scenario API have the following structure: https://services.qtestscenario.com/<resource_path>.

Request Authentication

For each API request, it is required that you include the following information in the request header:

Authorization: <api_key>
Content-Type: application/json
Accept-Type: application/json

Follow the instruction to get your API key.

Create an Execution

POST /qspec/api/execution

Request body:

Attribute name

Data Type

Description

host String Host name of execution agent
execution_id Long It should always Null
start_date Timestamp Start date of the execution
end_date Timestamp End date of the execution

Request sample:

{
	"host": "34XV602",
	"execution_id": null,
	"start_date": 1452588602782,
	"end_date": null
}

Response sample:

{
    "host": "34XV602",
    "links": [],
    "execution_id": 287,
    "start_date": 1452588602782
}

Update an Execution

PUT /qspec/api/execution/{executionId}

Path variable:

  • executionId: Id of the execution which needs to be updated

Request body:

Attribute name

Data Type

Description

host String Host name of execution agent
execution_id Long Id of the execution which needs to be updated
start_date Timestamp Start date of the execution
end_date Timestamp End date of the execution

Request sample:

{
	"host": "34XV602",
	"execution_id": "282",
	"start_date": 1452588602782,
	"end_date": 1452588604202
}

Get a specific Feature file

GET /qspec/api/feature-file/{featureIssueKey}

Description: To get a specific Feature.

Path variable:

  • featureIssueKey: JIRA issue ID of the Feature.

Response object:

Attribute name

Data Type

Description

fileName

String

Feature file name, including .feature extension

id

Long

Database ID of feature

name

String

Name of feature

content

String

Feature file content

scenarios

Map<String, String>

Map of scenarios as <scenario-name, scenario-id>

Scenario-id is the DB id of Scenario

Scenario-name is the name of scenario

Response sample:

[
  {
    "fileName": "DP-127_Using calculator.feature",
    "id": 11,
    "name": "Using calculator",
    "content": "Feature: Using calculator\r\n  As a user\n  I want to calculate basic operations\n  So that I don't need to calculate by myself\r\n\r\n  Scenario: Add two numbers\r\n    Given I have calculator\r\n    When I add 4 and 3\r\n    Then I should see 7\r\n\r\n\r\n  Scenario: Square sum of two numbers\r\n    Given I have calculator\r\n    When I add 4 and 3\r\n    And I square the total of two numbers\r\n    Then I should see 49\r\n\r\n\r\n  Scenario: Divide by zero\r\n    Given I have calculator\r\n    When I add 4 and 3\r\n    But I divide the total by zero\r\n    Then I should see error message \"/ by zero\"\r\n",
    "scenarios": {
        "Add two numbers": "12",
        "Square sum of two numbers": "13",
        "Divide by zero": "14"
    }
  }
]

 

Get Feature files by JQL filtering

GET /qspec/api/feature-file?jql=

Description: To get Feature files by JQL filtering entered in the pom file.

Response object:

Attribute name

Data Type

Description

fileName

String

Feature file name, including .feature extension

id

Long

Database ID of feature

name

String

Name of feature

content

String

Feature file content

scenarios

Map<String, String>

Map of scenarios as <scenario-name, scenario-id>

Scenario-id is the DB id of Scenario

Scenario-name is the name of scenario

 

 

Submit Feature Test Logs

POST /qspec/api/feature/{featureId}/test-log

Description: To submit execution results to Feature.

Path variable: 

  • featureId: database ID of the Feature. You can get the value from id property in the response body of Get a specific Feature file or Get Feature files by JQL filtering APIs

Request body:

Attribute name

Data Type

Description

start_date

Timestamp

Start date of execution

end_date

Timestamp

End date of execution

result

TestLogResult

Enum of test result (PASSED, FAILED, INCOMPLETE, TODO)

scenario_logs

List<TestLogResource>

List  of test scenario logs

execution_id

Long

Id of execution

Attributes of TestLogResource:

Attribute name

Data Type

Description

host

String

Host name of execution agent

execution_method

ExecutionMethod

Enum of execution method

result

TestLogResult

Enum of test result

start_date

Timestamp

Start date of execution

end_date

Timestamp

End date of execution

scenario_id

Long

Id of executed scenario 

execute_log

String

Log of execution

Request sample:

{
	"result": "PASSED",
	"feature_id": "11",
	"start_date": 1452588603695,
	"end_date": 1452588603971,
	"execution_id": "282",
	"scenario_logs": [{
		"result": "PASSED",
		"host": "34XV602",
		"feature_id": "11",
		"feature_name": "DP-127_Using calculator.feature",
		"execution_method": "AUTOMATE",
		"start_date": 1452588603696,
		"end_date": 1452588603815,
		"execution_log": null,
		"scenario_id": "12"
	}, {
		"result": "PASSED",
		"host": "34XV602",
		"feature_id": "11",
		"feature_name": "DP-127_Using calculator.feature",
		"execution_method": "AUTOMATE",
		"start_date": 1452588603867,
		"end_date": 1452588603869,
		"execution_log": null,
		"scenario_id": "13"
	}, {
		"result": "PASSED",
		"host": "34XV602",
		"feature_id": "11",
		"feature_name": "DP-127_Using calculator.feature",
		"execution_method": "AUTOMATE",
		"start_date": 1452588603919,
		"end_date": 1452588603923,
		"execution_log": null,
		"scenario_id": "14"
	}]
}
Subscribe To Our Blog
Powered by Zendesk