Results - Update
更新測試回合中的測試結果。
PATCH https://dev.azure.com/{organization}/{project}/_apis/test/Runs/{runId}/results?api-version=5.0
URI 參數
名稱 | 位於 | 必要 | 類型 | Description |
---|---|---|---|---|
organization
|
path | True |
string |
Azure DevOps 組織的名稱。 |
project
|
path | True |
string |
專案識別碼或專案名稱 |
run
|
path | True |
integer int32 |
要更新其測試結果的測試回合識別碼。 |
api-version
|
query | True |
string |
要使用的 API 版本。 這應該設定為 '5.0' 以使用此版本的 API。 |
要求本文
名稱 | 類型 | Description |
---|---|---|
body |
要更新的測試結果清單。 |
回應
名稱 | 類型 | Description |
---|---|---|
200 OK |
成功的作業 |
安全性
oauth2
Type:
oauth2
Flow:
accessCode
Authorization URL:
https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL:
https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer
Scopes
名稱 | Description |
---|---|
vso.test_write | 授與讀取、建立及更新測試計劃、案例、結果和其他測試管理相關成品的能力。 |
範例
Sample Request
PATCH https://dev.azure.com/fabrikam/Fabrikam-Fiber-TFVC/_apis/test/Runs/26/results?api-version=5.0
[
{
"id": 100000,
"state": "Completed",
"comment": "Website theme is looking good",
"associatedBugs": [
{
"id": 30
}
]
},
{
"id": 100001,
"state": "Completed",
"comment": "Website links are failing because of incorrect container id",
"failureType": "Known Issue"
}
]
Sample Response
{
"count": 2,
"value": [
{
"id": 100000,
"project": {},
"testRun": {},
"lastUpdatedBy": {
"id": null
},
"url": ""
},
{
"id": 100001,
"project": {},
"testRun": {},
"lastUpdatedBy": {
"id": null
},
"url": ""
}
]
}
定義
名稱 | Description |
---|---|
Build |
組建的參考。 |
Custom |
自訂欄位資訊。 |
Failing |
失敗,因為測試結果的資訊。 |
Identity |
|
Reference |
表示 REST 參考連結集合的類別。 |
Release |
發行的參考。 |
Result |
|
Shallow |
其他資源的抽象參考。 這個類別是用來提供建置資料合約的統一方式,以參考其他資源的方式,以提供輕鬆的周遊連結。 |
Shared |
共用步驟工作專案的參考。 |
Test |
表示測試步驟結果。 |
Test |
表示測試結果。 |
Test |
測試反復專案中的測試附件資訊。 |
Test |
測試結果的參考。 |
Test |
表示測試反復專案結果。 |
Test |
測試反復專案中的測試參數資訊。 |
Test |
表示測試結果的子結果。 |
BuildReference
組建的參考。
名稱 | 類型 | Description |
---|---|---|
branchName |
string |
分支名稱。 |
buildSystem |
string |
建置系統。 |
definitionId |
integer |
組建定義識別碼。 |
id |
integer |
組建識別碼。 |
number |
string |
組建編號。 |
repositoryId |
string |
存放庫識別碼。 |
uri |
string |
建置 URI。 |
CustomTestField
自訂欄位資訊。
名稱 | 類型 | Description |
---|---|---|
fieldName |
string |
欄位名稱。 |
value |
object |
域值。 |
FailingSince
失敗,因為測試結果的資訊。
名稱 | 類型 | Description |
---|---|---|
build |
建置參考,因為失敗。 |
|
date |
string |
自失敗以來的時間。 |
release |
自失敗以來的版本參考。 |
IdentityRef
名稱 | 類型 | Description |
---|---|---|
_links |
此欄位包含圖表主旨的相關零或更多有趣連結。 您可以叫用這些連結來取得其他關聯性,或取得此圖表主體的詳細資訊。 |
|
descriptor |
string |
描述項是在系統執行時參考圖形主旨的主要方式。 此欄位可唯一識別帳戶和組織之間的相同圖表主旨。 |
directoryAlias |
string |
|
displayName |
string |
這是圖形主體的非唯一顯示名稱。 若要變更此欄位,您必須變更來源提供者中的值。 |
id |
string |
|
imageUrl |
string |
|
inactive |
boolean |
|
isAadIdentity |
boolean |
|
isContainer |
boolean |
|
isDeletedInOrigin |
boolean |
|
profileUrl |
string |
|
uniqueName |
string |
|
url |
string |
此 URL 是此圖形主體來源資源的完整路由。 |
ReferenceLinks
表示 REST 參考連結集合的類別。
名稱 | 類型 | Description |
---|---|---|
links |
object |
連結的唯讀檢視。 因為參考連結是唯讀的,所以我們只想要將它們公開為唯讀。 |
ReleaseReference
發行的參考。
名稱 | 類型 | Description |
---|---|---|
attempt |
integer |
|
creationDate |
string |
|
definitionId |
integer |
發行定義識別碼。 |
environmentCreationDate |
string |
|
environmentDefinitionId |
integer |
發行環境定義識別碼。 |
environmentDefinitionName |
string |
發行環境定義名稱。 |
environmentId |
integer |
發行環境識別碼。 |
environmentName |
string |
發行環境名稱。 |
id |
integer |
版本識別碼。 |
name |
string |
發行版本名稱。 |
ResultGroupType
名稱 | 類型 | Description |
---|---|---|
dataDriven |
string |
測試結果的階層類型。 |
generic |
string |
未知的階層類型。 |
none |
string |
測試結果的分葉節點。 |
orderedTest |
string |
測試結果的階層類型。 |
rerun |
string |
測試結果的階層類型。 |
ShallowReference
其他資源的抽象參考。 這個類別是用來提供建置資料合約的統一方式,以參考其他資源的方式,以提供輕鬆的周遊連結。
名稱 | 類型 | Description |
---|---|---|
id |
string |
資源的識別碼 |
name |
string |
連結資源的名稱 (定義名稱、控制器名稱等。) |
url |
string |
資源的完整 HTTP 連結 |
SharedStepModel
共用步驟工作專案的參考。
名稱 | 類型 | Description |
---|---|---|
id |
integer |
WorkItem 共用步驟識別碼。 |
revision |
integer |
共用步驟工作專案修訂。 |
TestActionResultModel
表示測試步驟結果。
名稱 | 類型 | Description |
---|---|---|
actionPath |
string |
測試案例工作專案中的路徑識別碼測試步驟。 |
comment |
string |
結果中的批註。 |
completedDate |
string |
執行完成的時間。 |
durationInMs |
number |
執行持續時間。 |
errorMessage |
string |
結果中的錯誤訊息。 |
iterationId |
integer |
測試動作結果的反復專案識別碼。 |
outcome |
string |
結果的測試結果。 |
sharedStepModel |
共用步驟工作專案的參考。 |
|
startedDate |
string |
開始執行的時間。 |
stepIdentifier |
string |
這是測試案例的步驟識別碼。 針對共用步驟,它是測試案例工作專案中共用步驟的步驟識別碼;共用步驟中的步驟識別碼。 範例:TestCase workitem 有兩個步驟:1 個) 一般步驟,識別碼 = 1 2) 共用步驟識別碼 = 2。 在共用步驟內:具有識別碼的) 一般步驟 = 第一個步驟的 StepIdentifier 值為 1:「1」 第二個步驟:「2;1」 |
url |
string |
測試動作結果的 URL。 |
TestCaseResult
表示測試結果。
名稱 | 類型 | Description |
---|---|---|
afnStripId |
integer |
測試動作錄製的附件識別碼。 |
area |
測試區域路徑的參考。 |
|
associatedBugs |
連結至測試結果之 Bug 的參考。 |
|
automatedTestId |
string |
代表 dll 中測試方法的識別碼。 |
automatedTestName |
string |
執行測試的完整名稱。 |
automatedTestStorage |
string |
測試所屬的容器。 |
automatedTestType |
string |
自動化測試的類型。 |
automatedTestTypeId |
string |
|
build |
與測試結果相關聯的建置淺層參考。 |
|
buildReference |
與測試結果相關聯的組建參考。 |
|
comment |
string |
測試結果中的批註。 |
completedDate |
string |
測試執行完成的時間。 |
computerName |
string |
執行測試的電腦名稱稱。 |
configuration |
測試測試結果的組態。 |
|
createdDate |
string |
建立測試結果時的時間戳記。 |
customFields |
測試結果的其他屬性。 |
|
durationInMs |
number |
以毫秒為單位的測試執行持續時間。 |
errorMessage |
string |
測試執行中的錯誤訊息。 |
failingSince |
測試結果啟動失敗時的資訊。 |
|
failureType |
string |
測試結果失敗類型。 |
id |
integer |
測試結果的識別碼。 |
iterationDetails |
測試反復專案的測試結果詳細資料。 |
|
lastUpdatedBy |
上次更新測試結果的身分識別參考。 |
|
lastUpdatedDate |
string |
測試結果的上次更新日期時間。 |
outcome |
string |
測試結果的測試結果。 |
owner |
測試擁有者的參考。 |
|
priority |
integer |
執行測試的優先順序。 |
project |
Team 專案的參考。 |
|
release |
與測試結果相關聯的發行淺層參考。 |
|
releaseReference |
與測試結果相關聯的發行參考。 |
|
resetCount |
integer |
|
resolutionState |
string |
測試結果的解決狀態。 |
resolutionStateId |
integer |
解析狀態的識別碼。 |
resultGroupType |
結果的階層類型,預設值 None 表示其分葉節點。 |
|
revision |
integer |
測試結果的修訂編號。 |
runBy |
身分識別的參考已執行測試。 |
|
stackTrace |
string |
Stacktrace。 |
startedDate |
string |
測試執行開始的時間。 |
state |
string |
測試結果的狀態。 |
subResults |
測試結果內的子結果清單,如果 ResultGroupType 不是 None,則會保留對應的類型子結果。 |
|
testCase |
執行之測試的參考。 |
|
testCaseReferenceId |
integer |
測試結果所使用的測試參考識別碼。 |
testCaseRevision |
integer |
測試的名稱。 |
testCaseTitle |
string |
測試的名稱。 |
testPlan |
測試計劃測試案例工作的參考是的一部分。 |
|
testPoint |
執行之測試點的參考。 |
|
testRun |
測試回合的參考。 |
|
testSuite |
測試套件測試案例工作的參考是的一部分。 |
|
url |
string |
測試結果的 URL。 |
TestCaseResultAttachmentModel
測試反復專案中的測試附件資訊。
名稱 | 類型 | Description |
---|---|---|
actionPath |
string |
測試案例工作專案中的路徑識別碼測試步驟。 |
id |
integer |
附件識別碼。 |
iterationId |
integer |
反復專案識別碼。 |
name |
string |
附件的名稱。 |
size |
integer |
附件大小。 |
url |
string |
附件的 URL。 |
TestCaseResultIdentifier
測試結果的參考。
名稱 | 類型 | Description |
---|---|---|
testResultId |
integer |
測試結果識別碼。 |
testRunId |
integer |
測試回合識別碼。 |
TestIterationDetailsModel
表示測試反復專案結果。
名稱 | 類型 | Description |
---|---|---|
actionResults |
測試步驟會產生反復專案。 |
|
attachments |
參考測試反復專案結果中的附件。 |
|
comment |
string |
測試反復專案結果中的批註。 |
completedDate |
string |
執行完成的時間。 |
durationInMs |
number |
執行持續時間。 |
errorMessage |
string |
測試反復專案結果執行中的錯誤訊息。 |
id |
integer |
測試反復專案結果的識別碼。 |
outcome |
string |
如果測試反復專案結果,則為測試結果。 |
parameters |
反復專案中的測試參數。 |
|
startedDate |
string |
開始執行的時間。 |
url |
string |
測試反復專案結果的 URL。 |
TestResultParameterModel
測試反復專案中的測試參數資訊。
名稱 | 類型 | Description |
---|---|---|
actionPath |
string |
參考參數的測試步驟路徑。 |
iterationId |
integer |
反復專案識別碼。 |
parameterName |
string |
參數的名稱。 |
stepIdentifier |
string |
這是測試案例的步驟識別碼。 針對共用步驟,它是測試案例工作專案中共用步驟的步驟識別碼;共用步驟中的步驟識別碼。 範例:TestCase workitem 有兩個步驟:1 個) 一般步驟,識別碼 = 1 2) 共用步驟識別碼 = 2。 在共用步驟內:具有識別碼的) 一般步驟 = 第一個步驟的 StepIdentifier 值為 1:「1」 第二個步驟:「2;1」 |
url |
string |
測試參數的 URL。 |
value |
string |
參數的值。 |
TestSubResult
表示測試結果的子結果。
名稱 | 類型 | Description |
---|---|---|
comment |
string |
子結果中的批註。 |
completedDate |
string |
測試執行完成的時間。 |
computerName |
string |
執行測試的電腦。 |
configuration |
測試組態的參考。 |
|
customFields |
子結果的其他屬性。 |
|
displayName |
string |
子結果的名稱。 |
durationInMs |
integer |
測試執行的持續時間。 |
errorMessage |
string |
子結果中的錯誤訊息。 |
id |
integer |
子結果的識別碼。 |
lastUpdatedDate |
string |
上次更新結果的時間。 |
outcome |
string |
子結果的結果。 |
parentId |
integer |
子結果的立即父識別碼。 |
resultGroupType |
結果的階層類型,預設值為 None 表示其分葉節點。 |
|
sequenceId |
integer |
子結果的索引編號。 |
stackTrace |
string |
Stacktrace。 |
startedDate |
string |
測試執行開始的時間。 |
subResults |
子結果內的子結果清單,如果 ResultGroupType 不是 None,則會保存對應的類型子結果。 |
|
testResult |
測試結果的參考。 |
|
url |
string |
子結果的 URL。 |
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應