UiPath Documentation
uipath-cli
latest
false
UiPath CLI 用户指南
重要 :
请注意,此内容已使用机器翻译进行了本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

UIP TM 附件

“uip tm Attachment”的语法和选项,用于下载和上传与测试执行中的测试用例日志关联的文件。

uip tm attachment下载和上传与测试执行中的测试用例日志相关的文件 - 屏幕截图、序列化状态、记录的日志、自动化附加到日志的任何文件。

大纲

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 upload --object-id <uuid> --object-type <type> --file <path>
                         [--project-key <key>] [--test-set-key <key>]
                         [--source <source>] [--attachment-type <type>]
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 upload --object-id <uuid> --object-type <type> --file <path>
                         [--project-key <key>] [--test-set-key <key>]
                         [--source <source>] [--attachment-type <type>]

所有动词都遵循全局选项和标准退出代码。每个动词接受 --log-level <level>(默认值 Information)。

UIP TM 附件下载

下载单次执行的测试用例日志附件。该命令会在日志中分页查看,选择将范围缩小到仅失败的测试用例或命名的测试用例,然后列出每个附件并将其下载到--result-path下每个测试用例的子目录中。

参数

无。

选项

  • --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> — 输出目录。默认为当前工作目录。如果缺少目录,则会创建该目录。

示例

# download everything
uip tm attachment download \
  --execution-id a1b2c3d4-0000-0000-0000-000000000001 \
  --project-key DEMO \
  --result-path ./attachments

# only failed tests
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
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

数据形状 — 正常运行

{
  "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
  }
}

数据形状 — 没有匹配的测试用例日志

{
  "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
  }
}

数据形状 — 部分附件失败

{
  "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"]
  }
}

uip tm 附件上传

将文件作为测试用例日志或其他 Test Manager 对象的附件上传。

参数

无。

选项

  • --object-id <uuid> (必填) — 要向其附加文件的对象的 UUID(例如,测试用例日志 ID)。
  • --object-type <type> (必填) — 对象的类型。运行uip tm attachment upload --help以查看接受的值。
  • --file <path> (必填) — 要上传的文件的本地路径。
  • --project-key <key> — 拥有项目。用于上传的可选上下文。
  • --test-set-key <key> — 测试集密钥。用于上传的可选上下文。
  • --source <source> — 附件的来源标识符。可选。
  • --attachment-type <type> — 附件的分类(例如, screenshotlog )。可选。

示例

uip tm attachment upload \
  --object-id c3d4e5f6-0000-0000-0000-000000000001 \
  --object-type TestCaseLog \
  --file ./screenshot.png \
  --project-key DEMO \
  --attachment-type screenshot
uip tm attachment upload \
  --object-id c3d4e5f6-0000-0000-0000-000000000001 \
  --object-type TestCaseLog \
  --file ./screenshot.png \
  --project-key DEMO \
  --attachment-type screenshot

数据形状

{
  "Code": "AttachmentUpload",
  "Data": {
    "AttachmentId": "d4e5f6a7-0000-0000-0000-000000000001",
    "ObjectId": "c3d4e5f6-0000-0000-0000-000000000001",
    "ObjectType": "TestCaseLog",
    "FileName": "screenshot.png",
    "Result": "Uploaded"
  }
}
{
  "Code": "AttachmentUpload",
  "Data": {
    "AttachmentId": "d4e5f6a7-0000-0000-0000-000000000001",
    "ObjectId": "c3d4e5f6-0000-0000-0000-000000000001",
    "ObjectType": "TestCaseLog",
    "FileName": "screenshot.png",
    "Result": "Uploaded"
  }
}
  • 运行测试集— 生成ExecutionId使用的download
  • wait — 阻止执行,直到执行终止,然后再拉取附件。
  • 结果— 同一执行的 JUnit XML。
  • Report — 人类可读的摘要。

另请参阅

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新