Clone Operation - Clone Test Suite
複製測試套件
POST https://dev.azure.com/{organization}/{project}/_apis/test/Plans/{planId}/Suites/{sourceSuiteId}/cloneoperation?api-version=5.0-preview.2
URI 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
organization
|
path | True |
string |
Azure DevOps 組織的名稱。 |
|
plan
|
path | True |
integer int32 |
要複製之套件所在的測試計劃識別碼 |
|
project
|
path | True |
string |
專案識別碼或專案名稱 |
|
source
|
path | True |
integer int32 |
要複製的測試套件識別碼 |
|
api-version
|
query | True |
string |
要使用的 API 版本。 這應該設定為 '5.0-preview.2',以使用此版本的 API。 |
要求本文
| 名稱 | 類型 | Description |
|---|---|---|
| cloneOptions |
複製測試套件的複製選項。 |
|
| destinationSuiteId |
integer |
套件識別碼,我們必須複製套件。 |
| destinationSuiteProjectName |
string |
目的地套件專案名稱。 |
回應
| 名稱 | 類型 | Description |
|---|---|---|
| 200 OK |
成功作業 |
安全性
oauth2
類型:
oauth2
Flow:
accessCode
授權 URL:
https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
權杖 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
範圍
| 名稱 | Description |
|---|---|
| vso.test_write | 授與讀取、建立及更新測試計劃、案例、結果和其他測試管理相關成品的能力。 |
範例
範例要求
POST https://dev.azure.com/fabrikam/fabrikam-fiber-tfvc/_apis/test/Plans/1/Suites/{sourceSuiteId}/cloneoperation?api-version=5.0-preview.2
{
"destinationSuiteId": 13,
"destinationSuiteProjectName": "fabrikam-fiber-tfvc2",
"cloneOptions": {
"copyAncestorHierarchy": true,
"overrideParameters": {
"System.AreaPath": "fabrikam-fiber-tfvc2",
"System.IterationPath": "fabrikam-fiber-tfvc2"
}
}
}
範例回覆
{
"opId": 3,
"creationDate": "0001-01-01T00:00:00",
"completionDate": "0001-01-01T00:00:00",
"state": "queued",
"message": null,
"cloneStatistics": null,
"resultObjectType": "testSuite",
"destinationObject": {
"id": "14",
"name": "simpleCloned",
"url": "https://dev.azure.com/fabrikam/fabrikam-fiber-tfvc2/_apis/test/Plans/13/Suites/14"
},
"sourceObject": {
"id": "1",
"name": "TestSuite1",
"url": "https://dev.azure.com/fabrikam/fabrikam-fiber-tfvc/_apis/test/Plans/1/Suites/2"
},
"destinationPlan": {
"id": "18",
"name": "DestinationPlan",
"url": "https://dev.azure.com/fabrikam/fabrikam-fiber-tfvc2/_apis/test/Plans/18"
},
"sourcePlan": {
"id": "1",
"name": "TestPlan1",
"url": "https://dev.azure.com/fabrikam/fabrikam-fiber-tfvc/_apis/test/Plans/1"
},
"destinationProject": {
"name": "fabrikam-fiber-tfvc2",
"url": "https://dev.azure.com/fabrikam/_apis/projects/fabrikam-fiber-tfvc2"
},
"sourceProject": {
"name": "fabrikam-fiber-tfvc",
"url": "https://dev.azure.com/fabrikam/_apis/projects/fabrikam-fiber-tfvc"
},
"url": "https://dev.azure.com/fabrikam/fabrikam-fiber-tfvc/_apis/test/cloneOperation/3"
}
定義
| 名稱 | Description |
|---|---|
|
Clone |
複製作業的詳細資料。 |
|
Clone |
作業的目前狀態。 當 State 達到 Suceeded 或 Failed 時,作業就會完成 |
|
Clone |
|
|
Clone |
|
|
Result |
複製作業所產生的物件型別 |
|
Shallow |
其他資源的抽象參考。 這個類別是用來提供建置資料合約的統一方式,以參考其他資源的方式,以提供輕鬆的周遊連結。 |
|
Test |
測試套件複製要求 |
CloneOperationInformation
複製作業的詳細資料。
| 名稱 | 類型 | Description |
|---|---|---|
| cloneStatistics |
複製統計資料 |
|
| completionDate |
string |
如果作業完成,則完成的 DateTime。 如果作業未完成,則為 DateTime.MaxValue |
| creationDate |
string |
作業啟動時的 DateTime |
| destinationObject |
目的地的淺層參考 |
|
| destinationPlan |
目的地的淺層參考 |
|
| destinationProject |
目的地的淺層參考 |
|
| message |
string |
如果作業失敗,訊息會包含失敗的原因。 否則,為 Null。 |
| opId |
integer |
作業的識別碼 |
| resultObjectType |
複製作業所產生的物件型別 |
|
| sourceObject |
來源的淺層參考 |
|
| sourcePlan |
來源的淺層參考 |
|
| sourceProject |
來源的淺層參考 |
|
| state |
作業的目前狀態。 當 State 達到 Suceeded 或 Failed 時,作業就會完成 |
|
| url |
string |
取得複製資訊的 URL |
CloneOperationState
作業的目前狀態。 當 State 達到 Suceeded 或 Failed 時,作業就會完成
| 值 | Description |
|---|---|
| failed |
失敗狀態的值 |
| inProgress |
輸入狀態的值 |
| queued |
佇列狀態的值 |
| succeeded |
成功狀態的值 |
CloneOptions
| 名稱 | 類型 | Description |
|---|---|---|
| cloneRequirements |
boolean |
如果設定為 true 需求將會複製 |
| copyAllSuites |
boolean |
從來源方案複製所有套件 |
| copyAncestorHierarchy |
boolean |
複製上階 hieracrchy |
| destinationWorkItemType |
string |
複製品的工作專案類型名稱 |
| overrideParameters |
object |
索引鍵值組,其中索引鍵值會由 值覆寫。 |
| relatedLinkComment |
string |
將新複製測試案例連結至原始 Set null 的連結批註,無批註 |
CloneStatistics
| 名稱 | 類型 | Description |
|---|---|---|
| clonedRequirementsCount |
integer |
到目前為止複製的要求數目。 |
| clonedSharedStepsCount |
integer |
到目前為止複製的共用步驟數目。 |
| clonedTestCasesCount |
integer |
到目前為止複製的測試案例數目 |
| totalRequirementsCount |
integer |
要複製的需求總數 |
| totalTestCasesCount |
integer |
要複製的測試案例總數 |
ResultObjectType
複製作業所產生的物件型別
| 值 | Description |
|---|---|
| testPlan |
計畫複製 |
| testSuite |
套件複製 |
ShallowReference
其他資源的抽象參考。 這個類別是用來提供建置資料合約的統一方式,以參考其他資源的方式,以提供輕鬆的周遊連結。
| 名稱 | 類型 | Description |
|---|---|---|
| id |
string |
資源的識別碼 |
| name |
string |
連結資源的名稱 (定義名稱、控制器名稱等。) |
| url |
string |
資源的完整 HTTP 連結 |
TestSuiteCloneRequest
測試套件複製要求
| 名稱 | 類型 | Description |
|---|---|---|
| cloneOptions |
複製測試套件的複製選項。 |
|
| destinationSuiteId |
integer |
套件識別碼,我們必須複製套件。 |
| destinationSuiteProjectName |
string |
目的地套件專案名稱。 |