Test Suite 用户指南
Test Manager SDK 入门
本主题中描述的授权方法提供有关如何在 Test Manager 与您的应用程序或其他合作伙伴应用程序之间建立服务到服务连接的信息。
- 在 Orchestrator 中启用测试自动化。有关更多信息,请参阅“启用/禁用功能”。
- 在 Orchestrator 身份管理中生成安装令牌。您将需要通过命令行进行配置。要获取 Orchestrator 身份访问令牌,请参阅“生成安装访问令牌”。
您可以根据 UiPath 产品基础架构中使用的版本的特定用例,在两种配置外部 OAuth 客户端的方法之间进行选择:
- 如果您同时运行 Test Manager 和 Orchestrator 版本 21.4 或更高版本,则可以使用“通过身份管理配置”。
- 如果您运行 Test Manager 版本 21.4 和 Orchestrator 版本 20.10,或者要启用跨租户访问,则可以通过 Test Manager CLI 使用配置。
您可以在身份管理中注册应用程序,定义 Test Manager 作用域并在应用程序之间建立连接。
要配置和授权您的应用程序,您需要添加外部应用程序。
定义集成的作用域时,选择“Test Manager”作为“资源”。有关详细信息,请参阅“作用域”。
通过 Test Manager CLI 授权,您可以配置客户端,分配作用域,然后在应用程序之间建立服务到服务连接。
要将应用程序与 Test Manager 集成并开始使用,您需要配置授权:配置客户端和作用域,然后获取客户端 ID 和客户端密码。
要在 Test Manager 和应用程序之间建立服务到服务连接,您将使用 Test Manager 配置工具作为主要 CLI 工具,以获取客户端,为集成提供访问权限和作用域。您可以在默认安装位置中找到与每个版本一起打包的此工具 testmanager.exe,如下所示:
C:\Program Files
(x86)\UiPath\TestManager\Tools\TestManagerProvisioner
。
或者,您可以在自定义安装文件夹中找到可执行文件。有关集成范围之外的命令和选项列表,请参阅“Test Manager 配置工具备忘单”。
以下部分列出了可用的命令行参数,包括选项和默认值,以便您配置访问权限和作用域,然后获取应用程序的客户端 ID 和客户端密码。
- 根据先决条件部分的要求,您将需要通过 Orchestrator 身份管理生成的安装令牌。
- 您需要定义 Test Manager 作用域。
命令 |
选项 |
描述 |
---|---|---|
|
-iu, --identityUrl (必填项)
|
Identity Server 所在的绝对 URL。 |
-iit, --identityInstallationToken
<identityinstallationtoken> (必填项)
|
用于在 Identity Server 中预配客户端的认证令牌。 | |
cscopes, --clientScopes <clientscopes> (必填项)
|
显示创建客户端时要使用的客户端作用域。 | |
`-cid, --clientID <客户端 ID>` |
显示创建客户端时要使用的客户端 ID。如果您不提供客户端 ID,系统会自动将其生成。 | |
|
显示创建客户端时要使用的客户端名称。如果您不提供客户端名称,则会自动生成此字段。 | |
|
显示创建客户端时要使用的客户端密码。如果您不提供客户端密码,系统会自动将其生成 | |
|
指定错误消息的语言。 | |
|
显示帮助和用法信息。 |
register third-party-s2sclient
命令后跟 Orchestrator 身份 URL、身份安装令牌和 Test Manager 项目作用域。
testmanager.exe <code>
register third-party-s2sclient</code>
-iu "https://orchestratorURL/identity" <code>
-iit "e908741iofjikasjijfapuosf09210-012opjawdfsaodgfsadgu90029183i1jiratjapo" </code>
-cscopes "TM.Projects" "TM.Requirements.Read"
Client created successfully. Please note the data below right away. You will not be able to retrieve the secret afterwards.
ClientID: TestManager.ThirdPartyClient.36512487-1rfasdf-11451-321535
ClientName: TestManager.ThirdPartyClient.36512487-1rfasdf-11451-321535
ClientSecret: 43sdgj@efg145!fgdsg53125sfdg12a*gbj9
testmanager.exe <code>
register third-party-s2sclient</code>
-iu "https://orchestratorURL/identity" <code>
-iit "e908741iofjikasjijfapuosf09210-012opjawdfsaodgfsadgu90029183i1jiratjapo" </code>
-cscopes "TM.Projects" "TM.Requirements.Read"
Client created successfully. Please note the data below right away. You will not be able to retrieve the secret afterwards.
ClientID: TestManager.ThirdPartyClient.36512487-1rfasdf-11451-321535
ClientName: TestManager.ThirdPartyClient.36512487-1rfasdf-11451-321535
ClientSecret: 43sdgj@efg145!fgdsg53125sfdg12a*gbj9
https://[test-manager-URL.com]/api/projects
Headers
Content-Type: application/json
Authorization: "Bearer [Oauth Access Token]"Content-Type: application/json<code> </code>{
"data": [
{
"projectPrefix": "INS",
"id": "96a80aa7-5a7f-4117-c342-08d7add64671",
"name": "Insurance Calculator",
"description": "\)\)"The virtual insurance calculator creates sample quotes for different types of insurance.\)\)"",
"created": "2020-02-10T07:07:33.167Z",
"createdBy": "74dde091-4a16-4225-aea9-5c3a27b2d996",
"updated": "2020-02-10T07:07:33.167Z",
"updatedBy": "74dde091-4a16-4225-aea9-5c3a27b2d996"
},
{
"projectPrefix": "ELI",
"id": "609f7c5b-c798-46b1-c343-08d7add64671",
"name": "Eligibility",
"description": "Eligibility for credit",
"created": "2020-02-10T09:24:18.63Z",
"createdBy": "74dde091-4a16-4225-aea9-5c3a27b2d996",
"updated": "2020-02-10T09:24:18.63Z",
"updatedBy": "74dde091-4a16-4225-aea9-5c3a27b2d996"
}
],
"paging": {
"total": 2,
"page": 1,
"pages": 1,
"pageSize": 12,
"returned": 2,
"previousPage": false,
"nextPage": false
}
}
Headers
Content-Type: application/json
Authorization: "Bearer [Oauth Access Token]"Content-Type: application/json<code> </code>{
"data": [
{
"projectPrefix": "INS",
"id": "96a80aa7-5a7f-4117-c342-08d7add64671",
"name": "Insurance Calculator",
"description": "\)\)"The virtual insurance calculator creates sample quotes for different types of insurance.\)\)"",
"created": "2020-02-10T07:07:33.167Z",
"createdBy": "74dde091-4a16-4225-aea9-5c3a27b2d996",
"updated": "2020-02-10T07:07:33.167Z",
"updatedBy": "74dde091-4a16-4225-aea9-5c3a27b2d996"
},
{
"projectPrefix": "ELI",
"id": "609f7c5b-c798-46b1-c343-08d7add64671",
"name": "Eligibility",
"description": "Eligibility for credit",
"created": "2020-02-10T09:24:18.63Z",
"createdBy": "74dde091-4a16-4225-aea9-5c3a27b2d996",
"updated": "2020-02-10T09:24:18.63Z",
"updatedBy": "74dde091-4a16-4225-aea9-5c3a27b2d996"
}
],
"paging": {
"total": 2,
"page": 1,
"pages": 1,
"pageSize": 12,
"returned": 2,
"previousPage": false,
"nextPage": false
}
}
https://[test-manager-URL.com]/api/projects
Headers
Content-Type: application/json
Authorization: "Bearer [Oauth Access Token]"
X-UiPath-TenantGlobalId: [Tenant ID]Content-Type: application/json
{
"data": [
{
"projectPrefix": "INS",
"id": "96a80aa7-5a7f-4117-c342-08d7add64671",
"name": "Insurance Calculator",
"description": "\)\)"The virtual insurance calculator creates sample quotes for different types of insurance.\)\)"",
"created": "2020-02-10T07:07:33.167Z",
"createdBy": "74dde091-4a16-4225-aea9-5c3a27b2d996",
"updated": "2020-02-10T07:07:33.167Z",
"updatedBy": "74dde091-4a16-4225-aea9-5c3a27b2d996"
},
{
"projectPrefix": "ELI",
"id": "609f7c5b-c798-46b1-c343-08d7add64671",
"name": "Eligibility",
"description": "Eligibility for credit",
"created": "2020-02-10T09:24:18.63Z",
"createdBy": "74dde091-4a16-4225-aea9-5c3a27b2d996",
"updated": "2020-02-10T09:24:18.63Z",
"updatedBy": "74dde091-4a16-4225-aea9-5c3a27b2d996"
}
],
"paging": {
"total": 2,
"page": 1,
"pages": 1,
"pageSize": 12,
"returned": 2,
"previousPage": false,
"nextPage": false
}
}
Headers
Content-Type: application/json
Authorization: "Bearer [Oauth Access Token]"
X-UiPath-TenantGlobalId: [Tenant ID]Content-Type: application/json
{
"data": [
{
"projectPrefix": "INS",
"id": "96a80aa7-5a7f-4117-c342-08d7add64671",
"name": "Insurance Calculator",
"description": "\)\)"The virtual insurance calculator creates sample quotes for different types of insurance.\)\)"",
"created": "2020-02-10T07:07:33.167Z",
"createdBy": "74dde091-4a16-4225-aea9-5c3a27b2d996",
"updated": "2020-02-10T07:07:33.167Z",
"updatedBy": "74dde091-4a16-4225-aea9-5c3a27b2d996"
},
{
"projectPrefix": "ELI",
"id": "609f7c5b-c798-46b1-c343-08d7add64671",
"name": "Eligibility",
"description": "Eligibility for credit",
"created": "2020-02-10T09:24:18.63Z",
"createdBy": "74dde091-4a16-4225-aea9-5c3a27b2d996",
"updated": "2020-02-10T09:24:18.63Z",
"updatedBy": "74dde091-4a16-4225-aea9-5c3a27b2d996"
}
],
"paging": {
"total": 2,
"page": 1,
"pages": 1,
"pageSize": 12,
"returned": 2,
"previousPage": false,
"nextPage": false
}
}