Condividi tramite


Test configurations

TFS 2017 | TFS 2015 | TFS 2013

Note

Looking for REST APIS that support TFS 2018 or later versions? See the Azure DevOps REST API Reference.

api-version = 3.0-preview

If you haven't already, look at the information on getting started with these APIs.

Get a list of test configurations

GET https://{instance}/DefaultCollection/{project}/_apis/test/configurations?api-version={version}[&$skip={int}&$top={int}&continuationToken={string}&includeAllProperties={boolean}]
Parameter Type Default Notes
URL
instance string TFS server name ({server:port}).
project string Name or ID of the project.
Query
api-version string Version of the API to use.
$skip int Number of test configurations to skip.
$top int Number of test configurations to return.
continuationToken string If the list of configurations returned is not complete, a continuation token to query next batch of configurations is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test configurations.
includeAllProperties boolean false If true, it returns all properties of the test configurations. Otherwise, it returns the skinny version.

Sample request

GET https://mytfsserver/DefaultCollection/fabrikam-fiber-tfvc/_apis/test/configurations?api-version=3.0-preview.2

Sample response

{
  "value": [
    {
      "id": 1,
      "name": "Windows 10",
      "url": "https://mytfsserver/DefaultCollection/fabrikam-fiber-tfvc/_apis/test/Configurations/1",
      "description": "Default operating system for testing",
      "isDefault": true,
      "state": "active"
    },
    {
      "id": 2,
      "name": "Win10 IE11",
      "url": "https://mytfsserver/DefaultCollection/fabrikam-fiber-tfvc/_apis/test/Configurations/2",
      "description": "Windows 10 - IE 11"
    },
    {
      "id": 3,
      "name": "Win10 English",
      "url": "https://mytfsserver/DefaultCollection/fabrikam-fiber-tfvc/_apis/test/Configurations/3",
      "description": ""
    }
  ],
  "count": 3
}
response header contains continuation token (considering batchSize is 3)

{
    "x-ms-continuationtoken": 4;0
}

A page at a time

Sample request

GET https://mytfsserver/DefaultCollection/fabrikam-fiber-tfvc/_apis/test/configurations?$top=5&api-version=3.0-preview.2

Sample response

{
  "value": [
    {
      "id": 1,
      "name": "Windows 10",
      "url": "https://mytfsserver/DefaultCollection/fabrikam-fiber-tfvc/_apis/test/Configurations/1",
      "description": "Default operating system for testing",
      "isDefault": true,
      "state": "active"
    },
    {
      "id": 2,
      "name": "Win10 IE11",
      "url": "https://mytfsserver/DefaultCollection/fabrikam-fiber-tfvc/_apis/test/Configurations/2",
      "description": "Windows 10 - IE 11"
    }
  ],
  "count": 2
}
response header contains continuation token (considering batchSize is 3)

{
    "x-ms-continuationtoken": 4;2
}

With continuation token

Sample request

GET https://mytfsserver/DefaultCollection/fabrikam-fiber-tfvc/_apis/test/configurations?$skip=10&$top=15&continuationToken=14;12&api-version=3.0-preview.2

Sample response

{
  "value": [
    {
      "id": 14,
      "name": "Windows 10-2",
      "url": "https://mytfsserver/DefaultCollection/fabrikam-fiber-tfvc/_apis/test/Configurations/14",
      "description": "Default operating system for testing",
      "isDefault": true,
      "state": "active"
    },
    {
      "id": 15,
      "name": "Win10 IE11-2",
      "url": "https://mytfsserver/DefaultCollection/fabrikam-fiber-tfvc/_apis/test/Configurations/15",
      "description": "Windows 10 - IE 11"
    },
    {
      "id": 16,
      "name": "Win10 English-2",
      "url": "https://mytfsserver/DefaultCollection/fabrikam-fiber-tfvc/_apis/test/Configurations/16",
      "description": ""
    }
  ],
  "count": 3
}
response header contains continuation token (considering batchSize is 3)

{
    "x-ms-continuationtoken": 17;9
}

Include all properties of the test configurations

Sample request

GET https://mytfsserver/DefaultCollection/fabrikam-fiber-tfvc/_apis/test/configurations?includeAllProperties=true&api-version=3.0-preview.1

Sample response

{
  "value": [
    {
      "id": 1,
      "name": "Windows 10",
      "url": "https://mytfsserver/DefaultCollection/fabrikam-fiber-tfvc/_apis/test/Configurations/1",
      "project": {
        "name": "fabrikam-fiber-tfvc",
        "url": "https://mytfsserver/DefaultCollection/_apis/projects/fabrikam-fiber-tfvc"
      },
      "description": "Default operating system for testing",
      "lastUpdatedBy": {
        "id": "e5a5f7f8-6507-4c34-b397-6c4818e002f4",
        "displayName": "Fabrikam Fiber",
        "uniqueName": "fabrikamfiber1@outlook.com",
        "url": "https://mytfsserver/DefaultCollection/_apis/Identities/e5a5f7f8-6507-4c34-b397-6c4818e002f4",
        "imageUrl": "https://mytfsserver/DefaultCollection/_api/_common/identityImage?id=e5a5f7f8-6507-4c34-b397-6c4818e002f4"
      },
      "lastUpdatedDate": "2015-12-23T05:21:26.42Z",
      "area": {
        "name": "fabrikam-fiber-tfvc"
      },
      "isDefault": true,
      "revision": 1,
      "values": [
        {
          "name": "Operating System",
          "value": "Windows 10"
        }
      ],
      "state": "active"
    },
    {
      "id": 2,
      "name": "Win10 IE11",
      "url": "https://mytfsserver/DefaultCollection/fabrikam-fiber-tfvc/_apis/test/Configurations/2",
      "project": {
        "name": "fabrikam-fiber-tfvc",
        "url": "https://mytfsserver/DefaultCollection/_apis/projects/fabrikam-fiber-tfvc"
      },
      "description": "Windows 10 - IE 11",
      "lastUpdatedBy": {
        "id": "e5a5f7f8-6507-4c34-b397-6c4818e002f4",
        "displayName": "Fabrikam Fiber",
        "uniqueName": "fabrikamfiber1@outlook.com",
        "url": "https://mytfsserver/DefaultCollection/_apis/Identities/e5a5f7f8-6507-4c34-b397-6c4818e002f4",
        "imageUrl": "https://mytfsserver/DefaultCollection/_api/_common/identityImage?id=e5a5f7f8-6507-4c34-b397-6c4818e002f4"
      },
      "lastUpdatedDate": "2015-12-23T05:49:13.94Z",
      "area": {
        "name": "fabrikam-fiber-tfvc"
      },
      "revision": 2,
      "values": [
        {
          "name": "Operating System",
          "value": "Windows 10"
        },
        {
          "name": "Renamed Language",
          "value": "English - US"
        }
      ]
    },
    {
      "id": 3,
      "name": "Win10 English",
      "url": "https://mytfsserver/DefaultCollection/fabrikam-fiber-tfvc/_apis/test/Configurations/3",
      "project": {
        "name": "fabrikam-fiber-tfvc",
        "url": "https://mytfsserver/DefaultCollection/_apis/projects/fabrikam-fiber-tfvc"
      },
      "description": "",
      "lastUpdatedBy": {
        "id": "e5a5f7f8-6507-4c34-b397-6c4818e002f4",
        "displayName": "Fabrikam Fiber",
        "uniqueName": "fabrikamfiber1@outlook.com",
        "url": "https://mytfsserver/DefaultCollection/_apis/Identities/e5a5f7f8-6507-4c34-b397-6c4818e002f4",
        "imageUrl": "https://mytfsserver/DefaultCollection/_api/_common/identityImage?id=e5a5f7f8-6507-4c34-b397-6c4818e002f4"
      },
      "lastUpdatedDate": "2015-12-23T05:52:48.167Z",
      "area": {
        "name": "fabrikam-fiber-tfvc\\QA"
      },
      "revision": 2,
      "values": [
        {
          "name": "Operating System",
          "value": "Windows 10"
        },
        {
          "name": "Renamed Language",
          "value": "English - US"
        }
      ]
    }
  ],
  "count": 3
}

Get a test configuration

GET https://{instance}/DefaultCollection/{project}/_apis/test/configurations/{configurationId}?api-version={version}
Parameter Type Notes
URL
instance string TFS server name ({server:port}).
project string Name or ID of the project.
configurationId int ID of the test configuration to get.
Query
api-version string Version of the API to use.

Sample request

GET https://mytfsserver/DefaultCollection/fabrikam-fiber-tfvc/_apis/test/configurations/1?api-version=3.0-preview.1

Sample response

{
  "id": 1,
  "name": "Windows 10",
  "url": "https://mytfsserver/DefaultCollection/fabrikam-fiber-tfvc/_apis/test/Configurations/1",
  "project": {
    "name": "fabrikam-fiber-tfvc",
    "url": "https://mytfsserver/DefaultCollection/_apis/projects/fabrikam-fiber-tfvc"
  },
  "description": "Default operating system for testing",
  "lastUpdatedBy": {
    "id": "e5a5f7f8-6507-4c34-b397-6c4818e002f4",
    "displayName": "Fabrikam Fiber",
    "uniqueName": "fabrikamfiber1@outlook.com",
    "url": "https://mytfsserver/DefaultCollection/_apis/Identities/e5a5f7f8-6507-4c34-b397-6c4818e002f4",
    "imageUrl": "https://mytfsserver/DefaultCollection/_api/_common/identityImage?id=e5a5f7f8-6507-4c34-b397-6c4818e002f4"
  },
  "lastUpdatedDate": "2015-12-23T05:21:26.42Z",
  "area": {
    "name": "fabrikam-fiber-tfvc"
  },
  "isDefault": true,
  "revision": 1,
  "values": [
    {
      "name": "Operating System",
      "value": "Windows 10"
    }
  ],
  "state": "active"
}

Create a test configuration

POST https://{instance}/DefaultCollection/{project}/_apis/test/configurations?api-version={version}
Content-Type: application/json
{
  "name": {string},
  "description": {string},
  "values": {NameValuePair}
  "area": {string},
  "state": {
	enum { Active, Inactive }
	}
}
Parameter Type Default Notes
URL
instance string TFS server name ({server:port}).
project string Name or ID of the project.
Query
api-version string Version of the API to use.
Body
name string Name of the new test configuration.
description string Description of the new test configuration.
values NameValuePair An array of test variable name and corresponding selected value pairs.
area string Project root area Name of the area under which the configuration is created.
state enum { Active, Inactive } Active State of the test configuration.

Sample request

POST https://mytfsserver/DefaultCollection/fabrikam-fiber-tfvc/_apis/test/configurations?api-version=3.0-preview.1
{
  "name": "Win10 IE11",
  "description": "Windows 10 - IE 11",
  "values": [
    {
      "name": "Operating System",
      "value": "Windows 10"
    },
    {
      "name": "Browser",
      "value": "Internet Explorer 11.0"
    }
  ]
}

Sample response

{
  "id": 2,
  "name": "Win10 IE11",
  "url": "https://mytfsserver/DefaultCollection/fabrikam-fiber-tfvc/_apis/test/Configurations/2",
  "project": {
    "name": "fabrikam-fiber-tfvc",
    "url": "https://mytfsserver/DefaultCollection/_apis/projects/fabrikam-fiber-tfvc"
  },
  "description": "Windows 10 - IE 11",
  "lastUpdatedBy": {
    "id": "e5a5f7f8-6507-4c34-b397-6c4818e002f4",
    "displayName": "Fabrikam Fiber",
    "uniqueName": "fabrikamfiber1@outlook.com",
    "url": "https://mytfsserver/DefaultCollection/_apis/Identities/e5a5f7f8-6507-4c34-b397-6c4818e002f4",
    "imageUrl": "https://mytfsserver/DefaultCollection/_api/_common/identityImage?id=e5a5f7f8-6507-4c34-b397-6c4818e002f4"
  },
  "lastUpdatedDate": "2015-12-23T05:49:13.8Z",
  "area": {
    "name": "fabrikam-fiber-tfvc"
  },
  "revision": 1,
  "values": [
    {
      "name": "Operating System",
      "value": "Windows 10"
    },
    {
      "name": "Browser",
      "value": "Internet Explorer 11.0"
    }
  ]
}

With Area

Sample request

POST https://mytfsserver/DefaultCollection/fabrikam-fiber-tfvc/_apis/test/configurations?api-version=3.0-preview.1
{
  "name": "Win10 English",
  "values": [
    {
      "name": "Operating System",
      "value": "Windows 10"
    },
    {
      "name": "Renamed Language",
      "value": "English - US"
    }
  ],
  "area": {
    "name": "fabrikam-fiber-tfvc\\QA"
  }
}

Sample response

{
  "id": 3,
  "name": "Win10 English",
  "url": "https://mytfsserver/DefaultCollection/fabrikam-fiber-tfvc/_apis/test/Configurations/3",
  "project": {
    "name": "fabrikam-fiber-tfvc",
    "url": "https://mytfsserver/DefaultCollection/_apis/projects/fabrikam-fiber-tfvc"
  },
  "description": "",
  "lastUpdatedBy": {
    "id": "e5a5f7f8-6507-4c34-b397-6c4818e002f4",
    "displayName": "Fabrikam Fiber",
    "uniqueName": "fabrikamfiber1@outlook.com",
    "url": "https://mytfsserver/DefaultCollection/_apis/Identities/e5a5f7f8-6507-4c34-b397-6c4818e002f4",
    "imageUrl": "https://mytfsserver/DefaultCollection/_api/_common/identityImage?id=e5a5f7f8-6507-4c34-b397-6c4818e002f4"
  },
  "lastUpdatedDate": "2015-12-23T05:52:48.11Z",
  "area": {
    "name": "fabrikam-fiber-tfvc\\QA"
  },
  "revision": 1,
  "values": [
    {
      "name": "Operating System",
      "value": "Windows 10"
    },
    {
      "name": "Renamed Language",
      "value": "English - US"
    }
  ]
}

Update a test configuration

PATCH https://{instance}/DefaultCollection/{project}/_apis/test/configurations/{configurationId}?api-version={version}
Content-Type: application/json
{
  "name": {string},
  "description": {string},
  "values": {NameValuePair},
  "area": {string},
  "state": {
	enum { Active, Inactive }
	}
}
Parameter Type Default Notes
URL
instance string TFS server name ({server:port}).
project string Name or ID of the project.
configurationId int ID of the test configuration to update.
Query
api-version string Version of the API to use.
Body
name string Name of the test configuration.
description string Description of the test configuration.
values NameValuePair An array of test variable name and corresponding selected value pairs.
area string Project root area Name of the area under which the configuration is created.
state enum { Active, Inactive } Active State of the test configuration.

Sample request

PATCH https://mytfsserver/DefaultCollection/fabrikam-fiber-tfvc/_apis/test/configurations/3?api-version=3.0-preview.1
{
  "values": [
    {
      "name": "Operating System",
      "value": "Windows 10"
    },
    {
      "name": "Renamed Language",
      "value": "English - US"
    }
  ]
}

Sample response

{
  "id": 3,
  "name": "Win10 English",
  "url": "https://mytfsserver/DefaultCollection/fabrikam-fiber-tfvc/_apis/test/Configurations/3",
  "project": {
    "name": "fabrikam-fiber-tfvc",
    "url": "https://mytfsserver/DefaultCollection/_apis/projects/fabrikam-fiber-tfvc"
  },
  "description": "",
  "lastUpdatedBy": {
    "id": "e5a5f7f8-6507-4c34-b397-6c4818e002f4",
    "displayName": "Fabrikam Fiber",
    "uniqueName": "fabrikamfiber1@outlook.com",
    "url": "https://mytfsserver/DefaultCollection/_apis/Identities/e5a5f7f8-6507-4c34-b397-6c4818e002f4",
    "imageUrl": "https://mytfsserver/DefaultCollection/_api/_common/identityImage?id=e5a5f7f8-6507-4c34-b397-6c4818e002f4"
  },
  "lastUpdatedDate": "2015-12-23T05:52:48.167Z",
  "area": {
    "name": "fabrikam-fiber-tfvc\\QA"
  },
  "revision": 2,
  "values": [
    {
      "name": "Operating System",
      "value": "Windows 10"
    },
    {
      "name": "Renamed Language",
      "value": "English - US"
    }
  ]
}

Delete a test configuration

DELETE https://{instance}/DefaultCollection/{project}/_apis/test/configurations/{configurationId}?api-version={version}
Parameter Type Notes
URL
instance string TFS server name ({server:port}).
project string Name or ID of the project.
configurationId int ID of the test configuration to get.
Query
api-version string Version of the API to use.

Sample request

DELETE https://mytfsserver/DefaultCollection/fabrikam-fiber-tfvc/_apis/test/configurations/3?api-version=3.0-preview.1