uip tm 测试用例
“uip tm testcases”的语法和选项,用于管理测试用例,包括创建、列出、更新、删除、链接自动化和测试用例日志管理。
uip tm testcases 管理 Test Manager 项目中的测试用例:创建、列出、更新、删除、链接或取消链接 Orchestrator 自动化,检查历史结果以及在测试集中添加或删除测试用例。它还提供了 testcases run — 一种直接从 Orchestrator 包执行一个或多个测试用例的方法。此页面还记录了 uip tm testcaselog list-assertions、testcaselog start 和 testcaselog finish(注册在 testcaselog,单数下),它们读取断言工件并记录测试用例日志的手动日志条目。
测试用例是作者身份单位。在使用testcases link-automation链接到包入口点后,它将变为可运行状态。然后,测试用例可以作为测试集的一部分执行(请参阅测试集),也可以直接通过testcases run执行。
切勿在uip tm pack为 Playwright 项目创建的测试用例上运行testcases link-automation 。Playwright 测试用例会在打包时提取期间自动链接;相反,在它们上面手动运行 link-automation 会遵循 RPA 链接管道,并会损坏该关联。如果使用 --no-create-test-cases 打包,请改用 Test Manager 用户界面中的“选择自动化”流程。
大纲
uip tm testcases create --project-key <key> --name <name> [--description <text>] [--version <version>]
uip tm testcases list --project-key <key> [--filter <text>]
uip tm testcases list-result-history --project-key <key> --test-case-id <uuid> [--filter <text>] [--only-failed] [--results <results...>] [--statuses <statuses...>] [--duration-period <period>] [--top <number>] [--skip <number>]
uip tm testcases update --project-key <key> --test-case-key <key> [--name <name>] [--description <text>] [--pre-condition <text>] [--post-condition <text>]
uip tm testcases delete --project-key <key> --test-case-key <key> [-y]
uip tm testcases link-automation --project-key <key> --test-case-key <key> --folder-key <uuid> --package-name <name> --test-name <name>
uip tm testcases link-package --project-key <key> --folder-key <uuid> [--package-name <name>] [--test-name <name...>] [--dry-run]
uip tm testcases unlink-automation --project-key <key> --test-case-key <key>
uip tm testcases list-automations --project-key <key> [--folder-key <uuid>] [--package-name <name>]
uip tm testcases list-testsets --project-key <key> --test-case-key <key>
uip tm testcases run --project-key <key> --test-case-id <uuid...> --name <name> --execution-type <type> [--async] [--folder-key <uuid>] [--runtime-type <type>] [--robot-user-key <uuid>] [--machine-key <uuid>] [--host-machine-name <name>] [--service-user-name <name>] [--test-set-packages <json>]
uip tm testcases add --test-set-key <key> (--test-case-keys <keys...> | --labels <labels...> [--limit <count>])
uip tm testcases remove --test-set-key <key> --test-case-keys <keys> [-y]
uip tm testcases list-steps --project-key <key> --test-case-id <uuid>
uip tm testcases steps list --project-key <key> --test-case-id <uuid>
uip tm testcases steps get --project-key <key> --step-id <uuid>
uip tm testcases steps add --project-key <key> --test-case-id <uuid> [--description <text>] [--expected-result <text>] [--action-type <type>] [--clipboard-data <text>] [--order-no <n>] [--step <json>...]
uip tm testcases steps update --project-key <key> --step-id <uuid> [--description <text>] [--expected-result <text>] [--action-type <type>] [--clipboard-data <text>]
uip tm testcases steps move --project-key <key> --step-id <uuid> --target-position <n>
uip tm testcases steps delete --project-key <key> --step-id <uuid> [-y]
uip tm testcaselog list-assertions --project-key <key> --test-case-log-id <uuid>
uip tm testcaselog start --project-key <key> --execution-id <uuid> --test-case-id <uuid> [--run-id <number>]
uip tm testcaselog finish --project-key <key> --execution-id <uuid> --test-case-id <uuid> --result <result> --has-error <boolean> --executed-by <email> [--detail-link <url>] [--run-id <number>] [--is-post-condition-met <boolean>] (--step-logs <json> | --step-logs-file <path>)
uip tm testcases create --project-key <key> --name <name> [--description <text>] [--version <version>]
uip tm testcases list --project-key <key> [--filter <text>]
uip tm testcases list-result-history --project-key <key> --test-case-id <uuid> [--filter <text>] [--only-failed] [--results <results...>] [--statuses <statuses...>] [--duration-period <period>] [--top <number>] [--skip <number>]
uip tm testcases update --project-key <key> --test-case-key <key> [--name <name>] [--description <text>] [--pre-condition <text>] [--post-condition <text>]
uip tm testcases delete --project-key <key> --test-case-key <key> [-y]
uip tm testcases link-automation --project-key <key> --test-case-key <key> --folder-key <uuid> --package-name <name> --test-name <name>
uip tm testcases link-package --project-key <key> --folder-key <uuid> [--package-name <name>] [--test-name <name...>] [--dry-run]
uip tm testcases unlink-automation --project-key <key> --test-case-key <key>
uip tm testcases list-automations --project-key <key> [--folder-key <uuid>] [--package-name <name>]
uip tm testcases list-testsets --project-key <key> --test-case-key <key>
uip tm testcases run --project-key <key> --test-case-id <uuid...> --name <name> --execution-type <type> [--async] [--folder-key <uuid>] [--runtime-type <type>] [--robot-user-key <uuid>] [--machine-key <uuid>] [--host-machine-name <name>] [--service-user-name <name>] [--test-set-packages <json>]
uip tm testcases add --test-set-key <key> (--test-case-keys <keys...> | --labels <labels...> [--limit <count>])
uip tm testcases remove --test-set-key <key> --test-case-keys <keys> [-y]
uip tm testcases list-steps --project-key <key> --test-case-id <uuid>
uip tm testcases steps list --project-key <key> --test-case-id <uuid>
uip tm testcases steps get --project-key <key> --step-id <uuid>
uip tm testcases steps add --project-key <key> --test-case-id <uuid> [--description <text>] [--expected-result <text>] [--action-type <type>] [--clipboard-data <text>] [--order-no <n>] [--step <json>...]
uip tm testcases steps update --project-key <key> --step-id <uuid> [--description <text>] [--expected-result <text>] [--action-type <type>] [--clipboard-data <text>]
uip tm testcases steps move --project-key <key> --step-id <uuid> --target-position <n>
uip tm testcases steps delete --project-key <key> --step-id <uuid> [-y]
uip tm testcaselog list-assertions --project-key <key> --test-case-log-id <uuid>
uip tm testcaselog start --project-key <key> --execution-id <uuid> --test-case-id <uuid> [--run-id <number>]
uip tm testcaselog finish --project-key <key> --execution-id <uuid> --test-case-id <uuid> --result <result> --has-error <boolean> --executed-by <email> [--detail-link <url>] [--run-id <number>] [--is-post-condition-met <boolean>] (--step-logs <json> | --step-logs-file <path>)
list-assertions、start 和 finish 已在 uip tm testcaselog(单数)下注册。uip tm testcaselogs list-assertions 和 uip tm testcaselogs start/finish 不作为命令存在。
--log-level <level>(默认Information )可用于create list、list-result-history 、update 、delete 、link-automation 、link-package 、unlink-automation 、list-automations 、list-testsets 、add 、 和remove 。它在 run、任何 steps 子命令(包括 list-steps 别名)或 testcaselog start/finish/list-assertions 中不存在。
创建 UIP TM 测试用例
在项目中创建一个新的测试用例。
参数
无。
选项
| 标记 | 描述 |
|---|---|
--project-key <key> | 必需。拥有的项目。 |
--name <name> | 必需。测试用例名称。 |
--description <text> | 自由格式说明。默认为空。 |
--version <version> | 测试用例版本字符串。默认为 1.0.0。 |
示例
uip tm testcases create \
--project-key DEMO \
--name "Login smoke" \
--description "Logs in and out"
uip tm testcases create \
--project-key DEMO \
--name "Login smoke" \
--description "Logs in and out"
数据形状
{
"Code": "TestCaseCreate",
"Data": {
"TestCaseKey": "DEMO:1",
"Id": "a1b2c3d4-0000-0000-0000-000000000001",
"Name": "Login smoke",
"Description": "Logs in and out",
"Version": "1.0.0"
}
}
{
"Code": "TestCaseCreate",
"Data": {
"TestCaseKey": "DEMO:1",
"Id": "a1b2c3d4-0000-0000-0000-000000000001",
"Name": "Login smoke",
"Description": "Logs in and out",
"Version": "1.0.0"
}
}
TestCaseKey (公共PROJECT:N标识符)是传递给其他动词的内容。list-result-history和list-testsets需要内部Id (UUID)。
uip tm 测试用例列表
列出项目中的所有测试用例。CLI 会自动对结果进行分页。
参数
无。
选项
| 标记 | 描述 |
|---|---|
--project-key <key> | 必需。要列表的项目。 |
--filter <text> | 按名称或键筛选(服务器端搜索)。 |
示例
uip tm testcases list --project-key DEMO --filter login
uip tm testcases list --project-key DEMO --filter login
数据形状
{
"Code": "TestCasesList",
"Data": [
{
"TestCaseKey": "DEMO:1",
"Name": "Login smoke",
"Description": "Logs in and out"
}
]
}
{
"Code": "TestCasesList",
"Data": [
{
"TestCaseKey": "DEMO:1",
"Name": "Login smoke",
"Description": "Logs in and out"
}
]
}
uip tm 测试用例列表结果历史记录
列出单个测试用例的历史测试用例日志。获取内部--test-case-id (UUID) — 通过testcases list或从上一个TestCaseCreate输出中查找 UUID。
参数
无。
选项
| 标记 | 描述 |
|---|---|
--project-key <key> | 必需。拥有的项目。 |
--test-case-id <uuid> | 必需。内部测试用例 UUID。 |
--filter <text> | 按名称搜索测试用例日志。 |
--only-failed | “仅显示失败的日志”的快捷方式(默认为 false)。 |
--results <results...> | 要包含的以空格分隔的结果。接受的值来自 SDK Result 枚举。 |
--statuses <statuses...> | 用空格分隔的执行状态。接受的值来自 SDK TestCaseLogExecutionStatus 枚举。 |
--duration-period <period> | 按持续时间存储桶筛选。接受的值来自 SDK DurationPeriod 枚举。 |
--top <number> | 页面大小。默认为 50。 |
--skip <number> | 要跳过的结果。默认为 0。 |
--results 、 --statuses和--duration-period的确切可接受值由已安装的工具版本附带的 Test Manager SDK 枚举在运行时生成。运行uip tm testcases list-result-history --help以查看当前集合。
示例
uip tm testcases list-result-history \
--project-key DEMO \
--test-case-id a1b2c3d4-0000-0000-0000-000000000001 \
--only-failed
uip tm testcases list-result-history \
--project-key DEMO \
--test-case-id a1b2c3d4-0000-0000-0000-000000000001 \
--only-failed
数据形状
{
"Code": "TestCaseResultHistory",
"Data": [
{
"Id": "b2c3d4e5-0000-0000-0000-000000000001",
"Result": "Failed",
"Status": "Finished",
"ExecutionEnd": "2025-04-15T12:00:00Z"
}
]
}
{
"Code": "TestCaseResultHistory",
"Data": [
{
"Id": "b2c3d4e5-0000-0000-0000-000000000001",
"Result": "Failed",
"Status": "Finished",
"ExecutionEnd": "2025-04-15T12:00:00Z"
}
]
}
uip tm 测试用例更新
重命名测试用例,或更改其描述、前置条件或后置条件。以下字段中至少有一个为必填项。
参数
无。
选项
| 标记 | 描述 |
|---|---|
--project-key <key> | 必需。拥有的项目。 |
--test-case-key <key> | 必需。测试用例键(例如 DEMO:1)。 |
--name <name> | 新名称。 |
--description <text> | 新说明。 |
--pre-condition <text> | 新的前提条件 — 运行测试之前必须满足的条件。 |
--post-condition <text> | 新后置条件 — 运行测试后应满足的条件。 |
示例
uip tm testcases update \
--project-key DEMO \
--test-case-key DEMO:1 \
--name "Login smoke (2026)"
uip tm testcases update \
--project-key DEMO \
--test-case-key DEMO:1 \
--name "Login smoke (2026)"
数据形状
{
"Code": "TestCaseUpdate",
"Data": {
"TestCaseKey": "DEMO:1",
"Name": "Login smoke (2026)",
"Description": "Logs in and out",
"PreCondition": "User account exists",
"PostCondition": "User is logged out",
"Result": "Updated"
}
}
{
"Code": "TestCaseUpdate",
"Data": {
"TestCaseKey": "DEMO:1",
"Name": "Login smoke (2026)",
"Description": "Logs in and out",
"PreCondition": "User account exists",
"PostCondition": "User is logged out",
"Result": "Updated"
}
}
uip tm 测试用例删除
按测试用例的密钥删除测试用例。
参数
无。
选项
| 标记 | 描述 |
|---|---|
--project-key <key> | 必需。拥有的项目。 |
--test-case-key <key> | 必需。测试用例键(例如 DEMO:1)。 |
-y, --yes | 跳过确认提示。在非交互式环境中为必要项。 |
示例
uip tm testcases delete \
--project-key DEMO \
--test-case-key DEMO:1 \
--yes
uip tm testcases delete \
--project-key DEMO \
--test-case-key DEMO:1 \
--yes
数据形状
{
"Code": "TestCaseDelete",
"Data": {
"TestCaseKey": "DEMO:1",
"Id": "a1b2c3d4-0000-0000-0000-000000000001",
"Result": "Deleted"
}
}
{
"Code": "TestCaseDelete",
"Data": {
"TestCaseKey": "DEMO:1",
"Id": "a1b2c3d4-0000-0000-0000-000000000001",
"Result": "Deleted"
}
}
uip tm 测试用例链接自动化
将 Orchestrator 包入口点绑定到测试用例。这就是使测试用例在测试集中可执行的原因。该命令在内部解析来自 --folder-key 的文件夹显示名称,按名称查找匹配的包入口点,然后将绑定存储到测试用例上。对于pack创建的 Playwright 测试用例,请参阅上面的警告。
参数
无。
选项
| 标记 | 描述 |
|---|---|
--project-key <key> | 必需。拥有的项目。 |
--test-case-key <key> | 必需。要绑定的测试用例。 |
--folder-key <uuid> | 必需。Orchestrator 文件夹 UUID(来自 uip or folders list)。 |
--package-name <name> | 必需。Orchestrator 包标识符(例如 InvoiceTests)。 |
--test-name <name> | 必需。包中的测试用例名称(入口点名称)。 |
示例
uip tm testcases link-automation \
--project-key DEMO \
--test-case-key DEMO:1 \
--folder-key f0f0f0f0-0000-0000-0000-000000000001 \
--package-name InvoiceTests \
--test-name SmokeTest
uip tm testcases link-automation \
--project-key DEMO \
--test-case-key DEMO:1 \
--folder-key f0f0f0f0-0000-0000-0000-000000000001 \
--package-name InvoiceTests \
--test-name SmokeTest
数据形状
{
"Code": "TestCaseLinkAutomation",
"Data": {
"TestCaseKey": "DEMO:1",
"PackageName": "InvoiceTests",
"PackageSource": "Shared",
"TestName": "SmokeTest",
"Result": "Linked"
}
}
{
"Code": "TestCaseLinkAutomation",
"Data": {
"TestCaseKey": "DEMO:1",
"PackageName": "InvoiceTests",
"PackageSource": "Shared",
"TestName": "SmokeTest",
"Result": "Linked"
}
}
uip tm 测试用例链接包
一次性为 Orchestrator 包中的每个测试创建并链接测试用例,批量与 link-automation 对应,将一个现有测试用例链接到一个自动化。默认情况下,它会链接文件夹公开的每个测试;使用 --package-name 将其范围限定为一个包,使用 --test-name 将其范围限定为特定测试。每个测试都会创建新的测试用例 (Action: "Created") 或重用已链接到该自动化的测试用例 (Action: "Reused")。
参数
无。
选项
| 标记 | 描述 |
|---|---|
--project-key <key> | 必需。拥有的项目。 |
--folder-key <uuid> | 必需。Orchestrator 文件夹 UUID(来自 uip or folders list)。 |
--package-name <name> | 仅链接此包中的测试(不区分大小写,精确匹配)。省略链接文件夹公开的每个测试。 |
--test-name <name...> | 仅链接这些测试(不区分大小写,可重复)。省略链接所有这些内容。 |
--dry-run | 预览将创建、重用和链接的测试用例,而无需编写任何内容。 |
示例
# Create and link a test case for every test in one Orchestrator package
uip tm testcases link-package \
--project-key DEMO \
--folder-key f0f0f0f0-0000-0000-0000-000000000001 \
--package-name InvoiceTests
# Create and link a test case for every test in one Orchestrator package
uip tm testcases link-package \
--project-key DEMO \
--folder-key f0f0f0f0-0000-0000-0000-000000000001 \
--package-name InvoiceTests
# Preview what would be created and linked, without writing
uip tm testcases link-package \
--project-key DEMO \
--folder-key f0f0f0f0-0000-0000-0000-000000000001 \
--package-name InvoiceTests \
--dry-run
# Preview what would be created and linked, without writing
uip tm testcases link-package \
--project-key DEMO \
--folder-key f0f0f0f0-0000-0000-0000-000000000001 \
--package-name InvoiceTests \
--dry-run
# Link only two named tests out of the package
uip tm testcases link-package \
--project-key DEMO \
--folder-key f0f0f0f0-0000-0000-0000-000000000001 \
--package-name InvoiceTests \
--test-name SmokeTest RegressionTest
# Link only two named tests out of the package
uip tm testcases link-package \
--project-key DEMO \
--folder-key f0f0f0f0-0000-0000-0000-000000000001 \
--package-name InvoiceTests \
--test-name SmokeTest RegressionTest
数据形状
{
"Code": "TestCaseLinkPackage",
"Data": [
{
"TestName": "SmokeTest",
"PackageName": "InvoiceTests",
"PackageVersion": "1.0.2",
"TestCaseKey": "DEMO:7",
"TestCaseId": "a1b2c3d4-0000-0000-0000-000000000007",
"Action": "Created"
},
{
"TestName": "RegressionTest",
"PackageName": "InvoiceTests",
"PackageVersion": "1.0.2",
"TestCaseKey": "DEMO:3",
"TestCaseId": "a1b2c3d4-0000-0000-0000-000000000003",
"Action": "Reused"
}
]
}
{
"Code": "TestCaseLinkPackage",
"Data": [
{
"TestName": "SmokeTest",
"PackageName": "InvoiceTests",
"PackageVersion": "1.0.2",
"TestCaseKey": "DEMO:7",
"TestCaseId": "a1b2c3d4-0000-0000-0000-000000000007",
"Action": "Created"
},
{
"TestName": "RegressionTest",
"PackageName": "InvoiceTests",
"PackageVersion": "1.0.2",
"TestCaseKey": "DEMO:3",
"TestCaseId": "a1b2c3d4-0000-0000-0000-000000000003",
"Action": "Reused"
}
]
}
使用 --dry-run,Code 为 TestCaseLinkPackageDryRun,Action 值变为 WouldCreate/WouldReuse,TestCaseKey/TestCaseId 为空字符串,因为实际未写入任何内容。
uip tm 测试用例取消链接自动化
从测试用例中删除自动化绑定。取消链接后,在再次链接之前,测试用例无法再执行。
参数
无。
选项
| 标记 | 描述 |
|---|---|
--project-key <key> | 必需。拥有的项目。 |
--test-case-key <key> | 必需。要取消链接的测试用例。 |
示例
uip tm testcases unlink-automation \
--project-key DEMO \
--test-case-key DEMO:1
uip tm testcases unlink-automation \
--project-key DEMO \
--test-case-key DEMO:1
数据形状
{
"Code": "TestCaseUnlinkAutomation",
"Data": {
"TestCaseKey": "DEMO:1",
"Result": "Unlinked"
}
}
{
"Code": "TestCaseUnlinkAutomation",
"Data": {
"TestCaseKey": "DEMO:1",
"Result": "Unlinked"
}
}
uip tm 测试用例列表自动化
列出 Orchestrator 文件夹中可用的测试入口点。使用此功能来发现要传递给 --package-name/--test-namelink-automation 的值。
参数
无。
选项
| 标记 | 描述 |
|---|---|
--project-key <key> | 必需。拥有的项目(用于限定查找的范围)。 |
--folder-key <uuid> | Orchestrator 文件夹 UUID。无需在整个租户订阅源中搜索,只需搜索一个文件夹即可。 |
--package-name <name> | 从列表中筛选一个包(不区分大小写的精确匹配,非子字符串搜索)。 |
示例
uip tm testcases list-automations \
--project-key DEMO \
--folder-key f0f0f0f0-0000-0000-0000-000000000001
uip tm testcases list-automations \
--project-key DEMO \
--folder-key f0f0f0f0-0000-0000-0000-000000000001
数据形状
{
"Code": "TestAutomationsList",
"Data": [
{
"PackageName": "InvoiceTests",
"TestName": "SmokeTest",
"PackageVersion": "1.0.2"
}
]
}
{
"Code": "TestAutomationsList",
"Data": [
{
"PackageName": "InvoiceTests",
"TestName": "SmokeTest",
"PackageVersion": "1.0.2"
}
]
}
uip tm 测试用例列表测试集
列出包含给定测试用例的每个测试集。
参数
无。
选项
| 标记 | 描述 |
|---|---|
--project-key <key> | 必需。拥有的项目。 |
--test-case-key <key> | 必需。测试用例键(例如 DEMO:1)。 |
示例
uip tm testcases list-testsets \
--project-key DEMO \
--test-case-key DEMO:1
uip tm testcases list-testsets \
--project-key DEMO \
--test-case-key DEMO:1
数据形状
{
"Code": "TestCaseTestSetsList",
"Data": [
{
"TestSetKey": "DEMO:10",
"Name": "Smoke Suite",
"FolderKey": "f0f0f0f0-0000-0000-0000-000000000001"
}
]
}
{
"Code": "TestCaseTestSetsList",
"Data": [
{
"TestSetKey": "DEMO:10",
"Name": "Smoke Suite",
"FolderKey": "f0f0f0f0-0000-0000-0000-000000000001"
}
]
}
运行 uip tm 测试用例
直接从 Orchestrator 包运行一个或多个测试用例,而无需先创建测试集。testcases run启动执行并返回执行记录。有关此功能的更多信息,请参阅 Test Manager 文档中的执行不使用测试集的测试用例。
testcases run默认情况下是同步的,它会受到阻止,直到确认执行记录为止。要在排队后立即返回,请传递--async 。要在执行完成之前阻止,请将返回的Id通过管道传输到uip tm wait 。
何时使用testcases run与testsets run
- 使用
testcases run直接从包中按需执行测试用例。 - 使用
testsets run执行指定的测试用例组,系统会随着时间的推移在 Test Manager 中管理这些用例。
参数
无。
选项
| 标记 | 描述 |
|---|---|
--project-key <key> | Test Manager 项目密钥(例如 DEMO)。如果可从上下文中派生,则为可选项。 |
--test-case-id <uuid...> | 必需。要运行的一个或多个测试用例 UUID,以空格分隔。从 testcases list 获取 UUID。 |
--execution-type <type> | 必需。执行类型:automated、manual、mixed 或 none。 |
--name <name> | 执行的显示名称。 |
--async | 排队后立即返回,无需等待服务器确认执行已开始。无需等待执行记录完全创建即可返回。 |
--folder-key <uuid> | 要在其中运行的 Orchestrator 文件夹。当测试用例链接到特定文件夹中的自动化时为必需。 |
--runtime-type <type> | 机器人 runtime 类型覆盖。接受值:nonProduction、attended、unattended、rpaDeveloper、studioX、headless、rpaDeveloperPro、testAutomation、automationCloud、serverless、automationKit、serverlessTestAutomation 、automationCloudTestAutomation、attendedStudioWeb、hosting、assistantWeb、processOrchestration、agentService、appTest、performanceTest、businessRule、caseManagement。 |
--robot-user-key <uuid> | 执行目标的机器人用户密钥。 |
--machine-key <uuid> | 执行目标的计算机密钥。 |
--host-machine-name <name> | 执行目标的主机名。 |
--service-user-name <name> | 执行目标的服务用户名。 |
--test-set-packages <json> | 包覆盖的 JSON 数组:[{"packageName":"Pkg","version":"1.0.0"}]。 |
示例
# Simplest — run a single test case (blocks until execution record is created)
uip tm testcases run \
--project-key DEMO \
--test-case-id a1b2c3d4-0000-0000-0000-000000000001 \
--execution-type automated \
--name "Login smoke run"
# Simplest — run a single test case (blocks until execution record is created)
uip tm testcases run \
--project-key DEMO \
--test-case-id a1b2c3d4-0000-0000-0000-000000000001 \
--execution-type automated \
--name "Login smoke run"
# Run multiple test cases asynchronously, then wait for completion
id=$(uip tm testcases run \
--project-key DEMO \
--test-case-id a1b2c3d4-0000-0000-0000-000000000001 a1b2c3d4-0000-0000-0000-000000000002 \
--execution-type automated \
--name "Smoke run" \
--async \
--output-filter Id)
uip tm wait --execution-id "$id" --project-key DEMO --timeout 900
uip tm report get --execution-id "$id" --project-key DEMO
# Run multiple test cases asynchronously, then wait for completion
id=$(uip tm testcases run \
--project-key DEMO \
--test-case-id a1b2c3d4-0000-0000-0000-000000000001 a1b2c3d4-0000-0000-0000-000000000002 \
--execution-type automated \
--name "Smoke run" \
--async \
--output-filter Id)
uip tm wait --execution-id "$id" --project-key DEMO --timeout 900
uip tm report get --execution-id "$id" --project-key DEMO
# Full override — specify folder, runtime, machine, and package version
uip tm testcases run \
--project-key DEMO \
--test-case-id a1b2c3d4-0000-0000-0000-000000000001 \
--execution-type automated \
--name "Smoke run" \
--folder-key f0f0f0f0-0000-0000-0000-000000000001 \
--runtime-type unattended \
--machine-key 33333333-4444-5555-6666-777777777777 \
--test-set-packages '[{"packageName":"InvoiceTests","version":"1.0.2"}]'
# Full override — specify folder, runtime, machine, and package version
uip tm testcases run \
--project-key DEMO \
--test-case-id a1b2c3d4-0000-0000-0000-000000000001 \
--execution-type automated \
--name "Smoke run" \
--folder-key f0f0f0f0-0000-0000-0000-000000000001 \
--runtime-type unattended \
--machine-key 33333333-4444-5555-6666-777777777777 \
--test-set-packages '[{"packageName":"InvoiceTests","version":"1.0.2"}]'
数据形状
{
"Code": "TestCaseRun",
"Data": {
"Id": "b2c3d4e5-0000-0000-0000-000000000001",
"Name": "Login smoke run",
"ProjectId": "00000000-0000-0000-0000-000000000abc",
"TestSetId": "a1b2c3d4-0000-0000-0000-000000000010",
"TestSetObjKey": "DEMO:10",
"Status": "Running",
"ExecutionType": "automated",
"Source": "Manual",
"RunId": 1,
"FolderKey": "f0f0f0f0-0000-0000-0000-000000000001",
"ExecutionStart": "2025-04-15T10:30:00Z",
"EnableCoverage": false,
"EnforceExecutionOrder": false,
"AutopilotForRobotsSettings": { "Enabled": false },
"OrderedExecutionSettings": { "Enabled": false },
"VideoRecordingSettings": { "Enabled": false }
}
}
{
"Code": "TestCaseRun",
"Data": {
"Id": "b2c3d4e5-0000-0000-0000-000000000001",
"Name": "Login smoke run",
"ProjectId": "00000000-0000-0000-0000-000000000abc",
"TestSetId": "a1b2c3d4-0000-0000-0000-000000000010",
"TestSetObjKey": "DEMO:10",
"Status": "Running",
"ExecutionType": "automated",
"Source": "Manual",
"RunId": 1,
"FolderKey": "f0f0f0f0-0000-0000-0000-000000000001",
"ExecutionStart": "2025-04-15T10:30:00Z",
"EnableCoverage": false,
"EnforceExecutionOrder": false,
"AutopilotForRobotsSettings": { "Enabled": false },
"OrderedExecutionSettings": { "Enabled": false },
"VideoRecordingSettings": { "Enabled": false }
}
}
关键字段:
Id— 传递给uip tm wait、report get、result download、attachment download。Status: "Running"— 执行可能尚未调度。Source: "Manual"— 所有testcases run执行都被标记为手动触发。
端到端工作流:打包到结果
# 1. Discover your project key
uip tm project list --output json
# 2. Find the test case UUIDs you want to run
uip tm testcases list --project-key DEMO --filter "login" --output json
# 3. Find the folder that holds your package
uip or folders list --output json
# 4. Link the test case to the automation entry point
uip tm testcases link-automation \
--project-key DEMO \
--test-case-key DEMO:1 \
--folder-key f0f0f0f0-0000-0000-0000-000000000001 \
--package-name InvoiceTests \
--test-name SmokeTest
# 5. Run the test cases directly
id=$(uip tm testcases run \
--project-key DEMO \
--test-case-id a1b2c3d4-0000-0000-0000-000000000001 \
--execution-type automated \
--folder-key f0f0f0f0-0000-0000-0000-000000000001 \
--name "PR #42 smoke" \
--output-filter Id)
# 6. Block until done (timeout in seconds — 15 minutes here)
uip tm wait \
--execution-id "$id" \
--project-key DEMO \
--timeout 900
# 7. Read the result
uip tm report get --execution-id "$id" --project-key DEMO
# 8. Download JUnit XML for CI
uip tm result download \
--execution-id "$id" \
--project-key DEMO \
--result-path ./junit.xml
# 9. Download screenshots and logs
uip tm attachment download \
--execution-id "$id" \
--project-key DEMO \
--only-failed \
--result-path ./attachments
# 1. Discover your project key
uip tm project list --output json
# 2. Find the test case UUIDs you want to run
uip tm testcases list --project-key DEMO --filter "login" --output json
# 3. Find the folder that holds your package
uip or folders list --output json
# 4. Link the test case to the automation entry point
uip tm testcases link-automation \
--project-key DEMO \
--test-case-key DEMO:1 \
--folder-key f0f0f0f0-0000-0000-0000-000000000001 \
--package-name InvoiceTests \
--test-name SmokeTest
# 5. Run the test cases directly
id=$(uip tm testcases run \
--project-key DEMO \
--test-case-id a1b2c3d4-0000-0000-0000-000000000001 \
--execution-type automated \
--folder-key f0f0f0f0-0000-0000-0000-000000000001 \
--name "PR #42 smoke" \
--output-filter Id)
# 6. Block until done (timeout in seconds — 15 minutes here)
uip tm wait \
--execution-id "$id" \
--project-key DEMO \
--timeout 900
# 7. Read the result
uip tm report get --execution-id "$id" --project-key DEMO
# 8. Download JUnit XML for CI
uip tm result download \
--execution-id "$id" \
--project-key DEMO \
--result-path ./junit.xml
# 9. Download screenshots and logs
uip tm attachment download \
--execution-id "$id" \
--project-key DEMO \
--only-failed \
--result-path ./attachments
uip tm 测试用例添加
通过显式键或标签将测试用例添加到现有测试集。请仅传递 --test-case-keys 或 --labels 之一。
参数
无。
选项
| 标记 | 描述 |
|---|---|
--test-set-key <key> | 必需。测试集对象键(例如 DEMO:42)。 |
--test-case-keys <keys...> | 要添加的测试用例键,请用空格分隔(例如 DEMO:1 DEMO:2)。也接受逗号分隔的值。与 --labels 互斥。 |
--labels <labels...> | 以空格分隔的标签名称。在项目中添加至少带有一个标签的每个测试用例,包括PW_Tag_* 、 PW_Project_* 、 PW_Suite_*和PW_File_*在摄取时应用的pack标签。与 --test-case-keys 互斥。 |
--limit <count> | 待添加的标签匹配测试用例的最大数量。仅与 --labels 一起有效。默认为所有匹配项。 |
示例
# add by explicit keys
uip tm testcases add \
--test-set-key DEMO:42 \
--test-case-keys DEMO:1 DEMO:2
# add every test case carrying one of the given labels
uip tm testcases add \
--test-set-key DEMO:42 \
--labels PW_Tag_smoke PW_Project_chromium
# add by explicit keys
uip tm testcases add \
--test-set-key DEMO:42 \
--test-case-keys DEMO:1 DEMO:2
# add every test case carrying one of the given labels
uip tm testcases add \
--test-set-key DEMO:42 \
--labels PW_Tag_smoke PW_Project_chromium
数据形状
{
"Code": "TestSetAddTestCases",
"Data": {
"TestSetKey": "DEMO:42",
"Added": "DEMO:1, DEMO:2",
"Result": "Added"
}
}
{
"Code": "TestSetAddTestCases",
"Data": {
"TestSetKey": "DEMO:42",
"Added": "DEMO:1, DEMO:2",
"Result": "Added"
}
}
由 --labels 添加时,响应还包含 MatchedLabels:
{
"Code": "TestSetAddTestCases",
"Data": {
"TestSetKey": "DEMO:42",
"Added": "DEMO:3, DEMO:4, DEMO:7",
"MatchedLabels": "PW_Tag_smoke, PW_Project_chromium",
"Result": "Added"
}
}
{
"Code": "TestSetAddTestCases",
"Data": {
"TestSetKey": "DEMO:42",
"Added": "DEMO:3, DEMO:4, DEMO:7",
"MatchedLabels": "PW_Tag_smoke, PW_Project_chromium",
"Result": "Added"
}
}
删除 UIP TM 测试用例
从测试集中删除一个或多个测试用例。
参数
无。
选项
| 标记 | 描述 |
|---|---|
--test-set-key <key> | 必需。测试集对象键(例如 DEMO:42)。 |
--test-case-keys <keys> | 必需。要删除的以逗号分隔的测试用例键(例如,DEMO:1,DEMO:2)。 |
-y, --yes | 跳过确认提示。在非交互式环境中为必要项。 |
示例
uip tm testcases remove \
--test-set-key DEMO:42 \
--test-case-keys DEMO:1,DEMO:2 \
--yes
uip tm testcases remove \
--test-set-key DEMO:42 \
--test-case-keys DEMO:1,DEMO:2 \
--yes
数据形状
{
"Code": "TestSetRemoveTestCases",
"Data": {
"TestSetKey": "DEMO:42",
"Removed": "DEMO:1, DEMO:2",
"Result": "Removed"
}
}
{
"Code": "TestSetRemoveTestCases",
"Data": {
"TestSetKey": "DEMO:42",
"Removed": "DEMO:1, DEMO:2",
"Result": "Removed"
}
}
uip tm 测试用例列表步骤
列出测试用例的手动测试步骤。这是testcases steps list的别名。
参数
无。
选项
| 标记 | 描述 |
|---|---|
--project-key <key> | 必需。Test Manager 项目密钥(例如 DEMO)。 |
--test-case-id <uuid> | 必需。内部测试用例 UUID。 |
示例
uip tm testcases list-steps \
--project-key DEMO \
--test-case-id a1b2c3d4-0000-0000-0000-000000000001
uip tm testcases list-steps \
--project-key DEMO \
--test-case-id a1b2c3d4-0000-0000-0000-000000000001
数据形状
{
"Code": "TestCaseStepsList",
"Data": [
{
"Id": "d4e5f6a7-0000-0000-0000-000000000001",
"TestCaseId": "a1b2c3d4-0000-0000-0000-000000000001",
"OrderNo": 0,
"ActionType": "Manual",
"Description": "Open login page",
"ExpectedResult": "Login form is displayed"
}
]
}
{
"Code": "TestCaseStepsList",
"Data": [
{
"Id": "d4e5f6a7-0000-0000-0000-000000000001",
"TestCaseId": "a1b2c3d4-0000-0000-0000-000000000001",
"OrderNo": 0,
"ActionType": "Manual",
"Description": "Open login page",
"ExpectedResult": "Login form is displayed"
}
]
}
uip tm 测试用例步骤
testcases steps是一个子组,用于管理测试用例的各个手动步骤:列出、获取、添加、更新、移动和删除。
uip tm 测试用例步骤列表
按顺序列出测试用例的步骤。
参数
无。
选项
| 标记 | 描述 |
|---|---|
--project-key <key> | 必需。Test Manager 项目密钥。 |
--test-case-id <uuid> | 必需。内部测试用例 UUID。 |
示例
uip tm testcases steps list \
--project-key DEMO \
--test-case-id a1b2c3d4-0000-0000-0000-000000000001
uip tm testcases steps list \
--project-key DEMO \
--test-case-id a1b2c3d4-0000-0000-0000-000000000001
数据形状
{
"Code": "TestCaseStepsList",
"Data": [
{
"Id": "d4e5f6a7-0000-0000-0000-000000000001",
"OrderNo": 0,
"ActionType": "Manual",
"Description": "Open login page",
"ExpectedResult": "Login form is displayed"
}
]
}
{
"Code": "TestCaseStepsList",
"Data": [
{
"Id": "d4e5f6a7-0000-0000-0000-000000000001",
"OrderNo": 0,
"ActionType": "Manual",
"Description": "Open login page",
"ExpectedResult": "Login form is displayed"
}
]
}
获取 UIP TM 测试用例步骤
通过 UUID 获取单个步骤。
参数
无。
选项
| 标记 | 描述 |
|---|---|
--project-key <key> | 必需。Test Manager 项目密钥。 |
--step-id <uuid> | 必需。测试步骤 UUID(来自 steps list)。 |
示例
uip tm testcases steps get \
--project-key DEMO \
--step-id d4e5f6a7-0000-0000-0000-000000000001
uip tm testcases steps get \
--project-key DEMO \
--step-id d4e5f6a7-0000-0000-0000-000000000001
数据形状
{
"Code": "TestStepGet",
"Data": {
"Id": "d4e5f6a7-0000-0000-0000-000000000001",
"OrderNo": 0,
"ActionType": "Manual",
"Description": "Open login page",
"ExpectedResult": "Login form is displayed"
}
}
{
"Code": "TestStepGet",
"Data": {
"Id": "d4e5f6a7-0000-0000-0000-000000000001",
"OrderNo": 0,
"ActionType": "Manual",
"Description": "Open login page",
"ExpectedResult": "Login form is displayed"
}
}
添加 uip tm 测试用例步骤
向测试用例添加一个或多个步骤。对单个步骤使用内联标志,或对多个步骤使用--step <json> (可重复)。
参数
无。
选项
| 标记 | 描述 |
|---|---|
--project-key <key> | 必需。Test Manager 项目密钥。 |
--test-case-id <uuid> | 必需。要向其中添加步骤的测试用例。 |
--description <text> | 步骤说明(单步骤模式) 。 |
--expected-result <text> | 预期结果(单步模式) 。 |
--action-type <type> | 步骤操作类型(单步骤模式) 。 |
--clipboard-data <text> | 测试要为步骤复制的数据(单步骤模式) 。 |
--order-no <n> | 从 0 开始的插入位置;省略在末尾附加(单步模式) 。 |
--step <json> | 以 JSON 对象 ({"description":"...","expectedResult":"..."}) 形式呈现的步骤。重复此操作以添加多个步骤。 |
示例
# single step
uip tm testcases steps add \
--project-key DEMO \
--test-case-id a1b2c3d4-0000-0000-0000-000000000001 \
--description "Open login page" \
--expected-result "Login form is displayed"
# multiple steps
uip tm testcases steps add \
--project-key DEMO \
--test-case-id a1b2c3d4-0000-0000-0000-000000000001 \
--step '{"description":"Open login page","expectedResult":"Login form is shown"}' \
--step '{"description":"Enter credentials","clipboardData":"user@acme.com"}' \
--step '{"description":"Click submit","expectedResult":"Dashboard loads"}'
# single step
uip tm testcases steps add \
--project-key DEMO \
--test-case-id a1b2c3d4-0000-0000-0000-000000000001 \
--description "Open login page" \
--expected-result "Login form is displayed"
# multiple steps
uip tm testcases steps add \
--project-key DEMO \
--test-case-id a1b2c3d4-0000-0000-0000-000000000001 \
--step '{"description":"Open login page","expectedResult":"Login form is shown"}' \
--step '{"description":"Enter credentials","clipboardData":"user@acme.com"}' \
--step '{"description":"Click submit","expectedResult":"Dashboard loads"}'
数据形状
{
"Code": "TestStepAdd",
"Data": {
"AddedCount": 1,
"Steps": [
{
"Id": "d4e5f6a7-0000-0000-0000-000000000001",
"TestCaseId": "a1b2c3d4-0000-0000-0000-000000000001",
"OrderNo": 0,
"ActionType": "",
"Description": "Open login page",
"ExpectedResult": "Login form is displayed",
"ClipboardData": ""
}
]
}
}
{
"Code": "TestStepAdd",
"Data": {
"AddedCount": 1,
"Steps": [
{
"Id": "d4e5f6a7-0000-0000-0000-000000000001",
"TestCaseId": "a1b2c3d4-0000-0000-0000-000000000001",
"OrderNo": 0,
"ActionType": "",
"Description": "Open login page",
"ExpectedResult": "Login form is displayed",
"ClipboardData": ""
}
]
}
}
添加步骤不是自动化操作:如果多步骤 --step 批处理中的一个步骤失败,则在该步骤之前的步骤仍处于创建状态。错误消息会报告成功的数量,以便您使用 steps list 进行检查并仅重试其余部分。
uip tm 测试用例步骤更新
更新步骤说明、预期结果、操作类型或剪贴板数据。必须至少提供其中一个字段。
参数
无。
选项
| 标记 | 描述 |
|---|---|
--project-key <key> | 必需。Test Manager 项目密钥。 |
--step-id <uuid> | 必需。测试步骤 UUID。 |
--description <text> | 新说明。 |
--expected-result <text> | 新的预期结果。 |
--action-type <type> | 新的操作类型。 |
--clipboard-data <text> | 新剪贴板数据。 |
示例
uip tm testcases steps update \
--project-key DEMO \
--step-id d4e5f6a7-0000-0000-0000-000000000001 \
--expected-result "Dashboard is shown"
uip tm testcases steps update \
--project-key DEMO \
--step-id d4e5f6a7-0000-0000-0000-000000000001 \
--expected-result "Dashboard is shown"
数据形状
{
"Code": "TestStepUpdate",
"Data": {
"StepId": "d4e5f6a7-0000-0000-0000-000000000001",
"Result": "Updated"
}
}
{
"Code": "TestStepUpdate",
"Data": {
"StepId": "d4e5f6a7-0000-0000-0000-000000000001",
"Result": "Updated"
}
}
uip tm 测试用例步骤移动
在测试用例顺序中,将步骤移动至新位置。
参数
无。
选项
| 标记 | 描述 |
|---|---|
--project-key <key> | 必需。Test Manager 项目密钥。 |
--step-id <uuid> | 必需。测试步骤 UUID。 |
--target-position <n> | 必需。从 0 开始的新位置(0 = 优先)。匹配 OrderNo 中的 steps list 字段。 |
示例
uip tm testcases steps move \
--project-key DEMO \
--step-id d4e5f6a7-0000-0000-0000-000000000001 \
--target-position 2
uip tm testcases steps move \
--project-key DEMO \
--step-id d4e5f6a7-0000-0000-0000-000000000001 \
--target-position 2
数据形状
{
"Code": "TestStepMove",
"Data": {
"StepId": "d4e5f6a7-0000-0000-0000-000000000001",
"TargetPosition": 2,
"Result": "Moved"
}
}
{
"Code": "TestStepMove",
"Data": {
"StepId": "d4e5f6a7-0000-0000-0000-000000000001",
"TargetPosition": 2,
"Result": "Moved"
}
}
uip tm 测试用例步骤删除
从测试用例中删除步骤。这是永久性的。
参数
无。
选项
| 标记 | 描述 |
|---|---|
--project-key <key> | 必需。Test Manager 项目密钥。 |
--step-id <uuid> | 必需。测试步骤 UUID。 |
-y, --yes | 必需。确认此不可逆操作。 |
示例
uip tm testcases steps delete \
--project-key DEMO \
--step-id d4e5f6a7-0000-0000-0000-000000000001 \
--yes
uip tm testcases steps delete \
--project-key DEMO \
--step-id d4e5f6a7-0000-0000-0000-000000000001 \
--yes
数据形状
{
"Code": "TestStepDelete",
"Data": {
"StepId": "d4e5f6a7-0000-0000-0000-000000000001",
"Result": "Deleted"
}
}
{
"Code": "TestStepDelete",
"Data": {
"StepId": "d4e5f6a7-0000-0000-0000-000000000001",
"Result": "Deleted"
}
}
uip tm 测试用例日志列表断言
列出为单个测试用例日志记录的断言。每次运行测试用例都会产生一个测试用例日志;其断言是指自动化记录的各项单项检查。此动词表明测试用例日志标记为Failed原因。
此动词注册在 testcaselog(单数)下,以及下方的 testcaselog start 和 testcaselog finish 下,而非 testcases 或 testcaselogs(复数)下。uip tm testcaselogs list-assertions 不存在。
参数
无。
选项
| 标记 | 描述 |
|---|---|
--test-case-log-id <uuid> | 必需。测试用例日志 UUID。从 uip tm executions testcaselogs list 或 uip tm testcases list-result-history 获取。 |
--project-key <key> | 必需。拥有的项目。 |
示例
uip tm testcaselog list-assertions \
--test-case-log-id a1b2c3d4-0000-0000-0000-000000000001 \
--project-key DEMO
uip tm testcaselog list-assertions \
--test-case-log-id a1b2c3d4-0000-0000-0000-000000000001 \
--project-key DEMO
数据形状
{
"Code": "TestCaseLogAssertions",
"Data": [
{ "Message": "Title contains 'Welcome'", "Succeeded": true },
{ "Message": "Button 'Login' visible", "Succeeded": false }
]
}
{
"Code": "TestCaseLogAssertions",
"Data": [
{ "Message": "Title contains 'Welcome'", "Succeeded": true },
{ "Message": "Button 'Login' visible", "Succeeded": false }
]
}
uip tm 测试用例日志启动
在现有测试执行中启动测试用例执行。由自动化和集成使用以记录手动或混合测试用例运行 — 大多数用户不会直接调用此方法。
参数
无。
选项
| 标记 | 描述 |
|---|---|
--project-key <key> | 必需。拥有的项目。 |
--execution-id <uuid> | 必需。正在运行测试用例的测试执行。 |
--test-case-id <uuid> | 必需。正在记录的测试用例的内部 UUID。 |
--run-id <number> | 要记录的运行 ID。省略从执行的当前 RunId 自动查找。 |
示例
uip tm testcaselog start \
--project-key DEMO \
--execution-id a1b2c3d4-0000-0000-0000-000000000001 \
--test-case-id b2c3d4e5-0000-0000-0000-000000000001
uip tm testcaselog start \
--project-key DEMO \
--execution-id a1b2c3d4-0000-0000-0000-000000000001 \
--test-case-id b2c3d4e5-0000-0000-0000-000000000001
数据形状
{
"Code": "TestCaseLogStart",
"Data": {
"Id": "c3d4e5f6-0000-0000-0000-000000000001",
"TestCaseId": "b2c3d4e5-0000-0000-0000-000000000001",
"ProjectId": "00000000-0000-0000-0000-000000000abc",
"TestExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
"Result": "None",
"BusinessResult": "None",
"OriginalResult": "None",
"Status": "Running",
"ExecutionType": "manual",
"HasError": false,
"ExecutionStart": "2025-04-15T10:30:00Z",
"ExecutionEnd": null,
"ExecutedBy": "alice@example.com",
"RunId": 1,
"Updated": "2025-04-15T10:30:00Z"
}
}
{
"Code": "TestCaseLogStart",
"Data": {
"Id": "c3d4e5f6-0000-0000-0000-000000000001",
"TestCaseId": "b2c3d4e5-0000-0000-0000-000000000001",
"ProjectId": "00000000-0000-0000-0000-000000000abc",
"TestExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
"Result": "None",
"BusinessResult": "None",
"OriginalResult": "None",
"Status": "Running",
"ExecutionType": "manual",
"HasError": false,
"ExecutionStart": "2025-04-15T10:30:00Z",
"ExecutionEnd": null,
"ExecutedBy": "alice@example.com",
"RunId": 1,
"Updated": "2025-04-15T10:30:00Z"
}
}
Id 是测试用例日志 UUID — 在运行完成后,将其传递给 uip tm teststeplog list 或 testcaselog list-assertions。完整响应包含更多字段(AutomationId、JobKey、PreCondition、PostCondition 等),在开始时大部分为空;此处仅显示与跟踪进度相关的字段。
uip tm 测试用例日志完成
完成以 testcaselog start 开始的测试用例执行,在一次调用中记录整体结果和(可选)每个步骤的结果。
此命令没有 --test-case-log-id 或 --info 标志。finish 通过 --execution-id + --test-case-id(同一对传递给 start)重新标识运行,而不是通过返回的日志 UUID start 重新标识运行。
参数
无。
选项
| 标记 | 描述 |
|---|---|
--project-key <key> | 必需。拥有的项目。 |
--execution-id <uuid> | 必需。测试执行传递给 testcaselog start。 |
--test-case-id <uuid> | 必需。测试用例 testcaselog start 已通过审核。 |
--result <result> | 必需。总体结果(来自 SDK Result 枚举,例如 Passed Failed)。 |
--has-error <boolean> | 必需。将执行标记为有错误 (true/false)。 |
--executed-by <email> | 必需。执行测试的用户的电子邮件。 |
--detail-link <url> | 包含其他执行详细信息的 URL。 |
--run-id <number> | 要记录的运行 ID。省略从执行的当前 RunId 自动查找。 |
--is-post-condition-met <boolean> | 标记是否满足后置条件。 |
--step-logs <json> | 要为此测试用例执行记录的步骤日志对象的 JSON 数组。与 --step-logs-file 互斥。 |
--step-logs-file <path> | 结构与 --step-logs 相同的 JSON 文件的路径。与 --step-logs 互斥。 |
示例
# finish with step results inline
uip tm testcaselog finish \
--project-key DEMO \
--execution-id a1b2c3d4-0000-0000-0000-000000000001 \
--test-case-id b2c3d4e5-0000-0000-0000-000000000001 \
--result Passed \
--has-error false \
--executed-by alice@example.com \
--is-post-condition-met true \
--step-logs '[{"id":"3fa85f64-0000-0000-0000-000000000001","testStepId":"d4e5f6a7-0000-0000-0000-000000000001","result":"Passed","orderNo":1,"hasError":false,"hasAttachment":false}]'
# finish with step results loaded from a file
uip tm testcaselog finish \
--project-key DEMO \
--execution-id a1b2c3d4-0000-0000-0000-000000000001 \
--test-case-id b2c3d4e5-0000-0000-0000-000000000001 \
--result Failed \
--has-error true \
--executed-by alice@example.com \
--step-logs-file ./step-logs.json
# finish with step results inline
uip tm testcaselog finish \
--project-key DEMO \
--execution-id a1b2c3d4-0000-0000-0000-000000000001 \
--test-case-id b2c3d4e5-0000-0000-0000-000000000001 \
--result Passed \
--has-error false \
--executed-by alice@example.com \
--is-post-condition-met true \
--step-logs '[{"id":"3fa85f64-0000-0000-0000-000000000001","testStepId":"d4e5f6a7-0000-0000-0000-000000000001","result":"Passed","orderNo":1,"hasError":false,"hasAttachment":false}]'
# finish with step results loaded from a file
uip tm testcaselog finish \
--project-key DEMO \
--execution-id a1b2c3d4-0000-0000-0000-000000000001 \
--test-case-id b2c3d4e5-0000-0000-0000-000000000001 \
--result Failed \
--has-error true \
--executed-by alice@example.com \
--step-logs-file ./step-logs.json
数据形状
{
"Code": "TestCaseLogFinish",
"Data": {
"Id": "c3d4e5f6-0000-0000-0000-000000000001",
"TestCaseId": "b2c3d4e5-0000-0000-0000-000000000001",
"ProjectId": "00000000-0000-0000-0000-000000000abc",
"TestExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
"Result": "Passed",
"BusinessResult": "Passed",
"OriginalResult": "Passed",
"Status": "Finished",
"ExecutionType": "manual",
"HasError": false,
"ExecutionStart": "2025-04-15T10:30:00Z",
"ExecutionEnd": "2025-04-15T10:31:00Z",
"ExecutedBy": "alice@example.com",
"RunId": 1,
"IsPostConditionMet": true,
"Updated": "2025-04-15T10:31:00Z"
}
}
{
"Code": "TestCaseLogFinish",
"Data": {
"Id": "c3d4e5f6-0000-0000-0000-000000000001",
"TestCaseId": "b2c3d4e5-0000-0000-0000-000000000001",
"ProjectId": "00000000-0000-0000-0000-000000000abc",
"TestExecutionId": "a1b2c3d4-0000-0000-0000-000000000001",
"Result": "Passed",
"BusinessResult": "Passed",
"OriginalResult": "Passed",
"Status": "Finished",
"ExecutionType": "manual",
"HasError": false,
"ExecutionStart": "2025-04-15T10:30:00Z",
"ExecutionEnd": "2025-04-15T10:31:00Z",
"ExecutedBy": "alice@example.com",
"RunId": 1,
"IsPostConditionMet": true,
"Updated": "2025-04-15T10:31:00Z"
}
}
相关内容
- 包— 打包 Playwright 项目,并在摄取时自动链接其测试用例;不要对其创建的测试用例使用
link-automation。 - project — 拥有每个测试用例的作用域。
- 测试集— 将测试用例分组到可运行的套件中。
- executions — 测试用例日志的执行级别视图。
- 报告— 运行摘要,包含失败案例和断言文本。
另请参阅
- Test Manager 概述
uip or folders list—link-automation和list-automations的--folder-key的来源。uip or packages— 如何注册 Orchestrator 包和入口点。
- 大纲
- 创建 UIP TM 测试用例
- 参数
- 选项
- 示例
- 数据形状
- uip tm 测试用例列表
- 参数
- 选项
- 示例
- 数据形状
- uip tm 测试用例列表结果历史记录
- 参数
- 选项
- 示例
- 数据形状
- uip tm 测试用例更新
- 参数
- 选项
- 示例
- 数据形状
- uip tm 测试用例删除
- 参数
- 选项
- 示例
- 数据形状
- uip tm 测试用例链接自动化
- 参数
- 选项
- 示例
- 数据形状
- uip tm 测试用例链接包
- 参数
- 选项
- 示例
- 数据形状
- uip tm 测试用例取消链接自动化
- 参数
- 选项
- 示例
- 数据形状
- uip tm 测试用例列表自动化
- 参数
- 选项
- 示例
- 数据形状
- uip tm 测试用例列表测试集
- 参数
- 选项
- 示例
- 数据形状
- 运行 uip tm 测试用例
- 何时使用
testcases run与testsets run - 参数
- 选项
- 示例
- 数据形状
- 端到端工作流:打包到结果
- uip tm 测试用例添加
- 参数
- 选项
- 示例
- 数据形状
- 删除 UIP TM 测试用例
- 参数
- 选项
- 示例
- 数据形状
- uip tm 测试用例列表步骤
- 参数
- 选项
- 示例
- 数据形状
- uip tm 测试用例步骤
- uip tm 测试用例步骤列表
- 获取 UIP TM 测试用例步骤
- 添加 uip tm 测试用例步骤
- uip tm 测试用例步骤更新
- uip tm 测试用例步骤移动
- uip tm 测试用例步骤删除
- uip tm 测试用例日志列表断言
- 参数
- 选项
- 示例
- 数据形状
- uip tm 测试用例日志启动
- 参数
- 选项
- 示例
- 数据形状
- uip tm 测试用例日志完成
- 参数
- 选项
- 示例
- 数据形状
- 相关内容
- 另请参阅