【发布时间】:2018-12-30 20:07:03
【问题描述】:
向测试运行添加测试结果时未找到测试点错误
我想使用 APi 在 Microsoft 测试管理器/VSTS 中更新测试用例的状态。
以下 API 用于更新测试结果:
POST https://{instance}/DefaultCollection/{project}/_apis/test/runs/{run}/results?api-version={version}
Content-Type: application/json
JSON
{
"testCaseTitle": { string },
"testCase": {
"id": { int }
},
"configuration": {
"id": { int },
"name": {string }
},
"testPoint": {
"id": { int }
},
"state": {
enum { Pending, Queued, InProgress, Paused, Completed }
},
"computerName": { string },
"resolutionState": { string },
"priority": { int },
"failureType": { string },
"automatedTestName": { string },
"automatedTestStorage": { string },
"automatedTestType": { string },
"automatedTestId": { string },
"area": {
"name": {string}
},
"owner": {
"DisplayName": {string}
},
"runBy": {
"DisplayName": {string}
},
"outcome": {
enum { None, Passed, Failed, Inconclusive, Timeout, Aborted, Blocked, NotExecuted, Warning, Error, NotApplicable, Paused, InProgress}
},
"errorMessage": { string },
"comment": { string },
"startedDate": { DateTime },
"completedDate": { DateTime },
"durationInMs": { long },
"associatedBugs": [
{
{ "id" : {int} }
}
]
}
我创建了示例请求并检查了响应(使用 Postman)。
请求:
[
{
"testCase": {
"id": 5000
},
"outcome": "Passed"
}
]
回复:
404 Not Found
"message": "Test point 0 not found.",
然后我在这里读到 testPoint = no of configurations。 由于我的测试用例有一种配置,操作系统 = Window 10;我设置 testPoint = 1。
(使用邮递员) 要求:
[
{
"testCase": {
"id": 5000
},
"priority": 2,
"configuration": {
"id": 14,
"name": "Windows 10"
},
"testPoint": {
"id": 1
},
"outcome": "Passed"
}
]
回复:
404 Not Found
"message": "Test point 1 not found.",
所以我想知道这个 testPoint 到底是什么以及如何为测试用例找到它? 我想从 java 代码中以编程方式调用这个 API(用于自动化测试)?有可能吗?
【问题讨论】:
标签: azure-devops microsoft-test-manager