- 概述
- UiPath CLI
- Azure DevOps 扩展程序
- Jenkins 插件
CI/CD 集成用户指南
先决条件
- 创建包或测试集。
- 运行 CLI
exe(对于 Windows 旧版)或dll(对于 Windows/Linux/macOS)文件。 - 添加所需的 Orchestrator API 访问应用程序作用域。
要测试包,请执行以下步骤:
- 使用
uipcli test运行test任务。您可以注意可用子任务的列表。 - 指定所需的参数并运行
run子任务。下表介绍了必需参数:
| 参数 | 描述 |
|---|---|
Orchestrator URL (pos. 0) (必填) | Orchestrator 实例的 URL。 |
Orchestrator Tenant (pos. 1) | 包或测试集所在的租户。以Automation Cloud为目标时为必需。对于Automation Suite和独立 Orchestrator (内部部署 MSI)为可选,其中租户是 URL 的一部分。 |
-P , or --project-path | 要测试的测试包文件的路径。 |
-s , or --testset | 要执行的测试集的显示名称。确保测试集包含最新版本的测试用例。如果项目未设置默认文件夹,请确保在测试集级别分配一个测试文件夹。 |
--out | 结果文件 \<junit|uipath\> 的类型。 |
-r , or --result_path | 要存储结果的文件的目标路径。 |
-e 或--environment (传统文件夹为必要项) | 要部署包的环境。您必须将它与project path配对。 |
-w , or --timeout | 等待测试集执行的时间(以秒为单位)。默认值为7200 秒(72 秒) 。 |
-i 或--input_path (如果入口点工作流具有要通过命令行传递的输入参数,则为必填项) | json 输入文件的完整路径。有关文件结构的详细信息,请参阅输入参数 JSON 格式。 |
--attachRobotLogs | 附加每个已执行测试用例的机器人日志和 JUnit 测试报告。 |
|
| 项目进行版本控制时所在的存储库 URL。 |
|
| 从中提交构建项目的存储库。 |
|
| 从中构建项目的存储库分支。 |
|
| VCS 系统存储库类型。 |
|
| Automation Hub 概念 URL。 |
--releaseNotes | 添加发行说明。 |
--author | 包作者。 |
--nugetConfigFilePath | 包含订阅源的 NuGet.Config 文件的路径。系统将忽略指定文件中的<clear />标签,仅考虑来源。 |
--disableBuiltInNugetFeeds | 禁用内置 NuGet 订阅源。 |
--excludeConfiguredSources | 不包括内置订阅源以及在运行 CLI 的主机上在用户和计算机级别配置的 NuGet 源。CLI 仅解析--nugetConfigFilePath中定义的订阅源中的包。请参阅管理 NuGet 订阅源。 |
|
| 失败的测试用例的重试次数(默认情况下,未设置重试次数)。 |
-u 或--username (如果通过用户名和密码使用基本身份验证,则为必需) | 用于向 Orchestrator 进行身份验证的用户名。 您必须将其与相应的密码配对。 |
-p 或--password (如果通过用户名和密码使用基本身份验证,则为必需) | 用于对 Orchestrator 进行身份验证的密码。您必须将其与相应的用户名配对。 |
-t 或--token (如果使用 基于令牌的身份验证 , 则为必填项 ) | 用于对 Orchestrator 进行身份验证的OAuth2 刷新令牌。您必须将其与帐户名称和客户端 ID配对。 |
-a 或--accountName (如果使用 基于令牌的身份验证 , 则为必填项 ) | Orchestrator CloudRPA 帐户名称。您必须将其与OAuth2 刷新令牌和客户端 ID配对。 |
-A , --accountForApp | Orchestrator CloudRPA 帐户名称(组织名称)。您必须将其与外部应用程序的应用程序 ID、应用程序密码和应用程序作用域配对。 |
-I 或--applicationId (如果使用 外部应用程序身份验证 , 则为必填项 ) | 外部应用程序 ID。您必须将其与“应用程序帐户”、“应用程序密码”和“应用程序作用域”配对。 |
-S 或--applicationSecret (如果使用 外部应用程序身份验证 , 则为必填项 ) | 外部应用程序密码。您必须将其与“应用程序帐户”、“应用程序 ID”和“应用程序作用域”配对。 |
--applicationScope (对于 外部应用程序身份验证, 为 可选项 ) | 应用程序作用域列表,以单个空格分隔。在使用外部应用程序身份验证时为可选,因为系统会自动应用默认作用域。您必须将其与外部应用程序的“应用程序账号”、 “应用程序 ID”和“应用程序密码”配对 |
-o , or --organizationUnit | 要在其中执行测试集的 Orchestrator 文件夹。 |
-l , or --language | Orchestrator 用户界面中使用的语言。 |
|
| 显示事件的跟踪。 |
--identityUrl | 身份服务器的 URL。当 Orchestrator 在UiPath Automation Suite或独立 Orchestrator (内部部署 MSI)上运行时为必需。Automation Cloud不需要 — CLI 从云 URL 解析身份服务器。 |
--ca-cert | 验证 Orchestrator 和 Identity Server TLS 证书时使用的一个或多个受信任的根 CA 证书文件(PEM、DER 或 PKCS#7)。重复标记或用逗号分隔多个路径。有关详细信息,请参阅信任自定义证书。 |
--pinnedpubkey | 固定服务器叶证书的公钥。格式: sha256//<base64> 。除标准证书验证以外进行检查。有关详细信息,请参阅信任自定义证书。 |
对于私有证书颁发机构签名的 Orchestrator 实例(例如 UiPath Automation Suite),此命令也接受--ca-cert和--pinnedpubkey参数。有关场景和示例,请参阅信任自定义证书。
在不指定--applicationScope参数的情况下使用外部应用程序身份验证时,CLI 会自动应用这些默认的 Orchestrator 作用域:
OR.Assets OR.BackgroundTasks OR.Execution OR.Folders OR.Robots.Read OR.Machines.Read OR.Jobs OR.TestSets OR.TestSetExecutions OR.Monitoring OR.Settings.Read
有关 Test Manager 操作,请参阅在使用不同默认作用域的Test Manager 中测试包或运行测试集。
用法: **
uipcli test run <orchestrator_url> <orchestrator_tenant> [-i <input_path>] [-P <project_json_path>] [-s <testset_name>] [-u <orchestrator_user> -p <orchestrator_pass>] [-t <auth_token> -a <account_name>] [-A <organization_name> -I <application_id> -S <application_secret> --applicationScope <application_scope>] [-e <environment>] [-o <folder_name>] [-l <language>] [--out <junit|uipath>] [--result_path <result_path>] [--timeout <seconds>] [--attachRobotLogs true] [--repositoryUrl <repository_url>] [--repositoryCommit <repository_commit>] [--repositoryBranch <repository_branch>] [--repositoryType <repository_type>] [--projectUrl <automation_hub_idea_url>] [--releaseNotes <release_notes>] [--disableBuiltInNugetFeeds] [--retryCount <number>] [--traceLevel <None|Critical|Error|Warning|Information|Verbose>] [--identityUrl <identityUrl>]
uipcli test run <orchestrator_url> <orchestrator_tenant> [-i <input_path>] [-P <project_json_path>] [-s <testset_name>] [-u <orchestrator_user> -p <orchestrator_pass>] [-t <auth_token> -a <account_name>] [-A <organization_name> -I <application_id> -S <application_secret> --applicationScope <application_scope>] [-e <environment>] [-o <folder_name>] [-l <language>] [--out <junit|uipath>] [--result_path <result_path>] [--timeout <seconds>] [--attachRobotLogs true] [--repositoryUrl <repository_url>] [--repositoryCommit <repository_commit>] [--repositoryBranch <repository_branch>] [--repositoryType <repository_type>] [--projectUrl <automation_hub_idea_url>] [--releaseNotes <release_notes>] [--disableBuiltInNugetFeeds] [--retryCount <number>] [--traceLevel <None|Critical|Error|Warning|Information|Verbose>] [--identityUrl <identityUrl>]
示例
uipcli test run "https://orch-23-10-paas.cloudapp.azure.com/" "TenantName" -u "orchestratorUsername" -p "********" -o "FolderName" --traceLevel Information -P "C:\userprofile\AutomationProjectWithTestCases\project.json" "C:\userprofile\AutomationProjectWithTestCases\project.json"uipcli test run "https://orch-23-10-paas.cloudapp.azure.com/" "TenantName" -I "76000552-3e4f-4590-9317-cdb420001f1d" -S '********' --applicationScope "OR.Folders OR.BackgroundTasks OR.TestSets OR.TestSetExecutions OR.TestSetSchedules OR.Settings.Read OR.Robots.Read OR.Machines.Read OR.Execution OR.Assets OR.Users.Read OR.Jobs OR.Monitoring" --identityUrl "https://orch-23-10-paas.cloudapp.azure.com/identity" -o "FolderName" --traceLevel Information -P "C:\userprofile\AutomationProjectWithTestCases\project.json"uipcli test run "https://automation-suite.base.url.com/" "TenantName" -A "organizationName" -I "3f6239b9-e0e8-465e-a429-d9ffd1d9e57a" -S '********' --applicationScope "OR.Folders OR.BackgroundTasks OR.TestSets OR.TestSetExecutions OR.TestSetSchedules OR.Settings.Read OR.Robots.Read OR.Machines.Read OR.Execution OR.Assets OR.Users.Read OR.Jobs OR.Monitoring" -o "FolderName" --traceLevel Information -P "C:\userprofile\AutomationProjectWithTestCases\project.json"uipcli test run "https://cloud.uipath.com/" "TenantName" -A "organizationName" -I "becc663c-8f1e-409a-a75f-c00330d80bc8" -S "********" --applicationScope "OR.Folders OR.BackgroundTasks OR.TestSets OR.TestSetExecutions OR.TestSetSchedules OR.Settings.Read OR.Robots.Read OR.Machines.Read OR.Execution OR.Assets OR.Users.Read OR.Jobs OR.Monitoring" -o "FolderName" --traceLevel Information -P "C:\userprofile\AutomationProjectWithTestCases\project.json" --author ExampleAuthor