|
| 1 | +--- |
| 2 | +sidebar_position: 2 |
| 3 | +title: Commands |
| 4 | +--- |
| 5 | + |
| 6 | +This section documents the explicit, non-interactive subcommands. |
| 7 | + |
| 8 | +All commands require a connection via `--server` and either `--session` or `--login`/`--password`. |
| 9 | + |
| 10 | + |
| 11 | +## Project Path or Keys |
| 12 | + |
| 13 | +Many commands that operate on a project, test object version, or test cycle accept either: |
| 14 | +- The name of the project, version, or cycle<br /> |
| 15 | + (e.g. `--project "My Project" --version "Release 1.0" --cycle "Cycle A"`) |
| 16 | +- The key of the project, version, or cycle<br /> |
| 17 | + (e.g. `--project-key 102 --tov-key 1223 --cycle-key 5121`) |
| 18 | + |
| 19 | +If the keys are provided, they take precedence over the names. |
| 20 | +If no keys are provided, the CLI Reporter tries to resolve the names to keys by querying the TestBench server. |
| 21 | + |
| 22 | + |
| 23 | +## Common connection options |
| 24 | + |
| 25 | +Every subcommand accepts these options: |
| 26 | + |
| 27 | +| Option | Short | Description | |
| 28 | +|---|---|---| |
| 29 | +| `--server` | `-s` | TestBench server address (`hostname[:port]` or full URL) | |
| 30 | +| `--login` | | Login name for authentication | |
| 31 | +| `--password` | | Password for authentication | |
| 32 | +| `--session` | | Existing session token (alternative to login/password) | |
| 33 | +| `--verify` | | Enable TLS certificate verification (flag, off by default) | |
| 34 | + |
| 35 | +These options can also be set on the main `testbench-cli-reporter` command and inherited by subcommands. |
| 36 | + |
| 37 | +--- |
| 38 | + |
| 39 | +## `export-xml` |
| 40 | + |
| 41 | +Export an XML full report (zip). |
| 42 | + |
| 43 | +```bash |
| 44 | +testbench-cli-reporter export-xml -s HOST[:PORT] --login USER --password PASS \ |
| 45 | + --tov-key TOV --cycle-key CYCLE --uid itb-TT-1234 -o report.zip |
| 46 | +``` |
| 47 | + |
| 48 | +| Option | Short | Required | Default | Description | |
| 49 | +|---|---|---|---|---| |
| 50 | +| `--project` | `-p` | | | Project name | |
| 51 | +| `--version` | `-v` | | | Test object version name | |
| 52 | +| `--cycle` | `-y` | | | Test cycle name | |
| 53 | +| `--project-key` | | | | Project key (currently not relevant for XML export) | |
| 54 | +| `--tov-key` | | | | Test object version key | |
| 55 | +| `--cycle-key` | | | | Test cycle key | |
| 56 | +| `--uid` | `-u` | | | Report root UID (test theme root). If omitted, exports the full tree | |
| 57 | +| `--filtering` | | | | FilteringOptions payload as base64-encoded JSON (see [FilteringOptions](../configuration/filtering-options.md)) | |
| 58 | +| `--output` | `-o` | | `report.zip` | Output zip file path | |
| 59 | + |
| 60 | +You must provide either `--project`/`--version`[/`--cycle`] (by name) or `--tov-key`/`--cycle-key` (by key). |
| 61 | + |
| 62 | +--- |
| 63 | + |
| 64 | +## `import-xml` |
| 65 | + |
| 66 | +Import an XML execution results zip back into TestBench. |
| 67 | + |
| 68 | +Project, version, and cycle are determined from the XML content and don't need to be provided as options. |
| 69 | + |
| 70 | +```bash |
| 71 | +testbench-cli-reporter import-xml -s HOST[:PORT] --login USER --password PASS \ |
| 72 | + --input report.zip |
| 73 | +``` |
| 74 | + |
| 75 | +| Option | Short | Required | Default | Description | |
| 76 | +|---|---|---|---|---| |
| 77 | +| `--input` | `-i` | **yes** | | Path to the XML results zip file | |
| 78 | +| `--uid` | `-u` | | `ROOT` | Report root UID | |
| 79 | +| `--filtering` | | | | FilteringOptions payload as base64-encoded JSON | |
| 80 | + |
| 81 | +--- |
| 82 | + |
| 83 | +## `export-json` |
| 84 | + |
| 85 | +Export a JSON full report (zip). |
| 86 | + |
| 87 | +```bash |
| 88 | +testbench-cli-reporter export-json -s HOST[:PORT] --login USER --password PASS \ |
| 89 | + --project-key PROJECT --tov-key TOV --cycle-key CYCLE \ |
| 90 | + --uid itb-TT-1234 -o json-report.zip |
| 91 | +``` |
| 92 | + |
| 93 | +| Option | Short | Required | Default | Description | |
| 94 | +|---|---|---|---|---| |
| 95 | +| `--project` | `-p` | | | Project name | |
| 96 | +| `--version` | `-v` | | | Test object version name | |
| 97 | +| `--cycle` | `-y` | | | Test cycle name | |
| 98 | +| `--project-key` | | | | Project key | |
| 99 | +| `--tov-key` | | | | Test object version key | |
| 100 | +| `--cycle-key` | | | | Test cycle key | |
| 101 | +| `--uid` | `-u` | | | Tree root UID | |
| 102 | +| `--filtering` | | | | FilteringOptions payload as base64-encoded JSON | |
| 103 | +| `--output` | `-o` | | `json-report.zip` | Output zip file path | |
| 104 | + |
| 105 | +You must either provide the keys for project and tov or cylce, or the names for project and version (and optionally cycle). |
| 106 | + |
| 107 | +--- |
| 108 | + |
| 109 | +## `import-json` |
| 110 | + |
| 111 | +Import a JSON execution results zip back into TestBench. |
| 112 | + |
| 113 | +Project, test object version, and test cycle are determined from the JSON report metadata. |
| 114 | + |
| 115 | +```bash |
| 116 | +testbench-cli-reporter import-json -s HOST[:PORT] --login USER --password PASS \ |
| 117 | + --input json-report.zip |
| 118 | +``` |
| 119 | + |
| 120 | +| Option | Short | Required | Default | Description | |
| 121 | +|---|---|---|---|---| |
| 122 | +| `--input` | `-i` | **yes** | | Path to the JSON results zip file | |
| 123 | +| `--uid` | `-u` | | | Report root UID | |
| 124 | +| `--filtering` | | | | FilteringOptions payload as base64-encoded JSON | |
| 125 | + |
| 126 | +--- |
| 127 | + |
| 128 | +## `export-csv` |
| 129 | + |
| 130 | +Export a CSV report zip. |
| 131 | + |
| 132 | +```bash |
| 133 | +testbench-cli-reporter export-csv -s HOST[:PORT] --login USER --password PASS \ |
| 134 | + --project-key PROJECT --tov-key TOV --cycle-key CYCLE --cycle-key CYCLE2 \ |
| 135 | + --uid itb-TT-1234 -o csv_report.zip |
| 136 | +``` |
| 137 | + |
| 138 | +| Option | Short | Required | Default | Description | |
| 139 | +|---|---|---|---|---| |
| 140 | +| `--project-key` | | **yes** | | Project key | |
| 141 | +| `--tov-key` | | **yes** | | Test object version key | |
| 142 | +| `--cycle-key` | | | | Test cycle key (repeatable; omit to export without cycle scope) | |
| 143 | +| `--uid` | `-u` | | | Report root UID | |
| 144 | +| `--output` | `-o` | | `csv_report.zip` | Output zip file path | |
| 145 | + |
| 146 | +--- |
| 147 | + |
| 148 | +## `export-logs` |
| 149 | + |
| 150 | +Administrator helper: export TestBench server logs as a zip. |
| 151 | + |
| 152 | +```bash |
| 153 | +testbench-cli-reporter export-logs -s HOST[:PORT] --login USER --password PASS \ |
| 154 | + -o server_logs.zip |
| 155 | +``` |
| 156 | + |
| 157 | +| Option | Short | Required | Default | Description | |
| 158 | +|---|---|---|---|---| |
| 159 | +| `--output` | `-o` | | `server_logs.zip` | Output zip file path | |
| 160 | + |
| 161 | +--- |
| 162 | + |
| 163 | +## `gen-jwt` |
| 164 | + |
| 165 | +Generate a JWT based on the current session (TestBench 4.x+). |
| 166 | + |
| 167 | +```bash |
| 168 | +testbench-cli-reporter gen-jwt -s HOST[:PORT] --login USER --password PASS \ |
| 169 | + --permission ReadProjectHierarchy --permission ImportExecutionResults \ |
| 170 | + --project-key PROJECT --tov-key TOV --cycle-key CYCLE \ |
| 171 | + --subject my-service --expires 3600 |
| 172 | +``` |
| 173 | + |
| 174 | +| Option | Short | Required | Default | Description | |
| 175 | +|---|---|---|---|---| |
| 176 | +| `--permission` | | | | Permission to include (repeatable; accepts comma or `\|` separated lists) | |
| 177 | +| `--project-key` | | | | Project key | |
| 178 | +| `--tov-key` | | | | Test object version key | |
| 179 | +| `--cycle-key` | | | | Test cycle key | |
| 180 | +| `--subject` | | | | Subject claim for the token | |
| 181 | +| `--expires` | | | | Token expiry in seconds | |
| 182 | + |
| 183 | +Run `testbench-cli-reporter gen-jwt --help` to see the full list of available permission names. |
0 commit comments