@monkeytestai/monkeytester 0.5.0 → 0.6.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.
- package/CHANGELOG.md +33 -0
- package/README.md +15 -3
- package/dist/automation/signatures.d.ts +70 -0
- package/dist/automation/signatures.d.ts.map +1 -0
- package/dist/automation/signatures.js +152 -0
- package/dist/automation/signatures.js.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +48 -10
- package/dist/cli.js.map +1 -1
- package/dist/depth.d.ts +40 -0
- package/dist/depth.d.ts.map +1 -0
- package/dist/depth.js +70 -0
- package/dist/depth.js.map +1 -0
- package/dist/events.d.ts +1 -1
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js.map +1 -1
- package/dist/explorer/index.d.ts +77 -0
- package/dist/explorer/index.d.ts.map +1 -1
- package/dist/explorer/index.js +224 -40
- package/dist/explorer/index.js.map +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/llm/coerce.d.ts +59 -0
- package/dist/llm/coerce.d.ts.map +1 -0
- package/dist/llm/coerce.js +246 -0
- package/dist/llm/coerce.js.map +1 -0
- package/dist/monkey.d.ts.map +1 -1
- package/dist/monkey.js +41 -14
- package/dist/monkey.js.map +1 -1
- package/dist/outcome.d.ts +48 -0
- package/dist/outcome.d.ts.map +1 -0
- package/dist/outcome.js +366 -0
- package/dist/outcome.js.map +1 -0
- package/dist/planner/focus.d.ts +13 -0
- package/dist/planner/focus.d.ts.map +1 -0
- package/dist/planner/focus.js +136 -0
- package/dist/planner/focus.js.map +1 -0
- package/dist/planner/forms.d.ts +5 -0
- package/dist/planner/forms.d.ts.map +1 -1
- package/dist/planner/forms.js +16 -5
- package/dist/planner/forms.js.map +1 -1
- package/dist/planner/index.d.ts +8 -1
- package/dist/planner/index.d.ts.map +1 -1
- package/dist/planner/index.js +23 -13
- package/dist/planner/index.js.map +1 -1
- package/dist/planner/salvage.d.ts.map +1 -1
- package/dist/planner/salvage.js +31 -13
- package/dist/planner/salvage.js.map +1 -1
- package/dist/planner/verdict.d.ts +13 -0
- package/dist/planner/verdict.d.ts.map +1 -0
- package/dist/planner/verdict.js +47 -0
- package/dist/planner/verdict.js.map +1 -0
- package/dist/runner/actions.d.ts +24 -2
- package/dist/runner/actions.d.ts.map +1 -1
- package/dist/runner/actions.js +175 -31
- package/dist/runner/actions.js.map +1 -1
- package/dist/runner/flowStatus.d.ts +9 -0
- package/dist/runner/flowStatus.d.ts.map +1 -0
- package/dist/runner/flowStatus.js +16 -0
- package/dist/runner/flowStatus.js.map +1 -0
- package/dist/runner/index.d.ts.map +1 -1
- package/dist/runner/index.js +9 -4
- package/dist/runner/index.js.map +1 -1
- package/dist/runner/replay.d.ts.map +1 -1
- package/dist/runner/replay.js +23 -3
- package/dist/runner/replay.js.map +1 -1
- package/dist/triager/index.d.ts +28 -1
- package/dist/triager/index.d.ts.map +1 -1
- package/dist/triager/index.js +37 -5
- package/dist/triager/index.js.map +1 -1
- package/dist/types.d.ts +51 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.6.0] — 2026-10-30
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Run outcome fields on `RunResult`, set by `triage()`: `outcome` (`bugs_found` | `clean` | `inconclusive` | `could_not_test`), `outcome_reason` (machine code), and `outcome_detail` (a sentence plus a next step). The names match the SaaS `audit_run` columns. `could_not_test` means nothing was tested (no pages, no flows, or the site was unreachable). `login_required` is used only when a login wall was actually seen.
|
|
15
|
+
- Per-flow `outcome_reason` and `outcome_detail`. Flow status `inconclusive` means every planned step was skipped, or the only failures were the runner's. `stats.flowsInconclusive` counts those flows. Existing statuses keep their meaning.
|
|
16
|
+
- `AUTOMATION_FAULT_SIGNATURES`, `isAutomationFault`, `isOwnAutomationBug`, and `matchesClientSoftExploratory`. These are the Playwright and exploratory misses that must not become confirmed bugs. The list is a superset of mtaiclient `confirmedBugs.js`. A host can import it instead of copying the signatures.
|
|
17
|
+
- `alignVerdict` / `verdictContradicts`. An optional `planner.verdict` LLM sentence is kept only when it agrees with the filtered bug count. "Worked smoothly" beside a bug, or "major bug" with zero bugs, is replaced by the deterministic `outcome_detail`. When the cause is the runner, the sentence says "Our test couldn't complete".
|
|
18
|
+
- Quick pass depth preset. Id `basic`, label "Quick pass": 6 pages, 4 flows, planner focus `forms-search-cta`. CLI `--depth basic` (alias `--depth quick-pass`). `resolveDepthPreset` and `DEPTH_PRESETS` are the same table (`standard`, `deep`, `shallow` included). An explicit `--max` or `--flows` still wins.
|
|
19
|
+
- `valueForInput` / `numericText`. Number and tel fields get digits. `555-0100` typed at a number input becomes `5550100`.
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- The runner no longer types `555-0100` into `input[type=number]`. Playwright's "Cannot type text into input" error is classified inconclusive, not a High bug.
|
|
24
|
+
- Playwright and selector failures (not an `<input>`, InvalidSelector, strict mode, detached nodes, element not found, selector timeouts, and the mtaiclient soft-timeout and page-title rules) are inconclusive. HTTP 5xx, uncaught page errors, disabled controls, and document HTTP 404 are still bugs. Fingerprints for those real bugs are unchanged.
|
|
25
|
+
- A flow whose every step was skipped is `inconclusive`, not `passed`.
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- `new Monkey()` asks the planner model for a one-line verdict and then runs `alignVerdict`. A model failure leaves the deterministic sentence in place. `triage()` itself stays synchronous and does not call a model.
|
|
30
|
+
|
|
31
|
+
## Notes recorded before 0.6.0
|
|
32
|
+
|
|
33
|
+
The notes below were already in the tree before 0.6.0 and describe behaviour shipped in 0.5.x.
|
|
34
|
+
|
|
10
35
|
### Changed
|
|
11
36
|
|
|
12
37
|
- README and the docs installed from npm as `npm install @monkeytestai/monkeytest-core` (published 0.4.0). A clone remained the contributor path, including the no-key smoke script. 0.5.0 renames that package to `@monkeytestai/monkeytester`.
|
|
@@ -40,6 +65,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
40
65
|
- A planner model response that is invalid JSON, fails schema validation, or includes a flow with empty `steps` no longer wipes the plan. Usable model flows are kept. The public-form submit flow and scraped fault-control flows are still added, up to `maxFlows`. `plan()` records the model error on `TestPlan.notes` and emits `engine.error`. `executeAndTriage` runs that plan. An empty plan remains only when the crawl has no public form and no fault control. `RunResult` fields are unchanged. `groundedTestPlan(siteMap, maxFlows)` is the same crawl-only floor, for a host that catches a planner failure itself.
|
|
41
66
|
- The per-flow timeout no longer leaves its timer running after the flow finishes, and it closes the browser context when the budget is exceeded.
|
|
42
67
|
|
|
68
|
+
## [0.5.1] — 2026-10-26
|
|
69
|
+
|
|
70
|
+
### Fixed
|
|
71
|
+
|
|
72
|
+
- A model site summary that does not match the schema no longer aborts exploration. `authSurfaces` and `publicJourneys` accept a string or an object with `url` / `label` / `name` / `path` and are stored as `string[]`. The same coercion covers the other structured-output calls (per-page summary, planner salvage, bug polish, runner tool choice): string booleans, one object where an array was asked for, enum case and a few tool aliases, over-long polish fields clipped to the limit, and a single planner flow or step object. When the site summary still cannot be read, the crawl keeps the pages it already visited, fills a basic map from titles and URLs, and continues. `SiteMap.warnings` and the `explore.warning` event carry a short sentence safe to show in a report. The parser error stays in the server log and on `data.detail`. Per-page summary failures use the same warning instead of writing the schema error into the page summary.
|
|
73
|
+
|
|
43
74
|
## [0.5.0] — 2026-10
|
|
44
75
|
|
|
45
76
|
### Changed
|
|
@@ -165,6 +196,8 @@ First public npm release.
|
|
|
165
196
|
- `EventBus` for live activity streams
|
|
166
197
|
- OpenAI and Gemini LLM backends
|
|
167
198
|
|
|
199
|
+
[0.6.0]: https://github.com/monkeytestai/monkeytester/releases/tag/v0.6.0
|
|
200
|
+
[0.5.1]: https://github.com/monkeytestai/monkeytester/releases/tag/v0.5.1
|
|
168
201
|
[0.5.0]: https://github.com/monkeytestai/monkeytester/releases/tag/v0.5.0
|
|
169
202
|
[0.4.1]: https://github.com/monkeytestai/monkeytester/releases/tag/v0.4.1
|
|
170
203
|
[0.4.0]: https://github.com/monkeytestai/monkeytester/releases/tag/v0.4.0
|
package/README.md
CHANGED
|
@@ -79,13 +79,25 @@ npm install @monkeytestai/monkeytester
|
|
|
79
79
|
npx playwright install chromium
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
[@monkeytestai/monkeytester](https://www.npmjs.com/package/@monkeytestai/monkeytester) **0.
|
|
82
|
+
[@monkeytestai/monkeytester](https://www.npmjs.com/package/@monkeytestai/monkeytester) **0.6.0** is the published package. The CLI is `npx monkeytest`.
|
|
83
83
|
|
|
84
84
|
```bash
|
|
85
85
|
export GEMINI_API_KEY="paste-your-key"
|
|
86
|
-
npx monkeytest run https://example.com --
|
|
86
|
+
npx monkeytest run https://example.com --depth basic
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
+
`--depth basic` is the free **Quick pass**: at most 6 pages and 4 flows, biased toward forms, search, and primary buttons. `standard` and `deep` are the broader presets. `--max` and `--flows` still override the preset.
|
|
90
|
+
|
|
91
|
+
A finished run includes:
|
|
92
|
+
|
|
93
|
+
| Field | Values |
|
|
94
|
+
| ----- | ------ |
|
|
95
|
+
| `outcome` | `bugs_found`, `clean`, `inconclusive`, `could_not_test` |
|
|
96
|
+
| `outcome_reason` | Short code such as `automation_error`, `all_flows_skipped`, `site_unreachable`, `login_required` (only when a login wall was seen) |
|
|
97
|
+
| `outcome_detail` | A sentence that matches the confirmed bug count, plus a next step |
|
|
98
|
+
|
|
99
|
+
`could_not_test` means nothing was tested. Playwright errors from the runner are `inconclusive`, not bugs. Map these three fields straight onto `audit_run`.
|
|
100
|
+
|
|
89
101
|
Screenshots are written to `.monkeytest/shots/`. A free Gemini key, or Ollama on localhost, is in the [quick start](https://docs.monkeytest.ai/guide/quick-start), including where `plan.json`, `runs/`, and `shots/` show up, and how `rerun` / `diff` work.
|
|
90
102
|
|
|
91
103
|
### From a clone (contributors)
|
|
@@ -144,7 +156,7 @@ const { siteMap, plan, run } = await monkey.executeAndTriage('https://app.exampl
|
|
|
144
156
|
});
|
|
145
157
|
|
|
146
158
|
console.log(`Visited ${siteMap.pages.length} pages, planned ${plan.flows.length} flows.`);
|
|
147
|
-
console.log(
|
|
159
|
+
console.log(`${run.outcome}: ${run.outcome_detail}`);
|
|
148
160
|
|
|
149
161
|
for (const bug of run.bugs.filter(b => b.severity !== 'minor')){
|
|
150
162
|
console.error(`- [${bug.severity}] ${bug.title}\n ${bug.observed}`);
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Signatures for failures that are ours, not the site's.
|
|
3
|
+
*
|
|
4
|
+
* mtaiclient `confirmedBugs.js` (`isSoftExploratoryBug`) and mtaiserver use
|
|
5
|
+
* the same idea to drop our Playwright mistakes from confirmed bugs. This
|
|
6
|
+
* module is the superset: every bug that file would drop is dropped here,
|
|
7
|
+
* and so are the runner errors that file does not name (Cannot type text
|
|
8
|
+
* into `input[type=number]`, InvalidSelector, strict mode, detached nodes,
|
|
9
|
+
* and selector timeouts) even when a host stored them as critical.
|
|
10
|
+
*
|
|
11
|
+
* A real site failure is never dropped: HTTP 5xx, an uncaught page error,
|
|
12
|
+
* a disabled control the step tried to use, or a document HTTP 404.
|
|
13
|
+
*/
|
|
14
|
+
export interface AutomationFaultSignature {
|
|
15
|
+
/** Stable id. Safe to store and to show in a report. */
|
|
16
|
+
id: string;
|
|
17
|
+
/**
|
|
18
|
+
* JavaScript regular expression source, matched case-insensitively against
|
|
19
|
+
* the bug or step text (title, observed, expected, triage notes, error).
|
|
20
|
+
*/
|
|
21
|
+
pattern: string;
|
|
22
|
+
/** What the signature catches, for hosts reimplementing the check. */
|
|
23
|
+
description: string;
|
|
24
|
+
/**
|
|
25
|
+
* `text` (default) — `isAutomationFault` tests the pattern against the
|
|
26
|
+
* whole bug or step text.
|
|
27
|
+
* `client` — documented for parity, but the match is the two-part title
|
|
28
|
+
* and body rule in `matchesClientSoftExploratory`. A bare `timeout` must
|
|
29
|
+
* not drop every slow page.
|
|
30
|
+
*/
|
|
31
|
+
match?: 'text' | 'client';
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Patterns that mean the runner failed, not the site. `client-page-title`
|
|
35
|
+
* and `client-soft-timeout` are the two rules in mtaiclient
|
|
36
|
+
* `isSoftExploratoryBug`, expressed as the same checks `matchesClientSoftExploratory`
|
|
37
|
+
* runs (the timeout rule also looks at the title, which a single body regex
|
|
38
|
+
* cannot). The rest are the core superset.
|
|
39
|
+
*/
|
|
40
|
+
export declare const AUTOMATION_FAULT_SIGNATURES: readonly AutomationFaultSignature[];
|
|
41
|
+
export interface BugText {
|
|
42
|
+
severity?: string;
|
|
43
|
+
title?: string;
|
|
44
|
+
observed?: string;
|
|
45
|
+
expected?: string;
|
|
46
|
+
triageNotes?: string;
|
|
47
|
+
/** Wire name used by mtaiclient / mtaiserver. */
|
|
48
|
+
triage_notes?: string;
|
|
49
|
+
error?: string;
|
|
50
|
+
}
|
|
51
|
+
/** First core signature id that matches, if any. */
|
|
52
|
+
export declare function automationFaultId(text: string | undefined): string | undefined;
|
|
53
|
+
/** True when the text is one of our Playwright / exploratory misses. */
|
|
54
|
+
export declare function isAutomationFault(text: string | undefined): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Exact mtaiclient `isSoftExploratoryBug` rule, including its critical
|
|
57
|
+
* exemption. Hosts that only want parity with the current client can call
|
|
58
|
+
* this. `isOwnAutomationBug` is the superset the engine uses.
|
|
59
|
+
*/
|
|
60
|
+
export declare function matchesClientSoftExploratory(bug: BugText): boolean;
|
|
61
|
+
/** HTTP 5xx, uncaught page error, disabled control, or document HTTP 404. */
|
|
62
|
+
export declare function isRealSiteFailureText(text: string | undefined): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* True when this bug must not be confirmed. Real site failures return false
|
|
65
|
+
* even if the wording also mentions a timeout. Critical severity does not
|
|
66
|
+
* protect a pure Playwright error (superset of the client, which keeps every
|
|
67
|
+
* critical row).
|
|
68
|
+
*/
|
|
69
|
+
export declare function isOwnAutomationBug(bug: BugText): boolean;
|
|
70
|
+
//# sourceMappingURL=signatures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signatures.d.ts","sourceRoot":"","sources":["../../src/automation/signatures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,wBAAwB;IACvC,wDAAwD;IACxD,EAAE,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,EAAE,SAAS,wBAAwB,EA+CjE,CAAC;AASX,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAaD,oDAAoD;AACpD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAI9E;AAED,wEAAwE;AACxE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEnE;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAYlE;AAED,6EAA6E;AAC7E,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAUvE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAMxD"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Signatures for failures that are ours, not the site's.
|
|
3
|
+
*
|
|
4
|
+
* mtaiclient `confirmedBugs.js` (`isSoftExploratoryBug`) and mtaiserver use
|
|
5
|
+
* the same idea to drop our Playwright mistakes from confirmed bugs. This
|
|
6
|
+
* module is the superset: every bug that file would drop is dropped here,
|
|
7
|
+
* and so are the runner errors that file does not name (Cannot type text
|
|
8
|
+
* into `input[type=number]`, InvalidSelector, strict mode, detached nodes,
|
|
9
|
+
* and selector timeouts) even when a host stored them as critical.
|
|
10
|
+
*
|
|
11
|
+
* A real site failure is never dropped: HTTP 5xx, an uncaught page error,
|
|
12
|
+
* a disabled control the step tried to use, or a document HTTP 404.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Patterns that mean the runner failed, not the site. `client-page-title`
|
|
16
|
+
* and `client-soft-timeout` are the two rules in mtaiclient
|
|
17
|
+
* `isSoftExploratoryBug`, expressed as the same checks `matchesClientSoftExploratory`
|
|
18
|
+
* runs (the timeout rule also looks at the title, which a single body regex
|
|
19
|
+
* cannot). The rest are the core superset.
|
|
20
|
+
*/
|
|
21
|
+
export const AUTOMATION_FAULT_SIGNATURES = [
|
|
22
|
+
{
|
|
23
|
+
id: 'cannot-type-text',
|
|
24
|
+
pattern: 'cannot type text into input',
|
|
25
|
+
description: 'Playwright refused fill() because the value is not valid for input[type=number] (for example "555-0100").',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: 'not-an-input',
|
|
29
|
+
pattern: 'not an <input|<textarea>|<select>|\\[contenteditable\\]|not editable|cannot be filled',
|
|
30
|
+
description: 'The locator resolved to an element Playwright cannot type into.',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: 'invalid-selector',
|
|
34
|
+
pattern: 'invalid selector|invalidselector|unexpected token .+ while parsing css selector',
|
|
35
|
+
description: 'The selector was invalid. That is the runner\'s locator, not a broken page.',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: 'strict-mode',
|
|
39
|
+
pattern: 'strict mode violation',
|
|
40
|
+
description: 'The selector matched more than one element.',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: 'detached',
|
|
44
|
+
pattern: 'not attached to the dom|element is detached|detached from (the )?document',
|
|
45
|
+
description: 'The element went away before the action ran.',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 'target-not-found',
|
|
49
|
+
pattern: 'waiting for locator|resolved to \\d+ elements|no element|no node',
|
|
50
|
+
description: 'A selector the runner built matched nothing, or the wait was for that selector.',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: 'selector-timeout',
|
|
54
|
+
pattern: 'locator\\.(fill|click|press|waitfor)|timeout \\d+ms exceeded[\\s\\S]{0,160}locator|waiting for (getby|locator)',
|
|
55
|
+
description: 'A timeout caused by our selector (locator.fill / locator.click / getBy*), not a server timeout.',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 'client-page-title',
|
|
59
|
+
pattern: '(page title|document title).{0,80}(assert|expected to see|check if)|check if the page title',
|
|
60
|
+
description: 'Same page-title observation mtaiclient drops. Exploratory, not a product bug.',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: 'client-soft-timeout',
|
|
64
|
+
pattern: '(waiting for locator|locator\\.fill|timeout)',
|
|
65
|
+
description: 'Body half of the mtaiclient rule. Not applied as a bare text search. matchesClientSoftExploratory also requires the title to match /could not|not found|timeout|locator/ and the severity to be anything but critical.',
|
|
66
|
+
match: 'client',
|
|
67
|
+
},
|
|
68
|
+
];
|
|
69
|
+
const COMPILED = AUTOMATION_FAULT_SIGNATURES
|
|
70
|
+
.filter(signature => signature.match !== 'client')
|
|
71
|
+
.map(signature => ({
|
|
72
|
+
...signature,
|
|
73
|
+
regex: new RegExp(signature.pattern, 'i'),
|
|
74
|
+
}));
|
|
75
|
+
function combined(bug) {
|
|
76
|
+
return [
|
|
77
|
+
bug.title,
|
|
78
|
+
bug.observed,
|
|
79
|
+
bug.expected,
|
|
80
|
+
bug.triageNotes,
|
|
81
|
+
bug.triage_notes,
|
|
82
|
+
bug.error,
|
|
83
|
+
].filter(Boolean).join('\n');
|
|
84
|
+
}
|
|
85
|
+
/** First core signature id that matches, if any. */
|
|
86
|
+
export function automationFaultId(text) {
|
|
87
|
+
if (!text)
|
|
88
|
+
return undefined;
|
|
89
|
+
const hit = COMPILED.find(signature => signature.regex.test(text));
|
|
90
|
+
return hit?.id;
|
|
91
|
+
}
|
|
92
|
+
/** True when the text is one of our Playwright / exploratory misses. */
|
|
93
|
+
export function isAutomationFault(text) {
|
|
94
|
+
return automationFaultId(text) !== undefined;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Exact mtaiclient `isSoftExploratoryBug` rule, including its critical
|
|
98
|
+
* exemption. Hosts that only want parity with the current client can call
|
|
99
|
+
* this. `isOwnAutomationBug` is the superset the engine uses.
|
|
100
|
+
*/
|
|
101
|
+
export function matchesClientSoftExploratory(bug) {
|
|
102
|
+
if (bug.severity === 'critical')
|
|
103
|
+
return false;
|
|
104
|
+
const title = String(bug.title || '').toLowerCase();
|
|
105
|
+
const text = [bug.title, bug.observed, bug.expected, bug.triageNotes, bug.triage_notes]
|
|
106
|
+
.filter(Boolean)
|
|
107
|
+
.join(' ')
|
|
108
|
+
.toLowerCase();
|
|
109
|
+
if (/page title|document title/.test(text) && /assert|expected to see|check if/.test(text))
|
|
110
|
+
return true;
|
|
111
|
+
if (text.includes('check if the page title'))
|
|
112
|
+
return true;
|
|
113
|
+
const automationMiss = (text.includes('waiting for locator') || text.includes('locator.fill') || text.includes('timeout'))
|
|
114
|
+
&& /could not|not found|timeout|locator/.test(title);
|
|
115
|
+
return automationMiss;
|
|
116
|
+
}
|
|
117
|
+
/** HTTP 5xx, uncaught page error, disabled control, or document HTTP 404. */
|
|
118
|
+
export function isRealSiteFailureText(text) {
|
|
119
|
+
const raw = (text || '').toLowerCase();
|
|
120
|
+
if (!raw.trim())
|
|
121
|
+
return false;
|
|
122
|
+
if (/\bhttp-5\d\d\b/.test(raw))
|
|
123
|
+
return true;
|
|
124
|
+
if (/returned http 5\d\d/.test(raw) || /\bhttp 5\d\d\b/.test(raw))
|
|
125
|
+
return true;
|
|
126
|
+
if (raw.includes('internal server error'))
|
|
127
|
+
return true;
|
|
128
|
+
if (raw.includes('pageerror') || raw.includes('uncaught page error'))
|
|
129
|
+
return true;
|
|
130
|
+
if (raw.includes('element-disabled') || raw.includes('control is disabled'))
|
|
131
|
+
return true;
|
|
132
|
+
if (raw.includes('http-404') || /returned http 404/.test(raw) || /document .{0,80}http 404/.test(raw))
|
|
133
|
+
return true;
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* True when this bug must not be confirmed. Real site failures return false
|
|
138
|
+
* even if the wording also mentions a timeout. Critical severity does not
|
|
139
|
+
* protect a pure Playwright error (superset of the client, which keeps every
|
|
140
|
+
* critical row).
|
|
141
|
+
*/
|
|
142
|
+
export function isOwnAutomationBug(bug) {
|
|
143
|
+
const text = combined(bug);
|
|
144
|
+
if (isRealSiteFailureText(text))
|
|
145
|
+
return false;
|
|
146
|
+
if (matchesClientSoftExploratory(bug))
|
|
147
|
+
return true;
|
|
148
|
+
if (isAutomationFault(text))
|
|
149
|
+
return true;
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=signatures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signatures.js","sourceRoot":"","sources":["../../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AK,CAAC;AACf,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAY;IAC7C,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC3B,IAAI,qBAAqB,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9C,IAAI,4BAA4B,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACnD,IAAI,iBAAiB,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACzC,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/cli.d.ts
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* --provider <id> openai | gemini | anthropic | mistral | groq | openai_compatible
|
|
22
22
|
* --model <id> Override model id (provider-specific)
|
|
23
23
|
* --quality <preset> cheap | balanced | smart (used by autoLLMConfig)
|
|
24
|
+
* --depth <preset> basic (Quick pass) | standard | deep | shallow
|
|
24
25
|
* --max <n> Max pages to crawl (explore/run only, default 8)
|
|
25
26
|
* --flows <n> Max flows to plan (explore/run only, default 6)
|
|
26
27
|
* --no-headless Show the browser window
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG"}
|
package/dist/cli.js
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* --provider <id> openai | gemini | anthropic | mistral | groq | openai_compatible
|
|
22
22
|
* --model <id> Override model id (provider-specific)
|
|
23
23
|
* --quality <preset> cheap | balanced | smart (used by autoLLMConfig)
|
|
24
|
+
* --depth <preset> basic (Quick pass) | standard | deep | shallow
|
|
24
25
|
* --max <n> Max pages to crawl (explore/run only, default 8)
|
|
25
26
|
* --flows <n> Max flows to plan (explore/run only, default 6)
|
|
26
27
|
* --no-headless Show the browser window
|
|
@@ -44,6 +45,7 @@ import { resolve, relative } from 'node:path';
|
|
|
44
45
|
import { Monkey } from './monkey.js';
|
|
45
46
|
import { createLLM } from './llm/index.js';
|
|
46
47
|
import { autoLLMConfig, detectProviderFromEnv, CHEAP_FAST_MODEL } from './llm/presets.js';
|
|
48
|
+
import { applyDepthPreset } from './depth.js';
|
|
47
49
|
import { savePlan, loadPlan, saveRun, loadRun, listRuns, } from './persistence/index.js';
|
|
48
50
|
import { bugMatchesFingerprint, diffRuns, summariseDiff } from './diff/index.js';
|
|
49
51
|
import { replayTraces } from './runner/replay.js';
|
|
@@ -64,13 +66,15 @@ const c = {
|
|
|
64
66
|
function tty(s, code) {
|
|
65
67
|
return process.stdout.isTTY ? `${c[code]}${s}${c.reset}` : s;
|
|
66
68
|
}
|
|
67
|
-
const ENGINE_VERSION = 'monkeytester@0.
|
|
69
|
+
const ENGINE_VERSION = 'monkeytester@0.6.0';
|
|
68
70
|
function defaultCommonOpts() {
|
|
69
71
|
return {
|
|
70
72
|
dir: '.monkeytest',
|
|
71
73
|
quality: 'balanced',
|
|
72
74
|
maxPages: 8,
|
|
73
75
|
maxFlows: 6,
|
|
76
|
+
maxPagesSet: false,
|
|
77
|
+
maxFlowsSet: false,
|
|
74
78
|
headless: true,
|
|
75
79
|
json: false,
|
|
76
80
|
heal: false,
|
|
@@ -124,12 +128,22 @@ function parseArgs(argv) {
|
|
|
124
128
|
case '--quality':
|
|
125
129
|
out.opts.quality = next();
|
|
126
130
|
break;
|
|
131
|
+
case '--depth':
|
|
132
|
+
case '--preset': {
|
|
133
|
+
const name = next();
|
|
134
|
+
if (!name)
|
|
135
|
+
die(2, '--depth requires a preset: basic (Quick pass), standard, deep, or shallow');
|
|
136
|
+
out.opts.depth = name;
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
127
139
|
case '-m':
|
|
128
140
|
case '--max':
|
|
129
141
|
out.opts.maxPages = parseInt(next(), 10);
|
|
142
|
+
out.opts.maxPagesSet = true;
|
|
130
143
|
break;
|
|
131
144
|
case '--flows':
|
|
132
145
|
out.opts.maxFlows = parseInt(next(), 10);
|
|
146
|
+
out.opts.maxFlowsSet = true;
|
|
133
147
|
break;
|
|
134
148
|
case '--no-headless':
|
|
135
149
|
out.opts.headless = false;
|
|
@@ -170,6 +184,18 @@ function parseArgs(argv) {
|
|
|
170
184
|
out.positional.push(a);
|
|
171
185
|
}
|
|
172
186
|
}
|
|
187
|
+
if (out.opts.depth) {
|
|
188
|
+
try {
|
|
189
|
+
const applied = applyDepthPreset(out.opts.depth, out.opts);
|
|
190
|
+
out.opts.maxPages = applied.maxPages;
|
|
191
|
+
out.opts.maxFlows = applied.maxFlows;
|
|
192
|
+
out.opts.focus = applied.focus;
|
|
193
|
+
out.opts.depth = applied.preset.id;
|
|
194
|
+
}
|
|
195
|
+
catch (err) {
|
|
196
|
+
die(2, err instanceof Error ? err.message : String(err));
|
|
197
|
+
}
|
|
198
|
+
}
|
|
173
199
|
return out;
|
|
174
200
|
}
|
|
175
201
|
/* ── LLM config resolution ────────────────────────────────────────────── */
|
|
@@ -227,8 +253,10 @@ Common flags (apply to most commands):
|
|
|
227
253
|
--api-key <key> Override env API key
|
|
228
254
|
--base-url <url> Required for openai_compatible (Ollama, vLLM, …)
|
|
229
255
|
--quality <preset> cheap | balanced | smart (default balanced)
|
|
230
|
-
|
|
231
|
-
|
|
256
|
+
--depth <preset> basic (Quick pass) | standard | deep | shallow
|
|
257
|
+
basic: 6 pages, 4 flows, biased to forms, search, and primary CTAs
|
|
258
|
+
-m, --max <n> Max pages to crawl (default 8, or the depth preset)
|
|
259
|
+
--flows <n> Max flows to plan (default 6, or the depth preset)
|
|
232
260
|
--no-headless Show the browser window
|
|
233
261
|
--label <text> Free-form label saved on the plan/run
|
|
234
262
|
--heal If a recorded locator misses, ask the LLM (rerun/verify)
|
|
@@ -258,11 +286,13 @@ Docs: https://docs.monkeytest.ai
|
|
|
258
286
|
const text = {
|
|
259
287
|
init: `monkeytest init [--dir .monkeytest]
|
|
260
288
|
Scaffold a working directory with config defaults. Idempotent.`,
|
|
261
|
-
explore: `monkeytest explore <url> [--max 8] [--flows 6] [--no-headless]
|
|
262
|
-
Crawl <url>, summarise pages, generate a TestPlan. Writes plan.json + shots
|
|
263
|
-
|
|
289
|
+
explore: `monkeytest explore <url> [--max 8] [--flows 6] [--depth basic] [--no-headless]
|
|
290
|
+
Crawl <url>, summarise pages, generate a TestPlan. Writes plan.json + shots/.
|
|
291
|
+
--depth basic is Quick pass: at most 6 pages and 4 flows, biased to forms, search, and primary CTAs.`,
|
|
292
|
+
run: `monkeytest run <url> [--max 8] [--flows 6] [--depth basic] [--quality balanced]
|
|
264
293
|
Run the full pipeline (explore + plan + run + triage). Writes plan.json,
|
|
265
294
|
runs/<id>.json, and screenshots. Exits with code 1 if blocking bugs found.
|
|
295
|
+
--depth basic is Quick pass (6 pages, 4 flows, forms, search, and primary CTAs).
|
|
266
296
|
Same-origin HTTP ≥500 responses fail the step (--no-fail-on-5xx opts out).
|
|
267
297
|
The crawl reserves room for help/contact/about pages under a small --max.
|
|
268
298
|
A crawled form, an enabled button, a link to a page the crawl did not open,
|
|
@@ -302,6 +332,7 @@ async function cmdInit(opts) {
|
|
|
302
332
|
$schema: 'https://docs.monkeytest.ai/config-schema-v1.json',
|
|
303
333
|
provider: opts.provider || 'auto',
|
|
304
334
|
quality: opts.quality,
|
|
335
|
+
depth: opts.depth,
|
|
305
336
|
maxPages: opts.maxPages,
|
|
306
337
|
maxFlows: opts.maxFlows,
|
|
307
338
|
}, null, 2));
|
|
@@ -341,7 +372,7 @@ async function cmdExplore(url, opts) {
|
|
|
341
372
|
screenshotsDir,
|
|
342
373
|
onPage: (p) => console.log(` · visited [${p.authGated ? 'auth' : 'open'}] ${p.url} — ${truncate(p.summary, 80)}`),
|
|
343
374
|
},
|
|
344
|
-
plan: { maxFlows: opts.maxFlows },
|
|
375
|
+
plan: { maxFlows: opts.maxFlows, focus: opts.focus },
|
|
345
376
|
});
|
|
346
377
|
const dt = ((Date.now() - t0) / 1000).toFixed(1);
|
|
347
378
|
const sitemapFile = resolve(opts.dir, 'sitemap.json');
|
|
@@ -370,7 +401,7 @@ async function cmdRun(url, opts) {
|
|
|
370
401
|
screenshotsDir,
|
|
371
402
|
onPage: (p) => console.log(` · visited ${p.url}`),
|
|
372
403
|
},
|
|
373
|
-
plan: { maxFlows: opts.maxFlows },
|
|
404
|
+
plan: { maxFlows: opts.maxFlows, focus: opts.focus },
|
|
374
405
|
run: {
|
|
375
406
|
screenshotsDir,
|
|
376
407
|
headless: opts.headless,
|
|
@@ -622,11 +653,14 @@ function cmdReport(runId, opts) {
|
|
|
622
653
|
}
|
|
623
654
|
/* ── Pretty-print helpers ─────────────────────────────────────────────── */
|
|
624
655
|
function summariseSiteMap(siteMap) {
|
|
656
|
+
const warnings = siteMap.warnings?.length
|
|
657
|
+
? `\n${siteMap.warnings.map(warning => ` ${tty('warning:', 'yellow')} ${warning}`).join('\n')}`
|
|
658
|
+
: '';
|
|
625
659
|
return `\n${tty('SiteMap', 'bold')}
|
|
626
660
|
start: ${siteMap.startUrl}
|
|
627
661
|
type: ${siteMap.siteType}
|
|
628
662
|
summary: ${truncate(siteMap.summary, 200)}
|
|
629
|
-
pages: ${siteMap.pages.length} visited, ${siteMap.pendingUrls.length} pending, ${siteMap.failedUrls.length} failed`;
|
|
663
|
+
pages: ${siteMap.pages.length} visited, ${siteMap.pendingUrls.length} pending, ${siteMap.failedUrls.length} failed${warnings}`;
|
|
630
664
|
}
|
|
631
665
|
function summarisePlan(plan) {
|
|
632
666
|
if (plan.flows.length === 0)
|
|
@@ -636,9 +670,13 @@ function summarisePlan(plan) {
|
|
|
636
670
|
}
|
|
637
671
|
function summariseRun(run) {
|
|
638
672
|
const { flowsTotal, flowsPassed, flowsFailed, bugsCritical, bugsMajor, bugsMinor } = run.stats;
|
|
673
|
+
const outcome = run.outcome
|
|
674
|
+
? `\n outcome: ${tty(run.outcome, run.outcome === 'bugs_found' ? 'red' : run.outcome === 'clean' ? 'green' : 'yellow')}${run.outcome_reason ? ` (${run.outcome_reason})` : ''}`
|
|
675
|
+
: '';
|
|
676
|
+
const detail = run.outcome_detail ? `\n ${truncate(run.outcome_detail, 220)}` : '';
|
|
639
677
|
return `\n${tty('Run', 'bold')}
|
|
640
678
|
flows: ${tty(`${flowsPassed}/${flowsTotal}`, flowsFailed === 0 ? 'green' : 'yellow')} passed, ${flowsFailed} failed
|
|
641
|
-
bugs: ${tty(String(bugsCritical), bugsCritical ? 'red' : 'dim')} critical, ${tty(String(bugsMajor), bugsMajor ? 'yellow' : 'dim')} major, ${tty(String(bugsMinor), 'dim')} minor`;
|
|
679
|
+
bugs: ${tty(String(bugsCritical), bugsCritical ? 'red' : 'dim')} critical, ${tty(String(bugsMajor), bugsMajor ? 'yellow' : 'dim')} major, ${tty(String(bugsMinor), 'dim')} minor${outcome}${detail}`;
|
|
642
680
|
}
|
|
643
681
|
function printDiffSection(title, entries, colour) {
|
|
644
682
|
if (entries.length === 0)
|