Skip to content

Commit 9c1acd6

Browse files
docs(testbench-cli-reporter): version 3.0.0
1 parent 5197d8a commit 9c1acd6

19 files changed

Lines changed: 1352 additions & 0 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"label": "CLI reference",
3+
"position": 4
4+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
sidebar_position: 1
3+
title: Authentication & connection
4+
---
5+
6+
## Connection options
7+
8+
All subcommands accept the same connection options:
9+
10+
- `--server` TestBench server as `hostname`, `hostname:port`, or `https://host:port/api/`
11+
- `--login` / `--password` credentials
12+
- `--session` existing session token (or for JSON export or import, a JWT token)
13+
- `--verify` verify TLS certificates
14+
15+
If you provide `hostname` without a port, the CLI assumes port `443` and always uses `https://.../api/`.
16+
17+
## When to use `--session`
18+
19+
`--session` is only used for TestBench 4.x, where the API issues a session token.
20+
21+
If you provide `--login` and `--password`, the CLI will:
22+
23+
- detect the TestBench server version
24+
- authenticate using the appropriate mechanism for that version
25+
26+
## Config file authentication fields
27+
28+
In automatic mode configs, each entry in `configuration[]` can contain:
29+
30+
- `sessionToken`: a session token or JWT token (TestBench 4.x)
31+
- `basicAuth`: base64 of `login:password`
32+
- `loginname` / `password`: optional plaintext credentials
33+
34+
The CLI can also override these fields at runtime via `--login/--password` or `--session`.
Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
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.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"label": "Compatibility",
3+
"position": 6
4+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
sidebar_position: 1
3+
title: TestBench 3.x vs 4.x
4+
---
5+
6+
The CLI is built to work with both current TestBench 3.x installations and the upcoming TestBench 4.x API.
7+
8+
## Version detection
9+
10+
On startup, the client reads the server version from:
11+
12+
- `GET /api/2/serverVersions` (preferred)
13+
- fallback: `GET /api/1/serverVersions`
14+
15+
The detected version influences authentication and which endpoints are used.
16+
17+
## Authentication
18+
19+
- TestBench 4.x: session-based authentication
20+
- the CLI requests a session token and sends it via the `Authorization` header
21+
- you can also supply an existing session token or a JWT via `--session`
22+
- for TestBench 4.x, the authentication is always done via the `/api/2/auth` endpoint, even if XML exports or other legacy endpoints are used
23+
- TestBench 3.x: legacy authentication
24+
- the CLI uses HTTP basic auth to call legacy endpoints
25+
26+
## Feature availability
27+
28+
Some features depend on server capabilities:
29+
30+
- CSV export requires TestBench >= 3.0.6.2
31+
- JSON export/import and JWT generation require TestBench 4.x+
32+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"label": "Configuration",
3+
"position": 5
4+
}

0 commit comments

Comments
 (0)