@qawolf/cli 1.34.0 → 1.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { InspectOnRunnerRequest, JournalStream, PublicApiInput, PublicApiOutput, ReadJournalResponse, RunnerAction, RunnerNameForPublicApi, publicContractsV1 } from "@qawolf/api-contracts/v1";
|
|
2
2
|
type Runner = typeof publicContractsV1.runner;
|
|
3
3
|
export type RunnerSdkOptions = {
|
|
4
4
|
/** A QA Wolf team API key. The SDK never reads the CLI's stored credentials. */
|
|
@@ -77,7 +77,7 @@ export type EventsRequest = RunnerRequest & {
|
|
|
77
77
|
window: JournalWindow;
|
|
78
78
|
};
|
|
79
79
|
export type ActRequest = RunnerRequest & {
|
|
80
|
-
action:
|
|
80
|
+
action: RunnerAction;
|
|
81
81
|
/**
|
|
82
82
|
* Ask the runner to answer with a screenshot taken after the action, on
|
|
83
83
|
* `imageJpegBase64`. One call instead of an act and a screenshot, with no
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qawolf/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.36.0",
|
|
4
4
|
"description": "Run and manage QA Wolf flows from the terminal, CI, or an AI agent",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"automation",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@clack/prompts": "1.5.1",
|
|
72
72
|
"@napi-rs/keyring": "1.3.0",
|
|
73
73
|
"@oxc-node/core": "0.1.0",
|
|
74
|
-
"@qawolf/api-contracts": "0.
|
|
74
|
+
"@qawolf/api-contracts": "0.73.0",
|
|
75
75
|
"@qawolf/emails": "1.1.1",
|
|
76
76
|
"@qawolf/flow-targets": "1.0.0",
|
|
77
77
|
"@qawolf/flows": "0.1.4",
|
|
@@ -76,7 +76,9 @@ sequence, omit it when you want the payloads themselves.
|
|
|
76
76
|
|
|
77
77
|
A `--json` response shows you most of its own shape, so read it first.
|
|
78
78
|
|
|
79
|
-
`qawolf run get` is the exception worth reading about before you use it.
|
|
79
|
+
`qawolf run get` is the exception worth reading about before you use it. A
|
|
80
|
+
suite run can hold hundreds of flows, so start with
|
|
81
|
+
`--flow-statuses failed` and widen only if you need the rest. Its
|
|
80
82
|
artifact URLs expire, its failure fields are absent from a passing run, and its
|
|
81
83
|
`traceUrl` downloads a Playwright trace that you can read as JSON without
|
|
82
84
|
opening the trace viewer. **Read
|
|
@@ -164,8 +166,9 @@ that `url`; never guess a route and never send a repository link in its place.
|
|
|
164
166
|
| `qawolf install android` | local | Install Android system images, AVDs, and the Appium driver used by the project's Android flows |
|
|
165
167
|
| `qawolf install browsers` | local | Install Playwright browsers used by the project's web flows |
|
|
166
168
|
| `qawolf install clear` | local | Remove the managed runtime cache (all installed runtime versions) |
|
|
169
|
+
| `qawolf investigation get` | read | Read what the QA Wolf AI investigating a run has concluded: one finding per cause of its failures, with the question waiting for a person and any answer or dispute the investigation hasn't acted on yet. |
|
|
167
170
|
| `qawolf issue addFlows` | write | Add flows to a coverage request owned by the caller's team. Flows already covered stay covered. Bug and maintenance reports link to flows through the runs that reproduce them; use run.diagnose to record one. |
|
|
168
|
-
| `qawolf issue create` | write | Create a bug or coverage request issue for the caller's team.
|
|
171
|
+
| `qawolf issue create` | write | Create a bug report, maintenance report, or coverage request issue for the caller's team. A user can create a maintenance report only when they can see the workspace's maintenance reports; a team or organization API key credits it to the workspace's automation user. Link its failed flows afterwards with run.diagnose. |
|
|
169
172
|
| `qawolf issue find` | read | List the team's bug reports, maintenance reports, or coverage requests, newest first. |
|
|
170
173
|
| `qawolf issue get` | read | Get an issue by id. |
|
|
171
174
|
| `qawolf issue removeFlows` | write | Remove flows from a coverage request owned by the caller's team. Flows the request does not cover are left alone. Bug and maintenance reports link to flows through the runs that reproduce them, so their flows cannot be set directly. |
|
|
@@ -176,11 +179,10 @@ that `url`; never guess a route and never send a repository link in its place.
|
|
|
176
179
|
| `qawolf run create` | write | Create a run for the selected flows and/or tags in an environment. |
|
|
177
180
|
| `qawolf run diagnose` | write | Diagnose failed flows in a run as reproductions of a bug or maintenance report owned by the caller's team. The issue's type selects the diagnosis. Each flow must have failed in the run. A flow that is already diagnosed moves to this issue. The diagnosis appears on the run, and the reproduction appears under the issue's reproductions. Coverage requests cannot be diagnosed; use issue.addFlows to cover flows instead. |
|
|
178
181
|
| `qawolf run find` | read | List an environment's recent runs, newest first. |
|
|
179
|
-
| `qawolf run get` | read | Get a run's status, per-flow results, and
|
|
182
|
+
| `qawolf run get` | read | Get a run's status, per-flow results, links, and how many of its bugs are blocking. |
|
|
180
183
|
| `qawolf run reattempt` | write | Request new attempts for a run's flows, in the same run. A flow is eligible once its result is failed or canceled and QA Wolf's automatic retries have finished. A fully investigated run no longer accepts reattempts. Attempts run with the latest flow code. Poll run.get for results. |
|
|
181
184
|
| `qawolf run stop` | write | Stop a run, including its queued flows and automatic retries. Stopping is asynchronous and can update run-status messages and commit statuses in connected integrations. Repeated requests are safe, and finished runs keep their results. A run that is still being created returns not found; retry once run.get returns the run. If run.get returns a different runId, use that ID. Poll run.get for results. |
|
|
182
|
-
| `qawolf
|
|
183
|
-
| `qawolf runner act` | write | Perform one raw action on a runner's screen: click, double_click, scroll, move, drag, keypress, navigate or type. Use - to read a whole action as JSON from stdin. On a mobile runner only click (button left), drag and type have a touchscreen equivalent; the rest answer action-not-supported-on-mobile |
|
|
185
|
+
| `qawolf runner act` | write | Perform one raw action on a runner's screen. A browser runner takes click, double_click, scroll, move, drag, keypress, navigate and type; a mobile runner takes tap, swipe, fill and type. A browser runner answers mobile actions with action-not-supported-on-browser; a mobile runner answers the other browser actions with action-not-supported-on-mobile. Use - to read a whole action as JSON from stdin |
|
|
184
186
|
| `qawolf runner actions` | write | Perform a sequence of up to ten raw actions on a runner's screen in one request, as a JSON array of the same actions `runner act` takes. Use - to read the array from stdin. Actions run back to back, so batch only steps whose targets are on the screen you last saw, and end the sequence at the step that changes the page. Each result carries an effect: performed, not-performed, or unknown when the runner stopped answering and the action may have landed |
|
|
185
187
|
| `qawolf runner events` | read | Print a runner's journal, one entry per line. QA Wolf writes console, recorder, run-events, run-logs, run-status |
|
|
186
188
|
| `qawolf runner exec` | write | Evaluate a snippet against a runner's live page. Use - to read the snippet from stdin |
|
|
@@ -8,6 +8,32 @@ this file for the parts a single response cannot show you: fields that appear
|
|
|
8
8
|
only when something fails, rules about the artifact URLs, and how to read a
|
|
9
9
|
trace without opening the trace viewer.
|
|
10
10
|
|
|
11
|
+
## Start with the failed flows
|
|
12
|
+
|
|
13
|
+
A run of a whole suite can hold hundreds of flows, and the full response then
|
|
14
|
+
runs to hundreds of kilobytes: more than a shell shows you, and more than any
|
|
15
|
+
investigation needs. The interesting part is a handful of failed flows, so ask
|
|
16
|
+
for those first:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
qawolf run get --run-id "$RUN_ID" --flow-statuses failed --json
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`--flow-statuses` takes one or more of `queued`, `running`, `passed`, `failed`
|
|
23
|
+
and `canceled`, separated by spaces (`--flow-statuses failed canceled`), and
|
|
24
|
+
keeps only the flows whose status matches. The run-level fields (`status`,
|
|
25
|
+
`blockingBugCount`, `git`, `url`) still describe the whole run, so a filtered
|
|
26
|
+
read tells you both how the run went and which flows to look at. Widen the
|
|
27
|
+
filter, or drop it, only when you need the other flows too.
|
|
28
|
+
|
|
29
|
+
A flow that failed and then passed on a retry has status `passed`, so a
|
|
30
|
+
`failed`-only read leaves it out. If the flow you were asked about passed on a
|
|
31
|
+
retry, add `passed` to the filter and read its earlier attempts. For a flow
|
|
32
|
+
that is still queued, running or was canceled, widen the filter or drop it.
|
|
33
|
+
|
|
34
|
+
Do not save the full response to a file and script over it to find the failed
|
|
35
|
+
flows. The filter answers that in one call.
|
|
36
|
+
|
|
11
37
|
## The shape
|
|
12
38
|
|
|
13
39
|
A run holds flows, a flow holds attempts, and artifacts hang off an attempt:
|
|
@@ -63,7 +89,7 @@ recording) and `traceUrl` (a Playwright `trace.zip`).
|
|
|
63
89
|
authentication header is needed and no QA Wolf credentials are involved.
|
|
64
90
|
|
|
65
91
|
```bash
|
|
66
|
-
qawolf run get --run-id "$RUN_ID" --json \
|
|
92
|
+
qawolf run get --run-id "$RUN_ID" --flow-statuses failed --json \
|
|
67
93
|
| jq -r '.flows[].attempts[-1].traceUrl // empty' \
|
|
68
94
|
| head -1 \
|
|
69
95
|
| xargs -r curl -sS -o trace.zip
|
|
@@ -157,9 +183,11 @@ Every documented field of the `run.get` response. `[]` marks an array, so
|
|
|
157
183
|
- `completedAt` — When the run finished executing. Absent while queued or running, and also absent for a terminal run that never completed execution (e.g. every flow was canceled or skipped).
|
|
158
184
|
- `git` — The branch and commit under test. The fields are present when a deploy notification started the run, and absent for runs started another way, for example manually or with run.create.
|
|
159
185
|
- `git.commitUrl` — Link to the commit on the code host.
|
|
186
|
+
- `needsReview` — True once every flow has finished its attempts and at least one failed flow still has no diagnosis, including one whose investigation carried over to a later run. `status` stays `running` until that failure is diagnosed, so a caller that is not waiting for a diagnosis can stop polling here and read the run's failed flows.
|
|
160
187
|
- `runId` — The run this response describes. Treat it as canonical: it can differ from the id you asked for. A deploy notification returns a run id before the run exists, and if a second notification for the same commit is folded into an earlier run, that id resolves to the earlier run instead.
|
|
161
188
|
- `status` — One of: queued, running, passed, failed, canceled
|
|
162
|
-
- `
|
|
189
|
+
- `blockingBugCount` — How many bugs this run found are blocking: still open, and priority urgent, high, or unprioritized — unprioritized counts because nobody has ruled it out yet. This is what `failed` is derived from, so it explains a failure rather than adding a second verdict: gate on `status`, then read this to say how many bugs are holding the build. It counts a bug filed against a later run by an investigation that carried over from this one, and it drops a bug once that bug is resolved.
|
|
190
|
+
- `flows` — The run's flows, ordered alphabetically by name. Only the flows matching flowStatuses when the request set it.
|
|
163
191
|
- `flows[].attempts` — The flow's finished execution attempts, oldest first, including manual Wolf Browser attempts. Present once at least one attempt has finished, so a flow that passed after retries also lists its failed attempts. Artifact URLs appear only on automated attempts that reached a verdict, stay valid for at least a day (call run.get again for fresh ones), and can return 404 when the attempt did not produce that artifact.
|
|
164
192
|
- `flows[].attempts[].logsUrl` — Signed URL for the attempt's execution logs.
|
|
165
193
|
- `flows[].attempts[].traceUrl` — Signed URL for the attempt's Playwright trace (a trace.zip; open it with `npx playwright show-trace`).
|
|
@@ -126,7 +126,7 @@ Retry on the exit code, not on the message text:
|
|
|
126
126
|
launch the id or name one that is running. The message says which runner was
|
|
127
127
|
meant and whether `--runner`, `QAWOLF_RUNNER_ID` or this directory's stored
|
|
128
128
|
default chose it — read that line before you pick an id to launch.
|
|
129
|
-
- `2` will not clear on its own. Nothing has run on this runner yet, so run a flow; or the runner has no browser at all, so launch with `--name playwright` instead; or the action
|
|
129
|
+
- `2` will not clear on its own. Nothing has run on this runner yet, so run a flow; or the runner has no browser at all, so launch with `--name playwright` instead; or the action belongs to the other runner family, so send `tap`, `swipe` or `fill` to a mobile runner and the browser actions to a browser runner. A `runner actions` sequence also exits `2` before it sends anything, for an argument that is not a JSON array, an array of more than ten actions, and `--screenshot` flags that contradict each other. The message says which.
|
|
130
130
|
|
|
131
131
|
## Seeing and acting: the loop is yours
|
|
132
132
|
|
|
@@ -167,17 +167,18 @@ Coordinates are pixels on the same screenshot you just read. The runner serves o
|
|
|
167
167
|
|
|
168
168
|
`act`, `actions`, `run` and `exec` are the commands whose lost answer may still have taken effect. On a `4` from `act` or `actions`, take a screenshot before repeating a click. `exec`'s message says the snippet could not be evaluated, but a lost answer looks the same from outside, so treat a `4` from a snippet that changes something as "may have run" rather than "did not run".
|
|
169
169
|
|
|
170
|
-
A mobile runner has a touchscreen, not a mouse, so
|
|
171
|
-
|
|
172
|
-
`
|
|
173
|
-
|
|
174
|
-
`
|
|
175
|
-
|
|
176
|
-
|
|
170
|
+
A mobile runner has a touchscreen, not a mouse, so it has actions of its own:
|
|
171
|
+
|
|
172
|
+
- `tap` touches a point (`--x`, `--y`) or the element `--selector` names. Check the selector first with `inspect elements --selector`, and pass `--strategy ios-predicate` or `shadow` when it is not XPath.
|
|
173
|
+
- `swipe --from x,y --to x,y` moves in a straight line between two points. `--duration-ms` sets how long it takes, up to 10000: a slow swipe scrolls, a fast one flings.
|
|
174
|
+
- `fill --selector ... --text ...` replaces the value of that field, and `--text ""` clears it. To add to what a field already holds, `tap` it and then `type`.
|
|
175
|
+
- `type` types into whatever the last tap focused, the same as on a browser.
|
|
176
|
+
|
|
177
|
+
The browser actions `double_click`, `scroll`, `move`, `keypress` and `navigate` answer `action-not-supported-on-mobile` rather than doing something approximate. `navigate` is the one to watch for, since it works on a browser runner without a run first but has no meaning on mobile at all. `click` with `button: "left"` and `drag` still tap and swipe on mobile, but they are deprecated there, so send `tap` and `swipe`. A browser runner answers `tap`, `swipe` and `fill` with `action-not-supported-on-browser`.
|
|
177
178
|
|
|
178
179
|
### Several steps in one request: `runner actions`
|
|
179
180
|
|
|
180
|
-
`qawolf runner actions '<json array>'` performs up to ten of
|
|
181
|
+
`qawolf runner actions '<json array>'` performs up to ten of the browser actions back to back in one request (not `tap`, `swipe` or `fill`), for the steps you already know: click the field, type into it, press Enter. One round trip instead of three, with no delay to guess at between them, and `-` reads the array from stdin the way `act -` reads one action.
|
|
181
182
|
|
|
182
183
|
```sh
|
|
183
184
|
qawolf runner actions '[{"type":"click","button":"left","x":480,"y":260},{"type":"type","text":"me@example.com"},{"type":"keypress","keys":["Enter"]}]' --screenshot after-login.jpg
|