cicd-integrations
2025.10
true
CI/CD 集成用户指南
- 概述
- UiPath CLI
- Azure DevOps 扩展程序
- Jenkins 插件
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。
新发布内容的本地化可能需要 1-2 周的时间才能完成。
UiPath 测试
用于通过 Azure DevOps 运行测试集和测试用例的 UiPath 测试任务配置。
通常, UiPath 测试任务在 Orchestrator 上运行现有测试集。此外,您可以通过指定 UiPath 测试项目的路径,将其用于打包、部署和运行测试用例。
任务执行完成后,测试结果将上传到 Azure DevOps 中的“测试”选项卡。您可以 JUnit 格式指定测试结果输出路径。
根据结果,构建将被标记为成功(所有测试用例都通过)或失败(至少一个测试用例失败)。
配置
使用下表配置 UiPath 测试输入。
| 参数 | 描述 |
|---|---|
| 显示名称是必填项 | 输入租户的名称。 |
| 选择测试执行方法 | 选择要执行的测试:执行测试集:在 Test Manager 或 Orchestrator 中指定并运行现有测试集。在项目中执行测试:指定项目,部署包并运行测试用例。 |
| 需要 Orchestrator 连接。 | 配置服务连接以访问 UiPath Orchestrator 服务。您只能为此步骤配置连接,也可以使用现有的全局连接。有关更多信息,请参阅“配置 UiPath Orchestrator 服务连接”。 |
| 项目键(仅适用于 Test Manager) | 在 Test Manager 中指定项目键(也称为项目前缀)。在 Test Manager 中执行测试时为必需。为 Orchestrator 测试模块留空。 |
| 输入参数 | 指定 JSON 输入文件的文件路径,例如Input\jobParameters.json 。 如果要在测试集级别创建新输入参数,请指定type参数。 否则,您可以使用name和value 。 |
| 测试集(执行测试集方法需要) | 要执行的测试集的显示名称或键。确保测试集包含最新版本的测试用例。如果测试集不在默认文件夹中,请确保在其前面添加相关文件夹名称。例如,使用AccountingTeam\TestSet 。 |
| 测试项目路径(在项目方法中执行测试需要) | 指定将要执行的测试项目位置。 |
| 环境(在项目方法中执行测试需要) | 如果使用传统文件夹(已弃用),则需要定义将要部署包的环境。您可以使用此字段创建或更新包。您可以使用以下示例将环境添加到此字段,以逗号分隔:testingEnvironment, productionEnvironment。 |
| Orchestrator 文件夹(必需) | 指定正在部署流程的文件夹。对于传统文件夹,您可以使用指定的机器人名称。对于新式文件夹,您可以使用指定的用户和计算机名称。 要输入子文件夹,请确保同时输入父文件夹的名称和子文件夹的名称。例如,AccountingTeam\TeamJohn。 |
| 测试结果输出路径 | 以 JUnit 格式(例如Output\testResults.json)指定测试结果输出路径。 |
| 超时 | 指定请求超时前要等待的秒数。 |
| 追踪级别 | 从下拉列表中选择用户。 |
| 附加机器人日志 | 选择此选项可附加正在执行的机器人中的 INFO 级别日志。默认情况下,此选项处于取消选中状态。有关更多信息,请参阅“机器人日志”。 |
YAML 管道
您可以为 UiPath 测试预览完全解析的 YAML 文档。
示例:从 Orchestrator 执行测试集
- task: UiPathTest@6
displayName: 'Run Orchestrator Test Set'
inputs:
testTarget: TestSet
orchestratorConnection: 'uipath-orchestrator-connection'
testSet: 'MobileAutomationTests'
folderName: 'MobileAutomationTesting'
testReportDestination: '$(Build.ArtifactStagingDirectory)\report.xml'
timeout: 3600
traceLevel: 'Information'
- task: UiPathTest@6
displayName: 'Run Orchestrator Test Set'
inputs:
testTarget: TestSet
orchestratorConnection: 'uipath-orchestrator-connection'
testSet: 'MobileAutomationTests'
folderName: 'MobileAutomationTesting'
testReportDestination: '$(Build.ArtifactStagingDirectory)\report.xml'
timeout: 3600
traceLevel: 'Information'
示例:从 Test Manager 执行测试集
- task: UiPathTest@6
displayName: 'Run Test Manager Test Set'
inputs:
testTarget: TestSet
orchestratorConnection: 'uipath-orchestrator-connection'
projectKey: 'PROJ' # Test Manager project key (Project Prefix)
testSet: 'TS-123' # Test Manager test set key
folderName: 'TestManagerFolder'
testReportDestination: '$(Build.ArtifactStagingDirectory)\testmanager-results.xml'
timeout: 3600
attachRobotLogs: true
traceLevel: 'Information'
- task: UiPathTest@6
displayName: 'Run Test Manager Test Set'
inputs:
testTarget: TestSet
orchestratorConnection: 'uipath-orchestrator-connection'
projectKey: 'PROJ' # Test Manager project key (Project Prefix)
testSet: 'TS-123' # Test Manager test set key
folderName: 'TestManagerFolder'
testReportDestination: '$(Build.ArtifactStagingDirectory)\testmanager-results.xml'
timeout: 3600
attachRobotLogs: true
traceLevel: 'Information'
示例:执行测试项目
- task: UiPathTest@6
displayName: 'Run Test Project'
inputs:
testTarget: TestProject
orchestratorConnection: 'uipath-orchestrator-connection'
testProjectPath: '$(Build.SourcesDirectory)\MobileAutomationTests'
folderName: 'MobileAutomationTesting'
environment: 'TestingRobots' # Required only for classic folders
testReportDestination: '$(Build.ArtifactStagingDirectory)\test-results.xml'
timeout: 3600
traceLevel: 'Information'
- task: UiPathTest@6
displayName: 'Run Test Project'
inputs:
testTarget: TestProject
orchestratorConnection: 'uipath-orchestrator-connection'
testProjectPath: '$(Build.SourcesDirectory)\MobileAutomationTests'
folderName: 'MobileAutomationTesting'
environment: 'TestingRobots' # Required only for classic folders
testReportDestination: '$(Build.ArtifactStagingDirectory)\test-results.xml'
timeout: 3600
traceLevel: 'Information'
示例:具有项目执行权限的 Test Manager
- task: UiPathTest@6
displayName: 'Run Test Manager Project'
inputs:
testTarget: TestProject
orchestratorConnection: 'uipath-orchestrator-connection'
projectKey: 'PROJ' # Test Manager project key
testProjectPath: '$(Build.SourcesDirectory)\TestProject'
folderName: 'TestManagerFolder'
parametersFilePath: '$(Build.SourcesDirectory)\test-params.json'
testReportDestination: '$(Build.ArtifactStagingDirectory)\tm-project-results.xml'
attachRobotLogs: true
timeout: 7200
traceLevel: 'Verbose'
- task: UiPathTest@6
displayName: 'Run Test Manager Project'
inputs:
testTarget: TestProject
orchestratorConnection: 'uipath-orchestrator-connection'
projectKey: 'PROJ' # Test Manager project key
testProjectPath: '$(Build.SourcesDirectory)\TestProject'
folderName: 'TestManagerFolder'
parametersFilePath: '$(Build.SourcesDirectory)\test-params.json'
testReportDestination: '$(Build.ArtifactStagingDirectory)\tm-project-results.xml'
attachRobotLogs: true
timeout: 7200
traceLevel: 'Verbose'