“uip tm Testets”的语法和选项,用于管理在 Test Manager 中生成被追踪执行的可执行测试集单元。
uip tm testsets管理测试集:Test Manager 中的可执行单元。测试集是一组有序的测试用例,可作为单个命令启动,并作为单次执行进行跟踪。每个testsets run调用都会返回一个ExecutionId ,其他uip tm动词( wait 、 executions 、 report 、 result 、 attachment )将其用作输入。
大纲
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>] [--playwright-projects <names...>] [--wait [--timeout <seconds>] [--poll-interval <seconds>]]
uip tm testsets playwright-context --test-set-key <key>
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>] [--playwright-projects <names...>] [--wait [--timeout <seconds>] [--poll-interval <seconds>]]
uip tm testsets playwright-context --test-set-key <key>
创建 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> | 必需。要列表的项目。 |
--folder-key <uuid> | 按 Orchestrator 文件夹密钥筛选(uip or folders list 起)。 |
--filter <text> | 在服务器端搜索名称。 |
--include-last-execution | 向每个测试集添加最新执行的状态和时间戳(请参阅下面的LastExecutionStatus/LastExecutionAt)。每个测试集会导致一次额外查找成本。 |
示例
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",
"FolderKey": "f0f0f0f0-0000-0000-0000-000000000001",
"Id": "a1b2c3d4-0000-0000-0000-000000000010"
}
]
}
{
"Code": "TestSetsList",
"Data": [
{
"TestSetKey": "DEMO:10",
"Name": "Smoke Suite",
"FolderKey": "f0f0f0f0-0000-0000-0000-000000000001",
"Id": "a1b2c3d4-0000-0000-0000-000000000010"
}
]
}
Id 是 executions list --test-set-id 所需的内部 UUID。使用 --include-last-execution 时,每个条目还会获取 LastExecutionStatus 和 LastExecutionAt(如果测试集从未运行过,则这两个字符串为空字符串)。
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 (默认) 、 manual 、 mixed (自动和手动)或none (无类型筛选器) 。 |
--input-path <file> | 包含执行参数覆盖的 JSON 文件的路径。格式:[{"name":"Param","type":"String","value":"v"}]。 |
--playwright-projects <names...> | 将运行范围限定为由uip tm pack打包的一个或多个 Playwright 项目(以空格分隔,例如regression smoke )。该选择会在测试集上保留,因此以后运行同一测试集时无需重复。 |
--wait | 阻止直到执行到达终止状态(finished,cancelled)。省略此项后,命令将在排队后立即返回。 |
--timeout <seconds> | 等待执行完成的最大秒数(0表示不超时)。需要 --wait。 |
--poll-interval <seconds> | 等待时状态检查之间的秒数。需要 --wait。 |
--playwright-projects 是隐藏选项(从 --help 中省略) — 它存在并有效,但在基础 Test Manager Playwright 执行功能全面发布之前,标志界面可能会发生变化。仅适用于全部测试用例都来自单个 Playwright 包的测试集;在任何其他测试集中,运行将使用包的 playwright.config 默认值继续,并且该标志会被有效忽略。
示例
# 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
# Scope a run to specific Playwright projects (hidden option, see note above)
uip tm testsets run \
--test-set-key DEMO:10 \
--playwright-projects regression smoke
# 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
# Scope a run to specific Playwright projects (hidden option, see note above)
uip tm testsets run \
--test-set-key DEMO:10 \
--playwright-projects regression smoke
数据形状
{
"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 反映最终状态(Finished、Cancelled),而不是 Running。返回的 ExecutionId 在这两种情况下相同,并且可以传递给 uip tm report get、uip tm result download 和 uip tm attachment download。
uip tm 测试集剧作者上下文
探索测试集的 Playwright 决策:其中的每个测试用例是否都来自单个 Playwright 包,以及可用且当前已选择哪些 Playwright 项目名称。从 --help 隐藏(与 run 的 --playwright-projects 成熟期相同),但真实且功能强大 — 在调用 --playwright-projects 之前,使用它来发现有效的 run 名称,与 run 自己的选项完全相同文本指向返回此处。
参数
无。
选项
| 标记 | 描述 |
|---|---|
--test-set-key <key> | 必需。测试集对象密钥(例如DEMO:42)。 |
--log-level <level> | 默认 Information。 |
示例
uip tm testsets playwright-context --test-set-key DEMO:42
uip tm testsets playwright-context --test-set-key DEMO:42
数据形状
{
"Code": "TestSetPlaywrightContext",
"Data": {
"TestSetKey": "DEMO:42",
"IsPlaywright": true,
"PackageIdentifier": "my-playwright-suite",
"Version": "1.2.0",
"AvailablePlaywrightProjects": "chromium, firefox, webkit",
"SelectedPlaywrightProjects": "chromium"
}
}
{
"Code": "TestSetPlaywrightContext",
"Data": {
"TestSetKey": "DEMO:42",
"IsPlaywright": true,
"PackageIdentifier": "my-playwright-suite",
"Version": "1.2.0",
"AvailablePlaywrightProjects": "chromium, firefox, webkit",
"SelectedPlaywrightProjects": "chromium"
}
}
当测试集不是单包 Playwright 集(RPA、混合包、手动包或无单个包)时,IsPlaywright 为 false,响应会改为包含一个 Details 字段:"Not a Playwright test set (RPA, mixed, manual, or no single package). Run it without --playwright-projects." — 四个在这种情况下,上述剧作者特定字段将被省略。AvailablePlaywrightProjects/SelectedPlaywrightProjects 是以逗号连接的字符串,而不是数组。
相关内容
- 打包— 打包 Playwright 项目,并生成上面使用的
--playwright-projects作用域名称。 - 测试用例— 创建并链接填充测试集的测试用例。
- 执行— 列出并在运行测试集后重试执行。
- wait — 阻止,直到返回的
ExecutionId达到最终状态。 - 报告、结果、附件— 运行后工件。