uipath-cli
latest
false
重要 :
请注意,此内容已使用机器翻译进行了本地化。
新发布内容的本地化可能需要 1-2 周的时间才能完成。
UiPath CLI 用户指南
uip tm attachment下载测试执行中测试用例日志捕获的文件 - 屏幕截图、序列化状态、记录的日志、自动化附加到日志的任何文件。运行后使用它,将证据通常与来自uip tm result download JUnit 报告一起拉取到您的 CI 工作区。
大纲
uip tm attachment download --execution-id <uuid> (--project-key <key> | --test-set-key <key>)
[--test-case-name <name>]… [--only-failed] [--result-path <path>]
uip tm attachment download --execution-id <uuid> (--project-key <key> | --test-set-key <key>)
[--test-case-name <name>]… [--only-failed] [--result-path <path>]
UIP TM 附件下载
下载单次执行的测试用例日志附件。该命令会在日志中分页查看,选择将范围缩小到仅失败的测试用例或命名的测试用例,然后列出每个附件并将其下载到--result-path下每个测试用例的子目录中。单个附件失败的情况被记录在Skipped字段中;它们不会中止整个运行。
参数
无。
选项
--execution-id <uuid>(必填) — 要拉取其附件的执行。--project-key <key>— 拥有项目。此参数或--test-set-key为必填项。--test-set-key <key>— 测试集密钥(例如DEMO:42);项目键从前缀派生。--test-case-name <name>— 按测试用例名称筛选(不区分大小写的子字符串)。可以重复以接受多个名称中的任何一个。匹配包入口点名称,最后回退到测试用例名称和自动化测试用例名称。--only-failed— 仅下载结果为Failed测试用例日志的附件。--result-path <path>— 输出目录。默认为当前工作目录 (.)。如果缺少目录,则会创建该目录。
Layout on disk
<result-path>/
<sanitized test case name>/
<sanitized attachment file name>
<sanitized attachment file name>
<sanitized test case name>/
<sanitized attachment file name>
<result-path>/
<sanitized test case name>/
<sanitized attachment file name>
<sanitized attachment file name>
<sanitized test case name>/
<sanitized attachment file name>
文件和目录名称被清理 — 在 Windows 或 Unix 中的非法字符( < > : " / \ | ? *和控制字符)将替换为_ ,并且名称会被截断,限制为 200 个字符。
示例
# download everything
uip tm attachment download \
--execution-id a1b2c3d4-0000-0000-0000-000000000001 \
--project-key DEMO \
--result-path ./attachments
# only failed tests, narrowed to two named cases
uip tm attachment download \
--execution-id a1b2c3d4-0000-0000-0000-000000000001 \
--project-key DEMO \
--only-failed \
--test-case-name login \
--test-case-name checkout \
--result-path ./attachments
# download everything
uip tm attachment download \
--execution-id a1b2c3d4-0000-0000-0000-000000000001 \
--project-key DEMO \
--result-path ./attachments
# only failed tests, narrowed to two named cases
uip tm attachment download \
--execution-id a1b2c3d4-0000-0000-0000-000000000001 \
--project-key DEMO \
--only-failed \
--test-case-name login \
--test-case-name checkout \
--result-path ./attachments
数据形状
Normal run:
{
"Code": "AttachmentDownload",
"Data": {
"ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
"OutputPath": "./attachments",
"Downloaded": 3,
"MatchedTestCases": 2
}
}
{
"Code": "AttachmentDownload",
"Data": {
"ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
"OutputPath": "./attachments",
"Downloaded": 3,
"MatchedTestCases": 2
}
}
When no test case log matches the filters:
{
"Code": "AttachmentDownload",
"Data": {
"ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
"Message": "No matching test case logs found.",
"Downloaded": 0
}
}
{
"Code": "AttachmentDownload",
"Data": {
"ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
"Message": "No matching test case logs found.",
"Downloaded": 0
}
}
When some attachments fail to list or download, a Skipped array is appended with one entry per failure, formatted "<test case name>: <error message>":
{
"Code": "AttachmentDownload",
"Data": {
"ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
"OutputPath": "./attachments",
"Downloaded": 2,
"MatchedTestCases": 3,
"Skipped": ["Login flow: HTTP 404: Not Found"]
}
}
{
"Code": "AttachmentDownload",
"Data": {
"ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
"OutputPath": "./attachments",
"Downloaded": 2,
"MatchedTestCases": 3,
"Skipped": ["Login flow: HTTP 404: Not Found"]
}
}