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

uip tm 测试集

“uip tm Testets”的语法和选项,用于管理在 Test Manager 中生成被追踪执行的可执行测试集单元。

uip tm testsets管理测试集:Test Manager 中的可执行单元。测试集是一组有序的测试用例,可作为单个命令启动,并作为单次执行进行跟踪。每个testsets run调用都会返回一个ExecutionId ,其他uip tm动词( waitexecutionsreportresultattachment )将其用作输入。

大纲

uip tm testsets create --project-key <key> --name <name> [--description <text>]
uip tm testsets list --project-key <key> [--filter <text>]
uip tm testsets update --project-key <key> --test-set-key <key> [--name <name>] [--description <text>]
uip tm testsets delete --project-key <key> --test-set-key <key> [-y]
uip tm testsets list-testcases --project-key <key> --test-set-key <key> [--limit <n>] [--offset <n>]
uip tm testsets run --test-set-key <key> [--execution-type <type>] [--input-path <file>] [--wait [--timeout <seconds>] [--poll-interval <seconds>]]
uip tm testsets create --project-key <key> --name <name> [--description <text>]
uip tm testsets list --project-key <key> [--filter <text>]
uip tm testsets update --project-key <key> --test-set-key <key> [--name <name>] [--description <text>]
uip tm testsets delete --project-key <key> --test-set-key <key> [-y]
uip tm testsets list-testcases --project-key <key> --test-set-key <key> [--limit <n>] [--offset <n>]
uip tm testsets run --test-set-key <key> [--execution-type <type>] [--input-path <file>] [--wait [--timeout <seconds>] [--poll-interval <seconds>]]

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

创建 uip tm 测试集

在项目中创建一个空测试集。

参数

无。

选项

标记描述
--project-key <key>必需。拥有的项目。
--name <name>必需。测试集名称。
--description <text>自由格式说明。默认为空。

示例

uip tm testsets create \
  --project-key DEMO \
  --name "Smoke Suite" \
  --description "Core smoke tests"
uip tm testsets create \
  --project-key DEMO \
  --name "Smoke Suite" \
  --description "Core smoke tests"

数据形状

{
  "Code": "TestSetCreate",
  "Data": {
    "TestSetKey": "DEMO:10",
    "Name": "Smoke Suite",
    "Description": "Core smoke tests"
  }
}
{
  "Code": "TestSetCreate",
  "Data": {
    "TestSetKey": "DEMO:10",
    "Name": "Smoke Suite",
    "Description": "Core smoke tests"
  }
}

uip tm 测试集列表

列出项目中的测试集。

参数

无。

选项

标记描述
--project-key <key>必需。要列表的项目。
--filter <text>在服务器端搜索名称。

示例

uip tm testsets list --project-key DEMO --filter smoke
uip tm testsets list --project-key DEMO --filter smoke

数据形状

{
  "Code": "TestSetsList",
  "Data": [
    {
      "TestSetKey": "DEMO:10",
      "Name": "Smoke Suite",
      "Id": "a1b2c3d4-0000-0000-0000-000000000010"
    }
  ]
}
{
  "Code": "TestSetsList",
  "Data": [
    {
      "TestSetKey": "DEMO:10",
      "Name": "Smoke Suite",
      "Id": "a1b2c3d4-0000-0000-0000-000000000010"
    }
  ]
}

Idexecutions list --test-set-id所需的内部 UUID。

uip tm 测试集更新

重命名测试集或更改其描述。必须至少提供--name--description其中一个。

参数

无。

选项

标记描述
--project-key <key>必需。拥有的项目。
--test-set-key <key>必需。测试集键(例如 DEMO:10)。
--name <name>新名称。
--description <text>新说明。

示例

uip tm testsets update \
  --project-key DEMO \
  --test-set-key DEMO:10 \
  --name "Smoke Suite (2026)"
uip tm testsets update \
  --project-key DEMO \
  --test-set-key DEMO:10 \
  --name "Smoke Suite (2026)"

数据形状

{
  "Code": "TestSetUpdate",
  "Data": {
    "TestSetKey": "DEMO:10",
    "Name": "Smoke Suite (2026)",
    "Description": "Core smoke tests",
    "Result": "Updated"
  }
}
{
  "Code": "TestSetUpdate",
  "Data": {
    "TestSetKey": "DEMO:10",
    "Name": "Smoke Suite (2026)",
    "Description": "Core smoke tests",
    "Result": "Updated"
  }
}

uip tm 测试集删除

通过密钥删除测试集。

参数

无。

选项

标记描述
--project-key <key>必需。拥有的项目。
--test-set-key <key>必需。测试集键(例如 DEMO:10)。
-y, --yes跳过确认提示。在非交互式环境中为必要项。

示例

uip tm testsets delete --project-key DEMO --test-set-key DEMO:10 --yes
uip tm testsets delete --project-key DEMO --test-set-key DEMO:10 --yes

数据形状

{
  "Code": "TestSetDelete",
  "Data": {
    "TestSetKey": "DEMO:10",
    "Id": "a1b2c3d4-0000-0000-0000-000000000010",
    "Result": "Deleted"
  }
}
{
  "Code": "TestSetDelete",
  "Data": {
    "TestSetKey": "DEMO:10",
    "Id": "a1b2c3d4-0000-0000-0000-000000000010",
    "Result": "Deleted"
  }
}

uip tm 测试集列表测试用例

列出分配给测试集的测试用例。

参数

无。

选项

标记描述
--project-key <key>必需。拥有的项目。
--test-set-key <key>必需。要检查的测试集。
--limit <n>每页的最大结果数量。默认为 50
--offset <n>要跳过的结果数量。默认为 0

示例

uip tm testsets list-testcases --project-key DEMO --test-set-key DEMO:10
uip tm testsets list-testcases --project-key DEMO --test-set-key DEMO:10

数据形状

{
  "Code": "TestSetTestCasesList",
  "Data": [
    {
      "TestCaseKey": "DEMO:1",
      "Name": "Login smoke",
      "Description": "Logs in and out"
    }
  ]
}
{
  "Code": "TestSetTestCasesList",
  "Data": [
    {
      "TestCaseKey": "DEMO:1",
      "Name": "Login smoke",
      "Description": "Logs in and out"
    }
  ]
}

运行 uip tm 测试集

运行测试集并返回其 ExecutionId。默认情况下,执行加入队列后,该命令将立即返回。传递 --wait 以阻止,直到执行到达最终状态——该操作将启动和等待步骤合并为一个命令。

参数

无。

选项

标记描述
--test-set-key <key>必需。测试集对象键(例如 DEMO:42)。项目键从前缀派生。
--execution-type <type>要执行的测试用例类型: automated (默认)manualmixed (自动和手动)none (无类型筛选器)
--input-path <file>包含执行参数覆盖的 JSON 文件的路径。格式:[{"name":"Param","type":"String","value":"v"}]
--wait阻止直到执行到达终止状态(finishedcancelled)。省略此项后,命令将在排队后立即返回。
--timeout <seconds>等待执行完成的最大秒数(0表示不超时)。需要 --wait
--poll-interval <seconds>等待时状态检查之间的秒数。需要 --wait

示例

# Fire-and-forget — returns ExecutionId immediately
uip tm testsets run --test-set-key DEMO:10

# Block until done — no need for a separate uip tm wait call
uip tm testsets run \
  --test-set-key DEMO:10 \
  --wait

# Block with a timeout and custom poll interval
uip tm testsets run \
  --test-set-key DEMO:10 \
  --execution-type automated \
  --wait \
  --timeout 900 \
  --poll-interval 15

# Pass parameter overrides from a file
uip tm testsets run \
  --test-set-key DEMO:10 \
  --input-path ./params.json \
  --wait
# Fire-and-forget — returns ExecutionId immediately
uip tm testsets run --test-set-key DEMO:10

# Block until done — no need for a separate uip tm wait call
uip tm testsets run \
  --test-set-key DEMO:10 \
  --wait

# Block with a timeout and custom poll interval
uip tm testsets run \
  --test-set-key DEMO:10 \
  --execution-type automated \
  --wait \
  --timeout 900 \
  --poll-interval 15

# Pass parameter overrides from a file
uip tm testsets run \
  --test-set-key DEMO:10 \
  --input-path ./params.json \
  --wait

数据形状

{
  "Code": "TestSetRun",
  "Data": {
    "ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
    "TestSetKey": "DEMO:10",
    "Status": "Running",
    "StartTime": "2025-04-15T10:30:00Z"
  }
}
{
  "Code": "TestSetRun",
  "Data": {
    "ExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
    "TestSetKey": "DEMO:10",
    "Status": "Running",
    "StartTime": "2025-04-15T10:30:00Z"
  }
}
备注:

使用 --wait 时,Status 反映最终状态(FinishedCancelled),而不是 Running。返回的 ExecutionId 在这两种情况下相同,并且可以传递给 uip tm report getuip tm result downloaduip tm attachment download

  • 测试用例— 创建并链接填充测试集的测试用例。
  • 执行— 列出并在运行测试集后重试执行。
  • wait — 阻止,直到返回的ExecutionId达到最终状态。
  • 报告结果附件— 运行后工件。

另请参阅

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新