@monkeytestai/monkeytester 0.7.0-beta.1 → 0.7.0-beta.3
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 +27 -0
- package/README.md +4 -3
- package/dist/audit/cases.d.ts +9 -0
- package/dist/audit/cases.d.ts.map +1 -0
- package/dist/audit/cases.js +164 -0
- package/dist/audit/cases.js.map +1 -0
- package/dist/audit/falsePass.d.ts +41 -0
- package/dist/audit/falsePass.d.ts.map +1 -0
- package/dist/audit/falsePass.js +51 -0
- package/dist/audit/falsePass.js.map +1 -0
- package/dist/checks/axe.d.ts +24 -0
- package/dist/checks/axe.d.ts.map +1 -0
- package/dist/checks/axe.js +57 -0
- package/dist/checks/axe.js.map +1 -0
- package/dist/checks/console.d.ts +17 -0
- package/dist/checks/console.d.ts.map +1 -0
- package/dist/checks/console.js +32 -0
- package/dist/checks/console.js.map +1 -0
- package/dist/checks/execute.d.ts +34 -0
- package/dist/checks/execute.d.ts.map +1 -0
- package/dist/checks/execute.js +427 -0
- package/dist/checks/execute.js.map +1 -0
- package/dist/checks/http.d.ts +27 -0
- package/dist/checks/http.d.ts.map +1 -0
- package/dist/checks/http.js +90 -0
- package/dist/checks/http.js.map +1 -0
- package/dist/checks/meta.d.ts +23 -0
- package/dist/checks/meta.d.ts.map +1 -0
- package/dist/checks/meta.js +39 -0
- package/dist/checks/meta.js.map +1 -0
- package/dist/checks/mobile.d.ts +30 -0
- package/dist/checks/mobile.d.ts.map +1 -0
- package/dist/checks/mobile.js +61 -0
- package/dist/checks/mobile.js.map +1 -0
- package/dist/checks/noise.d.ts +10 -0
- package/dist/checks/noise.d.ts.map +1 -0
- package/dist/checks/noise.js +53 -0
- package/dist/checks/noise.js.map +1 -0
- package/dist/checks/plan.d.ts +35 -0
- package/dist/checks/plan.d.ts.map +1 -0
- package/dist/checks/plan.js +108 -0
- package/dist/checks/plan.js.map +1 -0
- package/dist/cli.js +85 -19
- package/dist/cli.js.map +1 -1
- package/dist/depth.d.ts +44 -1
- package/dist/depth.d.ts.map +1 -1
- package/dist/depth.js +38 -3
- package/dist/depth.js.map +1 -1
- package/dist/inbox/http.d.ts +20 -0
- package/dist/inbox/http.d.ts.map +1 -0
- package/dist/inbox/http.js +119 -0
- package/dist/inbox/http.js.map +1 -0
- package/dist/inbox/load.d.ts +10 -0
- package/dist/inbox/load.d.ts.map +1 -0
- package/dist/inbox/load.js +33 -0
- package/dist/inbox/load.js.map +1 -0
- package/dist/index.d.ts +10 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/llm/prices.d.ts +17 -0
- package/dist/llm/prices.d.ts.map +1 -0
- package/dist/llm/prices.js +41 -0
- package/dist/llm/prices.js.map +1 -0
- package/dist/monkey.d.ts +13 -1
- package/dist/monkey.d.ts.map +1 -1
- package/dist/monkey.js +28 -4
- package/dist/monkey.js.map +1 -1
- package/dist/outcome/check.d.ts +49 -0
- package/dist/outcome/check.d.ts.map +1 -0
- package/dist/outcome/check.js +275 -0
- package/dist/outcome/check.js.map +1 -0
- package/dist/outcome.d.ts.map +1 -1
- package/dist/outcome.js +45 -1
- package/dist/outcome.js.map +1 -1
- package/dist/planner/authNegative.d.ts.map +1 -1
- package/dist/planner/authNegative.js +12 -0
- package/dist/planner/authNegative.js.map +1 -1
- package/dist/planner/dedupe.d.ts.map +1 -1
- package/dist/planner/dedupe.js +22 -2
- package/dist/planner/dedupe.js.map +1 -1
- package/dist/planner/faults.js +1 -0
- package/dist/planner/faults.js.map +1 -1
- package/dist/planner/focus.d.ts.map +1 -1
- package/dist/planner/focus.js +18 -5
- package/dist/planner/focus.js.map +1 -1
- package/dist/planner/forms.d.ts.map +1 -1
- package/dist/planner/forms.js +4 -1
- package/dist/planner/forms.js.map +1 -1
- package/dist/planner/index.d.ts +18 -2
- package/dist/planner/index.d.ts.map +1 -1
- package/dist/planner/index.js +84 -8
- package/dist/planner/index.js.map +1 -1
- package/dist/planner/inventory.d.ts +6 -0
- package/dist/planner/inventory.d.ts.map +1 -1
- package/dist/planner/inventory.js +13 -0
- package/dist/planner/inventory.js.map +1 -1
- package/dist/planner/salvage.d.ts.map +1 -1
- package/dist/planner/salvage.js +9 -4
- package/dist/planner/salvage.js.map +1 -1
- package/dist/runner/flowStatus.d.ts +7 -2
- package/dist/runner/flowStatus.d.ts.map +1 -1
- package/dist/runner/flowStatus.js +12 -3
- package/dist/runner/flowStatus.js.map +1 -1
- package/dist/runner/index.d.ts +19 -1
- package/dist/runner/index.d.ts.map +1 -1
- package/dist/runner/index.js +238 -7
- package/dist/runner/index.js.map +1 -1
- package/dist/runner/replay.d.ts +3 -1
- package/dist/runner/replay.d.ts.map +1 -1
- package/dist/runner/replay.js +125 -16
- package/dist/runner/replay.js.map +1 -1
- package/dist/signup/detect.d.ts +60 -0
- package/dist/signup/detect.d.ts.map +1 -0
- package/dist/signup/detect.js +125 -0
- package/dist/signup/detect.js.map +1 -0
- package/dist/signup/guard.d.ts +21 -0
- package/dist/signup/guard.d.ts.map +1 -0
- package/dist/signup/guard.js +102 -0
- package/dist/signup/guard.js.map +1 -0
- package/dist/signup/ledger.d.ts +31 -0
- package/dist/signup/ledger.d.ts.map +1 -0
- package/dist/signup/ledger.js +60 -0
- package/dist/signup/ledger.js.map +1 -0
- package/dist/signup/plan.d.ts +21 -0
- package/dist/signup/plan.d.ts.map +1 -0
- package/dist/signup/plan.js +120 -0
- package/dist/signup/plan.js.map +1 -0
- package/dist/signup/run.d.ts +28 -0
- package/dist/signup/run.d.ts.map +1 -0
- package/dist/signup/run.js +241 -0
- package/dist/signup/run.js.map +1 -0
- package/dist/trace/serialize.d.ts.map +1 -1
- package/dist/trace/serialize.js +2 -0
- package/dist/trace/serialize.js.map +1 -1
- package/dist/triager/index.d.ts.map +1 -1
- package/dist/triager/index.js +8 -3
- package/dist/triager/index.js.map +1 -1
- package/dist/types.d.ts +124 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.7.0-beta.3] — 2026-11-01
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- A flow is no longer `passed` because its steps executed. Every kept flow has an `outcomeCheck`. The runner evaluates it after the last step. A missing check is `inconclusive` with `outcome_reason` `no_assertion`. A check that cannot be decided is `assertion_unverifiable`. Page checks, auth-negative checks, and sign-up validation already assert an observation; replay does the same, and a trace with no check is not a pass.
|
|
15
|
+
- The runner refuses to submit a completed sign-up or account-creation form (password plus confirm, create-account / sign-up / register, or a signup URL) unless the caller passed an `InboxProvider`. Without one, the engine runs validation only (empty, invalid email, password mismatch) and sets `signup_status` `not_tested` with `signup_reason` `no_inbox`. That refusal is a hard guard, not a prompt.
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- `TestFlow.outcomeCheck` and `FlowResult.assertion`. `OutcomeReason` gains `no_assertion` and `assertion_unverifiable`.
|
|
20
|
+
- `InboxProvider` (`allocate` returns `{ address, expiresAt? }`, `waitFor` accepts `signal` and may return `text` / `html`, optional `release`). One sign-up per run, name "MonkeyTest QA", password only in memory, never phone or payment. `signup_attempted`, `signup_verified`, `signup_status`, and `signup_reason` are set from that attempt. Captcha, phone, payment, timeout, and `cap_reached` are not bugs.
|
|
21
|
+
- CLI `--inbox <module>` and `--inbox-http <url>` (`MONKEYTEST_INBOX_TOKEN`). `createHttpInbox` and `loadInboxProvider` are exported. There is no default host.
|
|
22
|
+
|
|
23
|
+
## [0.7.0-beta.2] — 2026-11-01
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- Deterministic page checks in `src/checks/`, with no model call. One engine flow per check, reserved id `check-*`, kind `accessibility` or `visual`, and one step per crawled page. The five checks are console errors, same-site failed requests and broken links (about 20 link probes), axe-core WCAG A/AA, mobile overflow and tap targets at 375px, and title / description / lang / viewport / h1. They sit outside the LLM flow budget and are not dropped as phantom flows. Serious or critical axe violations are bugs. Missing `autocomplete` on a login field is minor. Title and viewport gaps are minor. Description, lang, and h1 count are info. Console noise from extensions, third parties, and `isOwnAutomationBug` is ignored. Steps record `tool: 'check'`. Replay re-runs a `check` step, or skips it when the check id is missing.
|
|
28
|
+
- `BASIC_PRESET` from `depth.ts`: 6 pages, 5 LLM flows, engine caps of 5 checks and 6 auth-negative flows, 10s step timeout, 25s flow timeout, 12s page timeout, and a 120s total budget. Past that budget, remaining page checks are skipped instead of failing the run as a timeout. `--depth basic` uses these numbers.
|
|
29
|
+
- The planner asks for a success check and an error or edge check on each form journey. When the plan is thinner than 5 flows and the cap allows it, it asks once more, still only against crawled pages and controls. Quick pass may use a non-submit auth control such as Sign up or Forgot password. Engine flows win when an LLM flow repeats them.
|
|
30
|
+
- `--planner-model <id>` and `MonkeyConfig.plannerModel`. Per-page summaries stay on the cheap model (`gpt-4o-mini` for OpenAI). The runner model is unchanged.
|
|
31
|
+
- `scripts/bakeoff.ts` compares planner models. Each run writes JSON (case count, real bugs, invented flows, false-positive candidates, planner latency, wall time, tokens, and USD) and the process prints a table. Prices live in `MODEL_PRICES`.
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
|
|
35
|
+
- Quick pass plans 5 LLM flows instead of 4. `severityIfFails` is copied onto the flow result so triage uses it. A step may set `severity` when a check finding is minor.
|
|
36
|
+
|
|
10
37
|
## [0.7.0-beta.1] — 2026-10-31
|
|
11
38
|
|
|
12
39
|
### Added
|
package/README.md
CHANGED
|
@@ -86,17 +86,18 @@ export GEMINI_API_KEY="paste-your-key"
|
|
|
86
86
|
npx monkeytest run https://example.com --depth basic
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
`--depth basic` is the free **Quick pass**:
|
|
89
|
+
`--depth basic` is the free **Quick pass**: 6 pages, 5 LLM flows, and deterministic page checks outside that budget, with a 120 second cap. `standard` and `deep` are the broader presets. `--max` and `--flows` still override the page and flow caps. Import `BASIC_PRESET` from the package for the same numbers.
|
|
90
90
|
|
|
91
91
|
A finished run includes:
|
|
92
92
|
|
|
93
93
|
| Field | Values |
|
|
94
94
|
| ----- | ------ |
|
|
95
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`. `login_required` is also set on `clean` and `bugs_found` when `public_screens` is `0` |
|
|
96
|
+
| `outcome_reason` | Short code such as `automation_error`, `all_flows_skipped`, `site_unreachable`, `login_required`, `no_assertion`, `assertion_unverifiable`. `login_required` is also set on `clean` and `bugs_found` when `public_screens` is `0`. `no_assertion` means the journey had no outcome to verify |
|
|
97
97
|
| `outcome_detail` | A sentence that matches the confirmed bug count, plus a next step. On a login-only site it says deeper journeys need an account |
|
|
98
98
|
| `public_screens` | Number of crawled pages that are not auth-gated. `0` is a login-only site |
|
|
99
|
-
| `engine_version` | Engine that produced the run, for example `0.7.0-beta.
|
|
99
|
+
| `engine_version` | Engine that produced the run, for example `0.7.0-beta.3` (`ENGINE_VERSION`) |
|
|
100
|
+
| `signup_attempted`, `signup_verified`, `signup_status`, `signup_reason` | Set when a sign-up form was seen. Without your inbox, status is `not_tested` and reason is `no_inbox`. The package does not include an inbox |
|
|
100
101
|
|
|
101
102
|
`could_not_test` means nothing was tested. Playwright errors from the runner are `inconclusive`, not bugs. Map these three fields straight onto `audit_run`.
|
|
102
103
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recorded plans used to measure the beta.2 false-pass rate.
|
|
3
|
+
* The jewellery case is the one that filed a pass after typing an invented
|
|
4
|
+
* address into Create account. The other rows are the same shape for
|
|
5
|
+
* crawl, smoke, and the-internet-style forms. None of these are live calls.
|
|
6
|
+
*/
|
|
7
|
+
import type { FalsePassCase } from './falsePass.js';
|
|
8
|
+
export declare const FALSE_PASS_CASES: FalsePassCase[];
|
|
9
|
+
//# sourceMappingURL=cases.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cases.d.ts","sourceRoot":"","sources":["../../src/audit/cases.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAYpD,eAAO,MAAM,gBAAgB,EAAE,aAAa,EAmJ3C,CAAC"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recorded plans used to measure the beta.2 false-pass rate.
|
|
3
|
+
* The jewellery case is the one that filed a pass after typing an invented
|
|
4
|
+
* address into Create account. The other rows are the same shape for
|
|
5
|
+
* crawl, smoke, and the-internet-style forms. None of these are live calls.
|
|
6
|
+
*/
|
|
7
|
+
function flow(partial) {
|
|
8
|
+
return {
|
|
9
|
+
description: partial.name,
|
|
10
|
+
kind: 'happy_path',
|
|
11
|
+
startUrl: 'https://shop.example/',
|
|
12
|
+
severityIfFails: 'major',
|
|
13
|
+
...partial,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export const FALSE_PASS_CASES = [
|
|
17
|
+
{
|
|
18
|
+
id: 'jewellery-create-account',
|
|
19
|
+
flowType: 'llm',
|
|
20
|
+
flow: flow({
|
|
21
|
+
id: 'create-a-new-account',
|
|
22
|
+
name: 'Create a New Account',
|
|
23
|
+
startUrl: 'https://jeweller.example/account/register',
|
|
24
|
+
steps: [
|
|
25
|
+
{ action: 'Fill the "Email" field with "qa@example.com"' },
|
|
26
|
+
{ action: 'Fill the "Password" field with "Test-password-1"' },
|
|
27
|
+
{ action: 'Fill the "Confirm password" field with "Test-password-1"' },
|
|
28
|
+
{ action: 'Click "Create account"' },
|
|
29
|
+
],
|
|
30
|
+
expectation: 'The account is created.',
|
|
31
|
+
}),
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 'llm-contact-no-check',
|
|
35
|
+
flowType: 'llm',
|
|
36
|
+
flow: flow({
|
|
37
|
+
id: 'contact-us',
|
|
38
|
+
name: 'Contact us',
|
|
39
|
+
steps: [
|
|
40
|
+
{ action: 'Fill the "Email" field' },
|
|
41
|
+
{ action: 'Click "Send message"' },
|
|
42
|
+
],
|
|
43
|
+
expectation: 'The journey completes.',
|
|
44
|
+
}),
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: 'crawl-public-form',
|
|
48
|
+
flowType: 'crawl',
|
|
49
|
+
flow: flow({
|
|
50
|
+
id: 'public-form-submit',
|
|
51
|
+
name: 'Submit the form on Contact',
|
|
52
|
+
startUrl: 'https://shop.example/contact',
|
|
53
|
+
steps: [
|
|
54
|
+
{ action: 'Fill the "Email" field', expectation: 'The Email field accepts a value.' },
|
|
55
|
+
{ action: 'Click "Send message"', expectation: 'The form submits and the site does not return a server error.' },
|
|
56
|
+
],
|
|
57
|
+
expectation: 'The public form submits without a server error.',
|
|
58
|
+
}),
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: 'crawl-fault-click',
|
|
62
|
+
flowType: 'crawl',
|
|
63
|
+
flow: flow({
|
|
64
|
+
id: 'fault-button-save-order',
|
|
65
|
+
name: 'Use Save order',
|
|
66
|
+
steps: [{ action: 'Click "Save order"', expectation: 'The "Save order" control runs without a page error.' }],
|
|
67
|
+
expectation: 'The "Save order" control runs without a page error.',
|
|
68
|
+
}),
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: 'smoke-read-home',
|
|
72
|
+
flowType: 'smoke',
|
|
73
|
+
flow: flow({
|
|
74
|
+
id: 'read-home',
|
|
75
|
+
name: 'Read the homepage',
|
|
76
|
+
steps: [{ action: 'Read the introductory paragraph', expectation: 'The page loads.' }],
|
|
77
|
+
expectation: 'The homepage loads.',
|
|
78
|
+
}),
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: 'the-internet-login',
|
|
82
|
+
flowType: 'llm',
|
|
83
|
+
flow: flow({
|
|
84
|
+
id: 'the-internet-login',
|
|
85
|
+
name: 'Log in',
|
|
86
|
+
startUrl: 'https://the-internet.herokuapp.com/login',
|
|
87
|
+
steps: [
|
|
88
|
+
{ action: 'Fill the "Username" field with "tomsmith"' },
|
|
89
|
+
{ action: 'Fill the "Password" field' },
|
|
90
|
+
{ action: 'Click "Login"' },
|
|
91
|
+
],
|
|
92
|
+
expectation: 'The user is logged in.',
|
|
93
|
+
}),
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
id: 'the-internet-forgot-password',
|
|
97
|
+
flowType: 'llm',
|
|
98
|
+
flow: flow({
|
|
99
|
+
id: 'the-internet-forgot',
|
|
100
|
+
name: 'Retrieve password',
|
|
101
|
+
startUrl: 'https://the-internet.herokuapp.com/forgot_password',
|
|
102
|
+
steps: [
|
|
103
|
+
{ action: 'Fill the "E-mail" field with "qa@example.com"' },
|
|
104
|
+
{ action: 'Click "Retrieve password"' },
|
|
105
|
+
],
|
|
106
|
+
expectation: 'The form submits.',
|
|
107
|
+
}),
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: 'auth-neg-empty',
|
|
111
|
+
flowType: 'auth-neg',
|
|
112
|
+
flow: flow({
|
|
113
|
+
id: 'auth-neg-empty-submit',
|
|
114
|
+
name: 'Submit the sign-in form empty',
|
|
115
|
+
kind: 'edge_case',
|
|
116
|
+
steps: [{
|
|
117
|
+
action: 'Click "Sign in" without filling the form',
|
|
118
|
+
expectation: 'The page shows a validation message.',
|
|
119
|
+
check: 'empty_submit',
|
|
120
|
+
}],
|
|
121
|
+
expectation: 'Empty submit shows validation.',
|
|
122
|
+
}),
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: 'check-console',
|
|
126
|
+
flowType: 'page-check',
|
|
127
|
+
flow: flow({
|
|
128
|
+
id: 'check-console',
|
|
129
|
+
name: 'Console errors on load',
|
|
130
|
+
kind: 'visual',
|
|
131
|
+
steps: [{ action: 'Check console errors on https://shop.example/', pageCheck: 'console', url: 'https://shop.example/' }],
|
|
132
|
+
expectation: 'The page loads without a first-party console error.',
|
|
133
|
+
}),
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
id: 'signup-val-empty',
|
|
137
|
+
flowType: 'signup',
|
|
138
|
+
flow: flow({
|
|
139
|
+
id: 'signup-val-empty',
|
|
140
|
+
name: 'Submit the sign-up form empty',
|
|
141
|
+
kind: 'edge_case',
|
|
142
|
+
startUrl: 'https://jeweller.example/account/register',
|
|
143
|
+
steps: [{
|
|
144
|
+
action: 'Click "Create account" without filling the sign-up form',
|
|
145
|
+
signupCheck: 'empty_submit',
|
|
146
|
+
}],
|
|
147
|
+
expectation: 'Empty submit shows validation and does not create an account.',
|
|
148
|
+
}),
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
id: 'rerun-no-check',
|
|
152
|
+
flowType: 'replay',
|
|
153
|
+
flow: flow({
|
|
154
|
+
id: 'replay-create-account',
|
|
155
|
+
name: 'Replay create account',
|
|
156
|
+
steps: [
|
|
157
|
+
{ action: 'Fill the "Email" field with "qa@example.com"' },
|
|
158
|
+
{ action: 'Click "Create account"' },
|
|
159
|
+
],
|
|
160
|
+
expectation: 'The account is created.',
|
|
161
|
+
}),
|
|
162
|
+
},
|
|
163
|
+
];
|
|
164
|
+
//# sourceMappingURL=cases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cases.js","sourceRoot":"","sources":["../../src/audit/cases.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,SAAS,IAAI,CAAC,OAAoF;IAChG,OAAO;QACL,WAAW,EAAE,OAAO,CAAC,IAAI;QACzB,IAAI,EAAE,YAAY;QAClB,QAAQ,EAAE,uBAAuB;QACjC,eAAe,EAAE,OAAO;QACxB,GAAG,OAAO;KACX,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAoB;IAC/C;QACE,EAAE,EAAE,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cAAc;iBACtB,CAAC;YACF,WAAW,EAAE,gCAAgC;SAC9C,CAAC;KACH;IACD;QACE,EAAE,EAAE,eAAe;QACnB,QAAQ,EAAE,YAAY;QACtB,IAAI,EAAE,IAAI,CAAC;YACT,EAAE,EAAE,eAAe;YACnB,IAAI,EAAE,wBAAwB;YAC9B,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,+CAA+C,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,uBAAuB,EAAE,CAAC;YACxH,WAAW,EAAE,qDAAqD;SACnE,CAAC;KACH;IACD;QACE,EAAE,EAAE,kBAAkB;QACtB,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,IAAI,CAAC;YACT,EAAE,EAAE,kBAAkB;YACtB,IAAI,EAAE,+BAA+B;YACrC,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE,2CAA2C;YACrD,KAAK,EAAE,CAAC;oBACN,MAAM,EAAE,yDAAyD;oBACjE,WAAW,EAAE,cAAc;iBAC5B,CAAC;YACF,WAAW,EAAE,+DAA+D;SAC7E,CAAC;KACH;IACD;QACE,EAAE,EAAE,gBAAgB;QACpB,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,IAAI,CAAC;YACT,EAAE,EAAE,uBAAuB;YAC3B,IAAI,EAAE,uBAAuB;YAC7B,KAAK,EAAE;gBACL,EAAE,MAAM,EAAE,8CAA8C,EAAE;gBAC1D,EAAE,MAAM,EAAE,wBAAwB,EAAE;aACrC;YACD,WAAW,EAAE,yBAAyB;SACvC,CAAC;KACH;CACF,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* False-pass measurement.
|
|
3
|
+
*
|
|
4
|
+
* Beta.2 marked a flow passed when its steps executed and nothing threw.
|
|
5
|
+
* Beta.3 does not. Embedded oracles (page checks, auth-negative, sign-up
|
|
6
|
+
* validation) already decide from a real observation; they are not false passes.
|
|
7
|
+
*/
|
|
8
|
+
import type { TestFlow, TestStep } from '../types.js';
|
|
9
|
+
export interface FalsePassCase {
|
|
10
|
+
id: string;
|
|
11
|
+
flowType: string;
|
|
12
|
+
flow: TestFlow;
|
|
13
|
+
}
|
|
14
|
+
export interface FalsePassRow {
|
|
15
|
+
id: string;
|
|
16
|
+
flowType: string;
|
|
17
|
+
/** Beta.2 would report passed after the steps executed. */
|
|
18
|
+
before: boolean;
|
|
19
|
+
/** Beta.3 would still report passed without a verified outcome. */
|
|
20
|
+
after: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface FalsePassReport {
|
|
23
|
+
before: number;
|
|
24
|
+
after: number;
|
|
25
|
+
rows: FalsePassRow[];
|
|
26
|
+
}
|
|
27
|
+
export declare function isEmbeddedOracleFlow(flow: Pick<TestFlow, 'id' | 'steps'>): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Beta.2 `resolveFlowStatus`: failed steps fail the flow, every step skipped
|
|
30
|
+
* is inconclusive, and everything else — including "we clicked and typed" —
|
|
31
|
+
* is passed.
|
|
32
|
+
*/
|
|
33
|
+
export declare function beta2WouldPass(steps: Array<Pick<TestStep, 'action'>>): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Beta.3: an embedded oracle is a real check. Anything else passes only
|
|
36
|
+
* when a concrete outcome check exists for the runner to evaluate. A flow
|
|
37
|
+
* that still has no check is inconclusive, which is not a false pass.
|
|
38
|
+
*/
|
|
39
|
+
export declare function beta3FalsePass(flow: TestFlow): boolean;
|
|
40
|
+
export declare function measureFalsePasses(cases: FalsePassCase[]): FalsePassReport;
|
|
41
|
+
//# sourceMappingURL=falsePass.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"falsePass.d.ts","sourceRoot":"","sources":["../../src/audit/falsePass.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,MAAM,EAAE,OAAO,CAAC;IAChB,mEAAmE;IACnE,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,YAAY,EAAE,CAAC;CACtB;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,OAAO,CAAC,GAAG,OAAO,CAGlF;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,GAAG,OAAO,CAE9E;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAKtD;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,eAAe,CAY1E"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* False-pass measurement.
|
|
3
|
+
*
|
|
4
|
+
* Beta.2 marked a flow passed when its steps executed and nothing threw.
|
|
5
|
+
* Beta.3 does not. Embedded oracles (page checks, auth-negative, sign-up
|
|
6
|
+
* validation) already decide from a real observation; they are not false passes.
|
|
7
|
+
*/
|
|
8
|
+
import { isPageCheckFlowId } from '../checks/plan.js';
|
|
9
|
+
import { isConcreteOutcomeCheck, repairOutcomeCheck } from '../outcome/check.js';
|
|
10
|
+
import { isAuthNegativeFlowId } from '../planner/authNegative.js';
|
|
11
|
+
import { isSignupFlowId } from '../signup/plan.js';
|
|
12
|
+
export function isEmbeddedOracleFlow(flow) {
|
|
13
|
+
if (isAuthNegativeFlowId(flow.id) || isPageCheckFlowId(flow.id) || isSignupFlowId(flow.id))
|
|
14
|
+
return true;
|
|
15
|
+
return flow.steps.some(step => Boolean(step.check || step.pageCheck || step.signupCheck));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Beta.2 `resolveFlowStatus`: failed steps fail the flow, every step skipped
|
|
19
|
+
* is inconclusive, and everything else — including "we clicked and typed" —
|
|
20
|
+
* is passed.
|
|
21
|
+
*/
|
|
22
|
+
export function beta2WouldPass(steps) {
|
|
23
|
+
return steps.length > 0;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Beta.3: an embedded oracle is a real check. Anything else passes only
|
|
27
|
+
* when a concrete outcome check exists for the runner to evaluate. A flow
|
|
28
|
+
* that still has no check is inconclusive, which is not a false pass.
|
|
29
|
+
*/
|
|
30
|
+
export function beta3FalsePass(flow) {
|
|
31
|
+
if (isEmbeddedOracleFlow(flow))
|
|
32
|
+
return false;
|
|
33
|
+
const check = isConcreteOutcomeCheck(flow.outcomeCheck) ? flow.outcomeCheck : repairOutcomeCheck(flow);
|
|
34
|
+
if (!check)
|
|
35
|
+
return false;
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
export function measureFalsePasses(cases) {
|
|
39
|
+
const rows = cases.map(item => {
|
|
40
|
+
const embedded = isEmbeddedOracleFlow(item.flow);
|
|
41
|
+
const before = !embedded && beta2WouldPass(item.flow.steps);
|
|
42
|
+
const after = beta3FalsePass(item.flow);
|
|
43
|
+
return { id: item.id, flowType: item.flowType, before, after };
|
|
44
|
+
});
|
|
45
|
+
return {
|
|
46
|
+
before: rows.filter(row => row.before).length,
|
|
47
|
+
after: rows.filter(row => row.after).length,
|
|
48
|
+
rows,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=falsePass.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fals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CAAC,EAAE;QAC5B,MAAM,QAAQ,GAAG,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjD,MAAM,MAAM,GAAG,CAAC,QAAQ,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5D,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxC,OAAO,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IACjE,CAAC,CAAC,CAAC;IACH,OAAO;QACL,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM;QAC7C,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,MAAM;QAC3C,IAAI;KACL,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* axe-core WCAG A/AA.
|
|
3
|
+
*
|
|
4
|
+
* Serious and critical violations fail the step. Moderate and minor hits
|
|
5
|
+
* are info. Missing `autocomplete` on a login field is minor even when axe
|
|
6
|
+
* ranks that rule as serious.
|
|
7
|
+
*/
|
|
8
|
+
import type { Page } from 'playwright';
|
|
9
|
+
import type { Result } from 'axe-core';
|
|
10
|
+
export interface AxeJudgement {
|
|
11
|
+
serious: {
|
|
12
|
+
id: string;
|
|
13
|
+
impact: string;
|
|
14
|
+
help: string;
|
|
15
|
+
}[];
|
|
16
|
+
/** Missing autocomplete on login fields. Minor, not serious. */
|
|
17
|
+
autocomplete: string[];
|
|
18
|
+
info: string[];
|
|
19
|
+
}
|
|
20
|
+
export declare function splitAxeViolations(violations: Result[]): AxeJudgement;
|
|
21
|
+
export declare function runAxe(page: Page): Promise<AxeJudgement>;
|
|
22
|
+
/** Login fields with no autocomplete attribute. Axe does not always flag the absence. */
|
|
23
|
+
export declare function readMissingLoginAutocomplete(): string[];
|
|
24
|
+
//# sourceMappingURL=axe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"axe.d.ts","sourceRoot":"","sources":["../../src/checks/axe.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAIvC,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACxD,gEAAgE;IAChE,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAID,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,YAAY,CAyBrE;AAED,wBAAsB,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,CAG9D;AAED,yFAAyF;AACzF,wBAAgB,4BAA4B,IAAI,MAAM,EAAE,CAavD"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* axe-core WCAG A/AA.
|
|
3
|
+
*
|
|
4
|
+
* Serious and critical violations fail the step. Moderate and minor hits
|
|
5
|
+
* are info. Missing `autocomplete` on a login field is minor even when axe
|
|
6
|
+
* ranks that rule as serious.
|
|
7
|
+
*/
|
|
8
|
+
import AxeBuilder from '@axe-core/playwright';
|
|
9
|
+
const TAGS = ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa'];
|
|
10
|
+
const LOGIN_FIELD = /type=["']?(?:password|email)|name=["']?(?:email|user|login|password)|autocomplete=["']?(?:username|email|current-password|new-password)/i;
|
|
11
|
+
export function splitAxeViolations(violations) {
|
|
12
|
+
const serious = [];
|
|
13
|
+
const autocomplete = [];
|
|
14
|
+
const info = [];
|
|
15
|
+
for (const violation of violations) {
|
|
16
|
+
const impact = violation.impact || 'minor';
|
|
17
|
+
const loginAutocomplete = violation.id === 'autocomplete-valid' && violation.nodes.some(node => LOGIN_FIELD.test(`${node.html} ${(node.target || []).join(' ')}`));
|
|
18
|
+
if (loginAutocomplete) {
|
|
19
|
+
autocomplete.push(violation.help || 'Login fields are missing autocomplete.');
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
if (impact === 'serious' || impact === 'critical') {
|
|
23
|
+
serious.push({
|
|
24
|
+
id: violation.id,
|
|
25
|
+
impact,
|
|
26
|
+
help: violation.help || violation.description || violation.id,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
info.push(`${violation.id}: ${violation.help || violation.description || impact}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return { serious, autocomplete, info };
|
|
34
|
+
}
|
|
35
|
+
export async function runAxe(page) {
|
|
36
|
+
const results = await new AxeBuilder({ page }).withTags(TAGS).analyze();
|
|
37
|
+
return splitAxeViolations(results.violations);
|
|
38
|
+
}
|
|
39
|
+
/** Login fields with no autocomplete attribute. Axe does not always flag the absence. */
|
|
40
|
+
export function readMissingLoginAutocomplete() {
|
|
41
|
+
const fields = [];
|
|
42
|
+
for (const node of Array.from(document.querySelectorAll('input'))) {
|
|
43
|
+
const el = node;
|
|
44
|
+
if (el.disabled || el.type === 'hidden' || el.type === 'submit' || el.type === 'button')
|
|
45
|
+
continue;
|
|
46
|
+
const type = (el.type || '').toLowerCase();
|
|
47
|
+
const name = `${el.getAttribute('name') || ''} ${el.id || ''}`.toLowerCase();
|
|
48
|
+
const login = type === 'password' || type === 'email' || /user|login|email|password/.test(name);
|
|
49
|
+
if (!login)
|
|
50
|
+
continue;
|
|
51
|
+
if ((el.getAttribute('autocomplete') || '').trim())
|
|
52
|
+
continue;
|
|
53
|
+
fields.push(el.getAttribute('name') || el.id || type);
|
|
54
|
+
}
|
|
55
|
+
return fields;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=axe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"axe.js","sourceRoot":"","sources":["../../src/checks/axe.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAI9C,MAAM,IAAI,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAS1D,MAAM,WAAW,GAAG,0IAA0I,CAAC;AAE/J,MAAM,UAAU,kBAAkB,CAAC,UAAoB;IACrD,MAAM,OAAO,GAA4B,EAAE,CAAC;IAC5C,MAAM,YAAY,GAAa,EAAE,CAAC;IAClC,MAAM,IAAI,GAAa,EAAE,CAAC;IAE1B,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,IAAI,OAAO,CAAC;QAC3C,MAAM,iBAAiB,GAAG,SAAS,CAAC,EAAE,KAAK,oBAAoB,IAAI,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC7F,WAAW,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAClE,CAAC;QACF,IAAI,iBAAiB,EAAE,CAAC;YACtB,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI,wCAAwC,CAAC,CAAC;YAC9E,SAAS;QACX,CAAC;QACD,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,UAAU,EAAE,CAAC;YAClD,OAAO,CAAC,IAAI,CAAC;gBACX,EAAE,EAAE,SAAS,CAAC,EAAE;gBAChB,MAAM;g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AAG,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,OAAO,IAAI,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChG,IAAI,CAAC,KAAK;YAAE,SAAS;QACrB,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE;YAAE,SAAS;QAC7D,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,IAAI,CAAC,CAAC;IACxD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* First-party console errors and uncaught exceptions on load.
|
|
3
|
+
*/
|
|
4
|
+
import type { ConsoleErrorEvidence } from '../types.js';
|
|
5
|
+
export interface ConsoleHit {
|
|
6
|
+
message: string;
|
|
7
|
+
sourceUrl?: string;
|
|
8
|
+
/** `pageerror` is an uncaught exception. `console` is console.error. */
|
|
9
|
+
kind: 'pageerror' | 'console';
|
|
10
|
+
}
|
|
11
|
+
export interface ConsoleJudgement {
|
|
12
|
+
bugs: ConsoleHit[];
|
|
13
|
+
ignored: number;
|
|
14
|
+
}
|
|
15
|
+
export declare function judgeConsole(hits: ConsoleHit[], pageUrl: string): ConsoleJudgement;
|
|
16
|
+
export declare function consoleEvidence(bugs: ConsoleHit[]): ConsoleErrorEvidence[];
|
|
17
|
+
//# sourceMappingURL=console.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../src/checks/console.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGxD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wEAAwE;IACxE,IAAI,EAAE,WAAW,GAAG,SAAS,CAAC;CAC/B;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAiBlF;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,oBAAoB,EAAE,CAM1E"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* First-party console errors and uncaught exceptions on load.
|
|
3
|
+
*/
|
|
4
|
+
import { isIgnoredConsoleMessage } from './noise.js';
|
|
5
|
+
export function judgeConsole(hits, pageUrl) {
|
|
6
|
+
const bugs = [];
|
|
7
|
+
const seen = new Set();
|
|
8
|
+
let ignored = 0;
|
|
9
|
+
for (const hit of hits) {
|
|
10
|
+
const message = hit.message.replace(/\s+/g, ' ').trim();
|
|
11
|
+
if (!message)
|
|
12
|
+
continue;
|
|
13
|
+
if (isIgnoredConsoleMessage(message, hit.sourceUrl, pageUrl)) {
|
|
14
|
+
ignored += 1;
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
const key = message.slice(0, 180);
|
|
18
|
+
if (seen.has(key))
|
|
19
|
+
continue;
|
|
20
|
+
seen.add(key);
|
|
21
|
+
bugs.push({ ...hit, message });
|
|
22
|
+
}
|
|
23
|
+
return { bugs, ignored };
|
|
24
|
+
}
|
|
25
|
+
export function consoleEvidence(bugs) {
|
|
26
|
+
return bugs.slice(0, 8).map(hit => ({
|
|
27
|
+
message: hit.message.slice(0, 300),
|
|
28
|
+
level: 'error',
|
|
29
|
+
...(hit.sourceUrl ? { url: hit.sourceUrl } : {}),
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=console.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"console.js","sour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,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACjD,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run the reserved page checks in one browser pass.
|
|
3
|
+
*
|
|
4
|
+
* Each crawled URL is opened once. Every check type records its own step
|
|
5
|
+
* with `tool: 'check'`. A failure on one page does not skip the other pages.
|
|
6
|
+
* When `deadlineAt` has passed, the remaining pages are skipped. That is
|
|
7
|
+
* not a timeout error.
|
|
8
|
+
*/
|
|
9
|
+
import type { Browser, Page } from 'playwright';
|
|
10
|
+
import type { ConsoleErrorEvidence, FlowResult, NetworkFailureEvidence, PageCheck, StepResult, TestFlow } from '../types.js';
|
|
11
|
+
export interface CheckStepOutcome {
|
|
12
|
+
status: 'passed' | 'failed' | 'skipped';
|
|
13
|
+
observation: string;
|
|
14
|
+
error?: string;
|
|
15
|
+
severity?: 'critical' | 'major' | 'minor';
|
|
16
|
+
consoleErrors?: ConsoleErrorEvidence[];
|
|
17
|
+
networkFailures?: NetworkFailureEvidence[];
|
|
18
|
+
}
|
|
19
|
+
export interface LinkBudget {
|
|
20
|
+
remaining: number;
|
|
21
|
+
}
|
|
22
|
+
export interface ExecuteChecksOptions {
|
|
23
|
+
screenshotsDir: string;
|
|
24
|
+
stepTimeoutMs: number;
|
|
25
|
+
/** Epoch ms. Pages not started by then are skipped. */
|
|
26
|
+
deadlineAt?: number;
|
|
27
|
+
onFlowStart?: (flow: TestFlow) => void;
|
|
28
|
+
onStep?: (flow: TestFlow, result: StepResult) => void;
|
|
29
|
+
onFlowComplete?: (result: FlowResult) => void;
|
|
30
|
+
}
|
|
31
|
+
export declare function replayPageCheck(page: Page, kind: PageCheck, url: string, timeoutMs: number): Promise<CheckStepOutcome>;
|
|
32
|
+
export declare function executePageChecks(browser: Browser, flows: TestFlow[], opts: ExecuteChecksOptions): Promise<FlowResult[]>;
|
|
33
|
+
export declare function shotPath(dir: string, flowId: string, index: number, status: string): string;
|
|
34
|
+
//# sourceMappingURL=execute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../src/checks/execute.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAY,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EACV,oBAAoB,EACpB,UAAU,EACV,sBAAsB,EACtB,SAAS,EACT,UAAU,EACV,QAAQ,EAET,MAAM,aAAa,CAAC;AAkBrB,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,OAAO,CAAC;IAC1C,aAAa,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACvC,eAAe,CAAC,EAAE,sBAAsB,EAAE,CAAC;CAC5C;AAOD,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IACtD,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CAC/C;AAkFD,wBAAsB,eAAe,CACnC,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,SAAS,EACf,GAAG,EAAE,MAAM,EAC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