这个页面介绍了synapseRT NextGen提供的REST API,用户可以利用调用这些API以完成对此插件的操作。
测试计划资源
向测试计划中添加测试用例
POST /rest/synapse/latest/public/testPlan/{testPlanIssueKey}/addMembers
Request
{
"testCaseKeys":["FRS-1","FRS-2","FRS-3"]
}
Response
STATUS 200 Returned if the Test Cases are successfully added to the Test Plan
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the testPlanIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
在测试计划中指定“测试者”信息
PUT /rest/synapse/latest/public/testPlan/{testPlanIssueKey}/assignTesterToTestCase
To get "memberId", please execute "GET /rest/synapse/latest/public/testPlan/{testplanIssueKey}/members" and then pickup "id" value from its response.
Request
{
"memberId":1215,"userName":"cma"
}
Response
{
"data": "Cheney Ma"
}
STATUS 200 Returned if the Test Cases are successfully assigned to specified Tester
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the testPlanIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
在测试计划中创建测试周期
POST /rest/synapse/latest/public/testPlan/{testPlanIssueKey}/addCycle
Please note that date format supported is: yyyy-mm-dd
Request
{
"name":"REST API Cycle 1",
"environment":"Firefox",
"build":"build 1.0"
"plannedStartDate":"2017-04-13",
"plannedEndDate":"2017-04-15"
}
Response
STATUS 200 Returned if the Test Cycle is successfully added to the Test Plan
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the testPlanIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
返回测试计划中的测试周期信息
GET /rest/synapse/latest/public/testPlan/{testPlanIssueKey}/cycles
Example
[
{
"id": 151,
"name": "Round 1 with Chrome",
"environment": "Chrome",
"status": "Active",
"deleteable": false,
"aborted": false,
"active": true,
"build": "8.4",
"draft": false,
"plannedStartDate": "2016-11-03",
"plannedEndDate": "2016-11-03",
"cycleStartedDate": "2016-11-03T15:55:48.883+0800"
},
{
"id": 152,
"name": "Round 2 with Firefox",
"environment": "Firefox 47",
"status": "Active",
"deleteable": false,
"aborted": false,
"active": true,
"build": "8.4",
"draft": false,
"plannedStartDate": "2016-11-04",
"plannedEndDate": "2016-11-04",
"cycleStartedDate": "2016-11-03T16:10:38.695+0800"
}
]
Response
STATUS 200 Returned if the Test Cycles are successfully retrieved
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the testPlanIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
返回测试计划中所有测试用例
GET /rest/synapse/latest/public/testPlan/{testplanIssueKey}/members
Example
[
{
"id": 1215,
"testCaseSummary": "Valid the bank name",
"tcId": 15713,
"tpId": 15802,
"testCaseKey": "FRS-14",
"testPlanKey": "FRS-31"
},
{
"id": 1216,
"testCaseSummary": "Return error if name is not correct",
"tcId": 15714,
"tpId": 15802,
"testCaseKey": "FRS-15",
"testPlanKey": "FRS-31"
}
]
Response
STATUS 200 Returned if the Test Cases are successfully retrieved from the Test Plan
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the testPlanIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
返回测试计划中的所有缺陷
GET /rest/synapse/latest/public/testPlan/{testPlanIssueKey}/defects
Response
[
{
"id": 16001,
"key": "FRS-35",
"summary": "REST API Defect Created for Test Run Step"
},
{
"id": 15723,
"key": "FRS-24",
"summary": "System is down, testing is blocked."
},
{
"id": 15725,
"key": "FRS-26",
"summary": "Error message is wrong after clicking 'Save' button."
},
{
"id": 15803,
"key": "FRS-32",
"summary": "The dialog box should be improved."
},
{
"id": 16000,
"key": "FRS-34",
"summary": "REST API Defect Created for Test Run"
},
{
"id": 15722,
"key": "FRS-23",
"summary": "There is no error returned."
}
]
STATUS 200 Returned if the Defects are successfully retrieved from the Test Plan
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the testPlanIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
测试周期资源
改变测试周期状态
PUT /rest/synapse/latest/public/testPlan/{testPlanIssueKey}/cycle/{cycleName}/wf/{action}
Request
Valid actions are:
- Start
- Complete
- Abort
- Resume
Response
STATUS 200 Returned if the Test Cycle status is updated successfully
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the testPlanIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
通过测试周期ID更新测试周期详细信息
POST /rest/synapse/latest/public/testPlan/{testPlanIssueKey}/editCycle
To get "Test Cycle ID", please execute "GET /rest/synapse/latest/public/testPlan/{testPlanIssueKey}/cycles" and then pickup "id" value from its response.
Request
{
"id": 152,
"name":"Round 2 with Firefox_Update",
"environment":"Firefox 47_Update",
"build":"8.4_Update",
"plannedStartDate":"2017-04-13",
"plannedEndDate":"2017-04-15"
}
Response
STATUS 200 Returned if the Test Cycle details is updated successfully
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the testPlanIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
返回测试周期中的所有测试执行
GET /rest/synapse/latest/public/testPlan/{testPlanIssueKey}/cycle/{cycleName}/testRuns
Example
[
{
"id": 3174,
"status": "Failed",
"attachments": [
{
"id": 63,
"fileName": "Requirement_Issue_Create_Test_Case_in_Detail_View.jpg",
"mimeType": "image/jpeg"
}
],
"bugs": [
{
"id": 15723,
"key": "FRS-24",
"summary": "System is down, testing is blocked."
},
{
"id": 15722,
"key": "FRS-23",
"summary": "There is no error returned."
}
],
"executedBy": "cma",
"summary": "Valid the bank name",
"testCaseKey": "FRS-14",
"executionTimeStamp": 1491453907184
},
{
"id": 3175,
"status": "Not Tested",
"bugs": [
{
"id": 15723,
"key": "FRS-24",
"summary": "System is down, testing is blocked."
},
{
"id": 15722,
"key": "FRS-23",
"summary": "There is no error returned."
}
],
"executedBy": "cma",
"summary": "Return error if name is not correct",
"testCaseKey": "FRS-15",
"executionTimeStamp": 1491452068997
}
]
Response
STATUS 200 Returned if the Test Runs are successfully retrieved
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the testPlanIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
通过测试周期ID返回测试周期中的所有测试执行
GET /rest/synapse/latest/public/testPlan/{testPlanIssueKey}/cycle/{cycleId}/testRunsByCycleId
Example
[
{
"id": 3148,
"status": "Passed",
"executedBy": "cma",
"summary": "Valid the bank name",
"testCaseKey": "FRS-14",
"executionTimeStamp": 1478161145190
},
{
"id": 3149,
"status": "Failed",
"attachments": [
{
"id": 62,
"fileName": "Performance_Manage_REQs_Loading_Issue.jpg",
"mimeType": "image/jpeg"
}
],
"bugs": [
{
"id": 15722,
"key": "FRS-23",
"summary": "There is no error returned."
}
],
"executedBy": "cma",
"summary": "Return error if name is not correct",
"testCaseKey": "FRS-15",
"executionTimeStamp": 1478160401266
}
]
Response
STATUS 200 Returned if the Test Runs are successfully retrieved
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the testPlanIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
在测试周期中添加/删除测试用例(基于测试计划中的测试用例)
POST /rest/synapse/latest/public/testPlan/{testPlanIssueKey}/addMembersToTestCycle
Request
{
"testCycleId":153,
"testCycleName":"Round 3 with IE",
"addTestCaseKeys":["SPA-320","SPA-330"],
"removeTestCaseKeys":["FRS-29","FRS-30"]
}
Response
STATUS 200 Returned if the Test Cases are added/removed successfully
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the testPlanIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
在测试周期中重新排序测试执行
PUT /rest/synapse/latest/public/testRun/reorderTestRun
Request
{"testRunId":3169,"refTestRunId":3167}
-
This will move the Test Run (runId is 3169) right below Test Run (runId is 3167)
-
refTestRunId would be -1 if the Test Run needs to be moved to the top
Response
STATUS 200 Returned if the Test Run is reordered successfully
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the testRunId provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
返回测试周期中的所有缺陷
GET /rest/synapse/latest/public/testPlan/{testPlanIssueKey}/cycle/{cycleId}/defects
Response
[
{
"id": 16001,
"key": "FRS-35",
"summary": "REST API Defect Created for Test Run Step"
},
{
"id": 15723,
"key": "FRS-24",
"summary": "System is down, testing is blocked."
},
{
"id": 15803,
"key": "FRS-32",
"summary": "The dialog box should be improved."
},
{
"id": 16000,
"key": "FRS-34",
"summary": "REST API Defect Created for Test Run"
},
{
"id": 15722,
"key": "FRS-23",
"summary": "There is no error returned."
}
]
STATUS 200 Returned if the Defects are successfully retrieved from the Test Cycle
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the testPlanIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
测试执行资源
返回测试执行的详细信息
GET /rest/synapse/latest/public/testRun/{runID}
Please note that runID doesn't include the prefix 'TR'.
Example
{
"id": 3174,
"type": 0,
"comment": "Updated through REST",
"status": "Failed",
"summary": "Valid the bank name",
"testCaseKey": "FRS-14",
"lozenge": "aui-lozenge aui-lozenge-error",
"testRunDetails": {
"testRunSteps": [
{
"id": 15254,
"status": "Blocked",
"step": "Login 'FRS' system valid u/p.",
"expectedResult": "User logged in successfully.",
"testRunStepBugsWrapper": [
{
"id": 15722,
"key": "FRS-23",
"summary": "There is no error returned."
}
],
"testRunStepAttachments": []
},
{
"id": 15255,
"status": "Not Tested",
"step": "Choose any ticket and click on 'Purchase' button.",
"expectedResult": "It redirects to 'Purchase' page.",
"testRunStepAttachments": [
{
"id": 64,
"fileName": "FF_Only_Test_Plan_Failed_Expand_Test_Case_Member.jpg",
"mimeType": "image/jpeg"
}
]
},
{
"id": 15256,
"status": "Not Tested",
"step": "Specify a valid bank from which the card was issued in 'Bank Name' textbox.",
"expectedResult": "",
"testRunStepAttachments": []
},
{
"id": 15257,
"status": "Not Tested",
"step": "Click 'Validation' button.",
"expectedResult": "A confirmation message 'Bank Validation Passed' pops up.",
"testRunStepAttachments": []
},
{
"id": 15258,
"status": "Not Tested",
"step": "Specify an invalid bank in 'Bank Name' textbox.",
"expectedResult": "",
"testRunStepAttachments": []
},
{
"id": 15259,
"status": "Not Tested",
"step": "Click 'Validation' button.",
"expectedResult": "An error message 'Bank Name is not valid!' pops up.",
"testRunStepAttachments": []
}
],
"testRunHistory": [
{
"executorName": "cma",
"activity": "Passed",
"executionTime": 1491451955420,
"activityType": "Status",
"testRunId": 3174
},
{
"executorName": "cma",
"activity": "Blocked",
"executionTime": 1491453658080,
"activityType": "Status",
"testRunId": 3174
},
{
"executorName": "cma",
"activity": "+ FRS-23",
"executionTime": 1491453658085,
"activityType": "Issue",
"testRunId": 3174
},
{
"executorName": "cma",
"activity": "Failed",
"executionTime": 1491453907130,
"activityType": "Status",
"testRunId": 3174
},
{
"executorName": "cma",
"activity": "+ FRS-24",
"executionTime": 1491453907184,
"activityType": "Issue",
"testRunId": 3174
}
],
"testRunBugs": [
{
"id": 15723,
"key": "FRS-24",
"summary": "System is down, testing is blocked."
},
{
"id": 15722,
"key": "FRS-23",
"summary": "There is no error returned."
}
],
"testRunAttachments": [
{
"id": 63,
"fileName": "Requirement_Issue_Create_Test_Case_in_Detail_View.jpg",
"mimeType": "image/jpeg"
}
],
"nextRunId": 3175
},
"testCaseId": 15713
}
Response
STATUS 200 Returned if the Test Run Details are successfully retrieved
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the testPlanIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
更新测试执行结果
POST /rest/synapse/latest/public/testPlan/{testPlanIssueKey}/cycle/{cycleName}/updateTestRun
Request
{
"testcaseKey":"FRS-14",
"result":"Passed",
"comment":"Updated through REST"
}
Response
STATUS 200 Returned if the Test Run is updated successfully
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the testPlanIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
更新测试执行的步骤结果
POST /rest/synapse/latest/public/testRun/updateStep/
Request
{"ID":"1704", "step":"Update Step from REST API", "expectedResult":"Update Expected Result from REST API", "stepData":"Update Test Data from REST API"}
Response
STATUS 200 Returned if the Test Run Step Result is successfully updated
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the runStepId provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
根据runid更新测试执行结果
POST /rest/synapse/latest/public/testRun/update
Request
{
"runId":"3174", "result":"Failed", "comment":"Updated through REST API", "bugs":["FRS-24"]
}
Response
STATUS 200 Returned if the Test Run Step Result is successfully updated
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the runId provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
更新多个测试执行的测试结果
POST /rest/synapse/latest/public/testPlan/{testPlanIssueKey}/bulkStatusUpdate
Request
Valid 'status' are: - Passed - Failed - Not Tested - Blocked - NA
{
"testCycleId":153,
"status":"Failed",
"runIds":[3164,3165,3166]
}
Response
STATUS 200 Returned if the Test Runs results are successfully updated
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the testPlanIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
向测试执行链接缺陷
POST /rest/synapse/latest/public/testPlan/{testPlanIssueKey}/cycle/{cycleName}/linkBugToTestRun
Request
{
"testcaseKey":"FRS-15",
"bugs":["FRS-23","FRS-24"]
}
Response
STATUS 200 Returned if the Bug is successfully linked to the Test Run
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the testPlanIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
向测试执行添加附件
POST /rest/synapse/latest/public/attachment/{runId}/testrun
Please note that runId doesn't include the prefix 'TR'.
Supported content type: MULTIPART_FORM_DATA
Response
STATUS 200 Returned if the attachment is successfully added to Test Run
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the runId provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
向测试执行的步骤添加附件
POST /rest/synapse/latest/public/attachment/{runId}/testrun/step/{stepno}
Please note that runId doesn't include the prefix 'TR'.
Supported content type: MULTIPART_FORM_DATA
Response
STATUS 200 Returned if the attachment is successfully added to Test Run Step
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the runId provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
从测试执行创建一个新的缺陷
POST /rest/synapse/latest/public/testRun/createRunBug
Request
{
"fields":
{
"project":
{"key": "FRS"},
"summary": "REST API Defect Created for Test Run",
"description": "This Defect is Created from a Test Run",
"issuetype":
{"name": "Defect"}
},
"runId":3149
}
Response
{
"id": 16000,
"key": "FRS-34"
}
STATUS 200 Returned if the Defect is successfully created from the Test Run
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the runId provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
从测试执行的步骤创建一个新的缺陷
POST /rest/synapse/latest/public/testRun/createRunStepBug
Request
{
"fields":
{
"project":
{"key": "FRS"},
"summary": "REST API Defect Created for Test Run Step",
"description": "This Defect is Created from a Test Run Step",
"issuetype":
{"name": "Defect"}
},
"runStepId":15176
}
Response
{
"id": 16001,
"key": "FRS-35"
}
STATUS 200 Returned if the Defect is successfully created from the Test Run Step
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the runStepId provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
返回测试执行中的所有缺陷
GET /rest/synapse/latest/public/testRun/defects/runId
Response
[
{
"id": 16001,
"key": "FRS-35",
"summary": "REST API Defect Created for Test Run Step"
},
{
"id": 15722,
"key": "FRS-23",
"summary": "There is no error returned."
},
{
"id": 16000,
"key": "FRS-34",
"summary": "REST API Defect Created for Test Run"
}
]
STATUS 200 Returned if the Defects are successfully retrieved from the Test Run
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the runId provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
返回测试执行中附件的详细信息
GET /rest/synapse/latest/public/attachment/{runId}/getAttachmentDetails
Response
[
{
"fileName": "Attachment1 - Attached in a Test Run Step.jpg",
"mimeType": "image/jpeg",
"id": 63,
"filePath": "http://localhost:8848/plugins/servlet/downloadTRAttachment?attachmentId=63"
},
{
"fileName": "Attachment2 - Attached in a Test Run.jpg",
"mimeType": "image/jpeg",
"id": 64,
"filePath": "http://localhost:8848/plugins/servlet/downloadTRAttachment?attachmentId=64"
}
]
STATUS 200 Returned if the attachments are successfully retrieved from the Test Run
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the runId provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
从测试执行中删除附件
DELETE /rest/synapse/latest/public/attachment/{runId}/deleteAttachment/{attachmentId}
Response
TBD
STATUS 200 Returned if the attachment is successfully deleted from the Test Run
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the runId provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
测试用例资源
创建新的测试用例以及用例步骤
POST: /rest/synapse/latest/public/testCase/create/createTestCase
Request
{
"fields":
{
"project":
{"key": "FRS"},
"summary": "REST API Test Case 1",
"description": "This Test Case Is Created from REST API",
"issuetype":
{"name": "Test Case"}
}
"testcasesteps":
[
{"step":"It is the first Test Step", "stepData": "It is Test Data for the first Test Step", "expectedResult":"It is the Expected Result for the first Test Step"},
{"step":"It is the second Test Step", "stepData": "It is Test Data for the second Test Step", "expectedResult":"It is the Expected Result for the second Test Step"}
]
}
Response
{
"id": 16000,
"key": "FRS-34"
}
STATUS 200 Returned if the Test Case is successfully created
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the 'fields' provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
向测试用例添加新的步骤
POST /rest/synapse/latest/public/testCase/{testCaseIssueKey}/addSteps
Request
[
{ "step":"Step 1 added via REST API",
"stepData": "It is step data A for testing",
"expectedResult":"Expected Result 1 added via REST API"
},
{ "step":"Step 2 added via REST API",
"stepData": "It is step data B for testing",
"expectedResult":"Expected Result 1 added via REST API"
}
]
Response
[
{
"sequenceNumber": "8",
"id": 1707,
"step": "Step 1 added via REST API",
"expectedResult": "Expected Result 1 added via REST API",
"tcId": 15713,
"stepData": "It is step data A for testing"
},
{
"sequenceNumber": "9",
"id": 1708,
"step": "Step 2 added via REST API",
"expectedResult": "Expected Result 1 added via REST API",
"tcId": 15713,
"stepData": "It is step data B for testing"
}
]
STATUS 200 Returned if the Test Steps are successfully added to the Test Case
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the testCaseIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
返回测试用例中的步骤信息
GET /rest/synapse/latest/public/testCase/{testCaseIssueKey}/steps
Example
[
{
"sequenceNumber": "1",
"id": 1672,
"step": "Login 'FRS' system valid u/p.",
"expectedResult": "User logged in successfully.",
"tcId": 15713
},
{
"sequenceNumber": "2",
"id": 1673,
"step": "Choose any ticket and click on 'Purchase' button.",
"expectedResult": "It redirects to 'Purchase' page.",
"tcId": 15713
}
]
Response
STATUS 200 Returned if the Test Steps are successfully retrieved from the Test Case
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the testCaseIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
通过ID更新测试用例的步骤信息
PUT /rest/synapse/latest/public/testCase/{testCaseIssueKey}/updateStep
Request
{"ID":"1704", "step":"Update Step X", "expectedResult":"Update Expected Result X", "stepData":"Update Test Data X"}
Response
STATUS 200 Returned if the Test Step is successfully updated
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the ID provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
根据测试用例步骤的sequenceNumber(序号)更新步骤信息
PUT /rest/synapse/latest/public/testCase/{testCaseIssueKey}/updateStep
Request
{ "sequenceNumber":"1", "step":"Step 1", "expectedResult":"Result 1", "stepData":"Data 1" }
Response
STATUS 200 Returned if the Test Step is successfully updated
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the sequenceNumber provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
根据ID删除测试用例的步骤
DELETE /rest/synapse/latest/public/testCase/{testCaseIssueKey}/deleteStep/{stepId}
Response
STATUS 200 Returned if the Test Step is successfully deleted
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the stepId provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
根据测试用例中sequenceNumber(序号)删除步骤
DELETE /rest/synapse/latest/public/testCase/{testCaseIssueKey}/deleteStepBySequenceNo/{stepNo}
Response
STATUS 200 Returned if the Test Step is successfully deleted
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the stepNo provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
返回所有关联到测试用例的需求
GET /rest/synapse/latest/public/testCase/{testCaseIssueKey}/linkedRequirements
Response
[
{
"id": 15703,
"key": "FRS-4",
"summary": "Valid Card Owner"
},
{
"id": 15701,
"key": "FRS-2",
"summary": "Credit Card Validation"
},
{
"id": 15704,
"key": "FRS-5",
"summary": "Passenger Information Validation"
}
]
STATUS 200 Returned if the linked Requirements are successfully retrieved from the Test Case
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the testCaseIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
从测试用例删除需求的关联关系
DELETE /rest/synapse/latest/public/testCase/{testCaseIssueKey}/deleteLinkedRequirements
Request
{"requirementKeys":["FRS-3","FRS-4"]}
Response
STATUS 200 Returned if the Requirement Associations are successfully deleted
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the testCaseIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
从测试用例创建随机测试执行
PUT /rest/synapse/latest/public/testRun/adhoc/create/{testCaseIssueKey}
Response
{
"id": 3176,
"type": 0,
"status": "Not Tested",
"testCaseKey": "FRS-15",
"lozenge": "aui-lozenge ",
"summary": "Return error if name is not correct",
"testRunDetails": {
"prevRunId": 3175
},
"testerName": "cma",
"testCaseId": 15714
}
STATUS 200 Returned if the Test Case is successfully assigned to specified Tester
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the testCaseIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
从测试用例返回随机测试执行的详细信息
GET /rest/synapse/latest/public/testRun/adhoc/getTestRuns/{testCaseIssueKey}
Response
[
{
"id": 3176,
"type": 0,
"status": "Not Tested",
"testCaseKey": "FRS-15",
"lozenge": "aui-lozenge ",
"summary": "Return error if name is not correct",
"testRunDetails": {
"testRunSteps": [
{
"id": 15265,
"status": "Not Tested",
"step": "Login 'FRS' system valid u/p.",
"testRunStepAttachments": [],
"expectedResult": "User logged in successfully."
},
{
"id": 15266,
"status": "Not Tested",
"step": "Choose any ticket and click on '*Purchase*' button.",
"stepData": "",
"testRunStepAttachments": [],
"expectedResult": "It redirects to 'Purchase' page."
},
{
"id": 15267,
"status": "Not Tested",
"step": "Specify your ID and Name in '{color:red}Passenger Name{color}' section.",
"stepData": "",
"testRunStepAttachments": [],
"expectedResult": ""
},
{
"id": 15268,
"status": "Not Tested",
"step": "Click 'Check' button. ",
"testRunStepAttachments": [],
"expectedResult": "It returns an error: 'Your ID and Name are inconsistent, please check again!'."
},
{
"id": 15269,
"status": "Not Tested",
"step": "*Below is an inline image for Step 5:*\n !UG_AD11_Preference.jpg|thumbnail!",
"stepData": "",
"testRunStepAttachments": [],
"expectedResult": "*Below is an inline image for Step 5:*\n !UG_AD10_Preference.jpg|thumbnail!"
}
],
"prevRunId": 3175
},
"testerName": "cma",
"testCaseId": 15714
},
{
"id": 3174,
"type": 0,
"status": "Passed",
"testCaseKey": "FRS-15",
"lozenge": "aui-lozenge aui-lozenge-success",
"summary": "Return error if name is not correct",
"testRunDetails": {
"testRunSteps": [
{
"id": 15254,
"status": "Passed",
"step": "Login 'FRS' system valid u/p.",
"testRunStepAttachments": [],
"expectedResult": "User logged in successfully."
},
{
"id": 15255,
"status": "Passed",
"step": "Choose any ticket and click on '*Purchase*' button.",
"stepData": "",
"testRunStepAttachments": [],
"expectedResult": "It redirects to 'Purchase' page."
},
{
"id": 15256,
"status": "Passed",
"step": "Specify your ID and Name in '{color:red}Passenger Name{color}' section.",
"stepData": "",
"testRunStepAttachments": [],
"expectedResult": ""
},
{
"id": 15257,
"status": "Passed",
"step": "Click 'Check' button. ",
"testRunStepAttachments": [],
"expectedResult": "It returns an error: 'Your ID and Name are inconsistent, please check again!'."
},
{
"id": 15258,
"status": "Passed",
"step": "*Below is an inline image for Step 5:*\n !UG_AD11_Preference.jpg|thumbnail!",
"stepData": "",
"testRunStepAttachments": [],
"expectedResult": "*Below is an inline image for Step 5:*\n !UG_AD10_Preference.jpg|thumbnail!"
}
],
"testRunHistory": [
{
"executorName": "cma",
"testRunId": 3174,
"activity": "Passed",
"executionTime": 1492569650867,
"activityType": "Status"
}
],
"prevRunId": 3173,
"nextRunId": 3175
},
"testerName": "cma",
"testCaseId": 15714
}
]
STATUS 200 Returned if the Ad Hoc Test Run Details are successfully retrieved from the Test Case
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the testCaseIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
从测试用例返回(从此测试用例)报告的缺陷
GET /rest/synapse/latest/public/testCase/{testCaseIssueKey}/getDefects
Response
[
{
"id": 15722,
"key": "FRS-23",
"summary": "There is no error returned."
},
{
"id": 15725,
"key": "FRS-26",
"summary": "Error message is wrong after clicking 'Save' button."
},
{
"id": 15900,
"key": "FRS-33",
"summary": "There is an error when open xxx page."
}
]
STATUS 200 Returned if the Defects are successfully retrieved from the Test Case
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the testCaseIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
需求资源
向需求关联一个子级需求
POST /rest/synapse/latest/public/requirement/{requirementIssueKey}/addChildren
Request
{"requirementKeys":["FRS-3","FRS-4"]}
Response
STATUS 200 Returned if the Child Requirements are successfully linked to the Requirement
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the requirementIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
从一个需求返回其所有的子级需求(包括子级需求的子级需求)
GET /rest/synapse/latest/public/requirement/{requirementIssueKey}/getChildren
Response
[
{
"id": 15701,
"key": "FRS-2",
"summary": "Credit Card Validation"
},
{
"id": 15704,
"key": "FRS-5",
"summary": "Passenger Information Validation"
},
{
"id": 15702,
"key": "FRS-3",
"summary": "Valid Bank"
},
{
"id": 15703,
"key": "FRS-4",
"summary": "Valid Card Owner"
},
{
"id": 15705,
"key": "FRS-6",
"summary": "Registered User"
},
{
"id": 15706,
"key": "FRS-7",
"summary": "Not Registered User"
}
]
STATUS 200 Returned if the Child Requirements are successfully retrieved from the Requirement
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the requirementIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
从一个需求返回直接与其关联的所有子级需求
GET /rest/synapse/latest/public/requirement/{requirementIssueKey}/getOnlyImmediateChildren
Response
[
{
"id": 15702,
"key": "FRS-3",
"summary": "Valid Bank"
},
{
"id": 15703,
"key": "FRS-4",
"summary": "Valid Card Owner"
}
]
STATUS 200 Returned if the immediate Child Requirements are successfully retrieved from the Requirement
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the requirementIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
向一个需求关联测试用例
POST /rest/synapse/latest/public/requirement/{requirementIssueKey}/linkTestCase
Request
{
"testCaseKeys":["FRS-14","FRS-15"]
}
Response
STATUS 200 Returned if the Test Cases are successfully linked to the Requirement
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the requirementIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
从一个需求返回所有关联的测试用例(包含关联到子级需求的测试用例)
GET /rest/synapse/latest/public/requirement/{requirementIssueKey}/linkedTestCases
Example
[
{
"id": 15714,
"key": "FRS-15",
"summary": "Return error if name is not correct"
},
{
"id": 15715,
"key": "FRS-16",
"summary": "Return error if age is not correct"
},
{
"id": 15716,
"key": "FRS-17",
"summary": "Return error if sex is not correct "
}
]
STATUS 200 Returned if the linked Test Cases are successfully retrieved from the Requirement
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the requirementIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
从一个需求删除测试用例的关联关系
DELETE /rest/synapse/latest/public/requirement/{requirementIssueKey}/deleteLinkedTestCases
Request
{ "testCaseKeys":["FRS-16","FRS-17"]}
Response
STATUS 200 Returned if the Test Case Associations are successfully deleted
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the requirementIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
返回从需求报告(通过关联的测试用例)的所有缺陷
GET /rest/synapse/latest/public/requirement/{requirementIssueKey}/getDefects
Response
[
{
"id": 15722,
"key": "FRS-23",
"summary": "There is no error returned."
},
{
"id": 15723,
"key": "FRS-24",
"summary": "System is down, testing is blocked."
},
{
"id": 15725,
"key": "FRS-26",
"summary": "Error message is wrong after clicking 'Save' button."
},
{
"id": 15900,
"key": "FRS-33",
"summary": "There is an error when open xxx page."
}
]
STATUS 200 Returned if the Defects are successfully retrieved from the Requirement
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the requirementIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
缺陷资源
从一个缺陷返回所有涉及到的测试执行
GET /rest/synapse/latest/public/testRun/getTestRunsForDefect/{defectIssueKey}
Response
[
{
"id": 3117,
"type": 0,
"status": "Failed",
"testCaseKey": "FRS-15",
"lozenge": "aui-lozenge aui-lozenge-error",
"summary": "Return error if name is not correct",
"testRunDetails": {
"testRunSteps": [
{
"id": 15087,
"status": "Passed",
"step": "Login 'FRS' system valid u/p.",
"testRunStepAttachments": [],
"expectedResult": "User logged in successfully."
},
{
"id": 15088,
"status": "Passed",
"step": "Choose any ticket and click on 'Purchase' button.",
"testRunStepAttachments": [],
"expectedResult": "It redirects to 'Purchase' page."
},
{
"id": 15089,
"status": "Passed",
"step": "Specify your ID and Name in 'Passenger Name' section.",
"testRunStepAttachments": [],
"expectedResult": ""
},
{
"id": 15090,
"status": "Failed",
"step": "Click 'Check' button. ",
"testRunStepBugsWrapper": [
{
"id": 15722,
"key": "FRS-23",
"summary": "There is no error returned."
}
],
"testRunStepAttachments": [
{
"id": 60,
"fileName": "Test_Case_View_Test_Suite_v8.1.jpg",
"mimeType": "image/jpeg"
}
],
"expectedResult": "It returns an error: 'Your ID and Name are inconsistent, please check again!'."
}
],
"testRunHistory": [
{
"executorName": "cma",
"testRunId": 3117,
"activity": "Passed",
"executionTime": 1467342070139,
"activityType": "Status"
},
{
"executorName": "cma",
"testRunId": 3117,
"activity": "Passed",
"executionTime": 1467342070140,
"activityType": "Status"
},
{
"executorName": "cma",
"testRunId": 3117,
"activity": "Passed",
"executionTime": 1467342070140,
"activityType": "Status"
},
{
"executorName": "cma",
"testRunId": 3117,
"activity": "Passed",
"executionTime": 1467342070140,
"activityType": "Status"
},
{
"executorName": "cma",
"testRunId": 3117,
"activity": "Failed",
"executionTime": 1467342073924,
"activityType": "Status"
},
{
"executorName": "cma",
"testRunId": 3117,
"activity": "Attached",
"executionTime": 1467342100470,
"activityType": "Issue"
}
],
"testRunBugs": [
{
"id": 15722,
"key": "FRS-23",
"summary": "There is no error returned."
}
],
"testRunAttachments": [],
"prevRunId": 3120
},
"testerName": "cma",
"testCaseId": 15714
},
{
"id": 3149,
"type": 0,
"status": "Failed",
"testCaseKey": "FRS-15",
"lozenge": "aui-lozenge aui-lozenge-error",
"summary": "Return error if name is not correct",
"testRunDetails": {
"testRunSteps": [
{
"id": 15173,
"status": "Passed",
"step": "Login 'FRS' system valid u/p.",
"testRunStepAttachments": [],
"expectedResult": "User logged in successfully."
},
{
"id": 15174,
"status": "Passed",
"step": "Choose any ticket and click on '*Purchase*' button.",
"stepData": "",
"testRunStepAttachments": [],
"expectedResult": "It redirects to 'Purchase' page."
},
{
"id": 15175,
"status": "Passed",
"step": "Specify your ID and Name in '{color:red}Passenger Name{color}' section.",
"stepData": "",
"testRunStepAttachments": [],
"expectedResult": ""
},
{
"id": 15176,
"status": "Failed",
"step": "Click 'Check' button. ",
"testRunStepBugsWrapper": [
{
"id": 15722,
"key": "FRS-23",
"summary": "There is no error returned."
}
],
"testRunStepAttachments": [
{
"id": 61,
"fileName": "Performance_Manage_REQs_Loading_Issue.jpg",
"mimeType": "image/jpeg"
}
],
"expectedResult": "It returns an error: 'Your ID and Name are inconsistent, please check again!'."
},
{
"id": 15177,
"status": "Passed",
"step": "*Below is an inline image for Step 5:*\n!Image_for_DEMO_Purpose.png|thumbnail!",
"stepData": "",
"testRunStepAttachments": [],
"expectedResult": "*Below is an inline image for Step 5:*\n!Image_for_DEMO_Purpose.png|thumbnail!"
}
],
"testRunHistory": [
{
"executorName": "cma",
"testRunId": 3149,
"activity": "Passed",
"executionTime": 1478160384762,
"activityType": "Status"
},
{
"executorName": "cma",
"testRunId": 3149,
"activity": "Failed",
"executionTime": 1478160387086,
"activityType": "Status"
},
{
"executorName": "cma",
"testRunId": 3149,
"activity": "+ FRS-23",
"executionTime": 1478160401266,
"activityType": "Issue"
}
],
"testRunBugs": [
{
"id": 15722,
"key": "FRS-23",
"summary": "There is no error returned."
}
],
"testRunAttachments": [
{
"id": 62,
"fileName": "Performance_Manage_REQs_Loading_Issue.jpg",
"mimeType": "image/jpeg"
}
],
"prevRunId": 3148,
"nextRunId": 3150
},
"testerName": "cma",
"testCaseId": 15714
}
]
STATUS 200 Returned if the Test Run Details are successfully retrieved from the Defect
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the defectIssueKey provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
其它资源
返回指定测试周期版本(Build)中报告的缺陷
GET /rest/synapse/latest/public/testPlan/defects/buildDefects/{buildName}
Response
[
{
"id": 15722,
"key": "FRS-23",
"summary": "There is no error returned."
},
{
"id": 16000,
"key": "FRS-34",
"summary": "REST API Defect Created for Test Run"
},
{
"id": 16001,
"key": "FRS-35",
"summary": "REST API Defect Created for Test Run Step"
},
{
"id": 15723,
"key": "FRS-24",
"summary": "System is down, testing is blocked."
},
{
"id": 15803,
"key": "FRS-32",
"summary": "The dialog box should be improved."
},
{
"id": 15725,
"key": "FRS-26",
"summary": "Error message is wrong after clicking 'Save' button."
}
]
STATUS 200 Returned if the Defects are successfully retrieved from the Build
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the buildName provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error
返回指定测试周期环境(Environment)中报告的缺陷
GET /rest/synapse/latest/public/testPlan/defects/environmentDefects/{envName}
Response
[
{
"id": 15722,
"key": "FRS-23",
"summary": "There is no error returned."
},
{
"id": 15723,
"key": "FRS-24",
"summary": "System is down, testing is blocked."
},
{
"id": 15727,
"key": "FRS-28",
"summary": "Not able to input any data in 'Data' field."
},
{
"id": 16000,
"key": "FRS-34",
"summary": "REST API Defect Created for Test Run"
},
{
"id": 16001,
"key": "FRS-35",
"summary": "REST API Defect Created for Test Run Step"
},
{
"id": 15803,
"key": "FRS-32",
"summary": "The dialog box should be improved."
}
]
STATUS 200 Returned if the Defects are successfully retrieved from the Environment
STATUS 403 Returned if the user is not authorized perform the action or there is no valid license
STATUS 404 Returned if the envName provided is not found
STATUS 500 Returned if there is any validation error with input data or any unknown Internal Server Error