gz-laya-pilot 0.1.1 → 0.1.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/NOTICE.md +29 -15
- package/README.md +102 -76
- package/dist/agent/bridge.js +1 -1
- package/dist/agent/bridge.js.map +1 -1
- package/dist/agent/report.d.ts +3 -0
- package/dist/agent/report.js +11 -2
- package/dist/agent/report.js.map +1 -1
- package/dist/agent/schema.d.ts +10 -0
- package/dist/agent/schema.js.map +1 -1
- package/dist/assertions.d.ts +1 -1
- package/dist/assertions.js +4 -9
- package/dist/assertions.js.map +1 -1
- package/dist/replay.js +18 -2
- package/dist/replay.js.map +1 -1
- package/dist/request-assertions.d.ts +6 -0
- package/dist/request-assertions.js +86 -0
- package/dist/request-assertions.js.map +1 -0
- package/dist/schema.d.ts +6 -0
- package/dist/schema.js +42 -0
- package/dist/schema.js.map +1 -1
- package/package.json +57 -57
- package/src/agent/bridge.ts +180 -180
- package/src/agent/report.ts +139 -126
- package/src/agent/run.ts +136 -136
- package/src/agent/schema.ts +38 -33
- package/src/agent/worker.ts +114 -114
- package/src/assertions.ts +4 -10
- package/src/browser.ts +20 -20
- package/src/cli.ts +5 -5
- package/src/decision.ts +85 -85
- package/src/index.ts +10 -10
- package/src/planner.ts +28 -28
- package/src/readiness.ts +92 -92
- package/src/replay.ts +24 -7
- package/src/request-assertions.ts +83 -0
- package/src/schema.ts +46 -0
- package/src/targets.ts +61 -61
- package/vendor/.gitattributes +5 -4
- package/vendor/UPSTREAM.json +94 -5
- package/vendor/laya-pilot/lib/browser-provider.mjs +18 -6
- package/vendor/laya-pilot/lib/discovery.mjs +182 -31
- package/vendor/laya-pilot/lib/dom.mjs +65 -2
- package/vendor/laya-pilot/lib/form.mjs +3 -3
- package/vendor/laya-pilot/lib/page-capabilities.mjs +356 -0
- package/vendor/laya-pilot/lib/page-exploration.mjs +372 -0
- package/vendor/laya-pilot/lib/page-session.mjs +69 -0
- package/vendor/laya-pilot/lib/related-records.mjs +328 -0
- package/vendor/laya-pilot/lib/run-state.mjs +15 -1
- package/vendor/laya-pilot/lib/test-data.mjs +15 -2
- package/vendor/laya-pilot/lib/workflow-policy.mjs +8 -1
- package/vendor/laya-pilot/lib/workflow.mjs +536 -121
- package/vendor/laya-pilot/lib/workflow_excel.py +33 -2
- package/vendor/laya-pilot/tests/retries.test.mjs +14 -1
- package/vendor/laya-pilot/tests/selected-pr1.test.mjs +21 -3
- package/vendor/patches/0001-native-field-recipes.patch +2966 -14
package/NOTICE.md
CHANGED
|
@@ -1,15 +1,29 @@
|
|
|
1
|
-
# Source and changes
|
|
2
|
-
|
|
3
|
-
Derived from [anthonyli/laya-pilot](https://github.com/anthonyli/laya-pilot), MIT, copyright 2026 LayaPilot contributors. This is an independent package, not an official upstream release.
|
|
4
|
-
|
|
5
|
-
The repository already contains the complete adapted source snapshot under `tools/laya-pilot`. Its original archive SHA-256 is `88d4932109b64f40a8c13f82f43cfc6d33e371344f13b688bad4967705f14b30`. An upstream commit was not retained with that snapshot; no commit is claimed here.
|
|
6
|
-
|
|
7
|
-
Ported `lib/browser-provider.mjs`, the `waitForReady` function in `lib/readiness.mjs`, and decision validation / HTTP protocol from `lib/model.mjs` to strict TypeScript functions. Added schema validation, deterministic recording replay, declarative assertions and semantic target metadata. Removed application routes, demo credentials, workflow classes, implicit logs and unbounded caches from this package. LICENSE retains the upstream notice.
|
|
8
|
-
|
|
9
|
-
Version 0.1.1 additionally vendors the complete generation/replay engine from upstream commit `9f1bb801e0ca5eb4ded82413ab112ab0da0716d8` under `vendor/laya-pilot`. `vendor/UPSTREAM.json` records the commit and SHA-256 source hashes. Original MIT notices and upstream regression tests are retained. The earlier paragraph describes the 0.1.0 recording adapter, not the scope of this new integration.
|
|
10
|
-
|
|
11
|
-
The new TypeScript functions add npm exports, a child-process boundary, UTF-8 Windows IPC, local HTTP integration and UI report projection. `runWorkflow`, Laya decisions, discovery, assertions, state/auth handling and the original Python/openpyxl workbook contract remain upstream implementations. `vendor/patches/0001-native-field-recipes.patch` tracks three focused adaptations: constrain data recipes using native number/email types, accept text recipes that preserve the unique record variable, and mark absent optional detail views as not applicable only during automatic discovery. Explicit view requests and execution errors still fail. Model thresholds and refusal behavior are unchanged. Original and modified hashes are both retained.
|
|
12
|
-
|
|
13
|
-
The abandoned replacement planner and ExcelJS workbook grammar are not part of this package. Model weights and the Python environment are not distributed. The new APIs require 0.1.1 or later.
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
# Source and changes
|
|
2
|
+
|
|
3
|
+
Derived from [anthonyli/laya-pilot](https://github.com/anthonyli/laya-pilot), MIT, copyright 2026 LayaPilot contributors. This is an independent package, not an official upstream release.
|
|
4
|
+
|
|
5
|
+
The repository already contains the complete adapted source snapshot under `tools/laya-pilot`. Its original archive SHA-256 is `88d4932109b64f40a8c13f82f43cfc6d33e371344f13b688bad4967705f14b30`. An upstream commit was not retained with that snapshot; no commit is claimed here.
|
|
6
|
+
|
|
7
|
+
Ported `lib/browser-provider.mjs`, the `waitForReady` function in `lib/readiness.mjs`, and decision validation / HTTP protocol from `lib/model.mjs` to strict TypeScript functions. Added schema validation, deterministic recording replay, declarative assertions and semantic target metadata. Removed application routes, demo credentials, workflow classes, implicit logs and unbounded caches from this package. LICENSE retains the upstream notice.
|
|
8
|
+
|
|
9
|
+
Version 0.1.1 additionally vendors the complete generation/replay engine from upstream commit `9f1bb801e0ca5eb4ded82413ab112ab0da0716d8` under `vendor/laya-pilot`. `vendor/UPSTREAM.json` records the commit and SHA-256 source hashes. Original MIT notices and upstream regression tests are retained. The earlier paragraph describes the 0.1.0 recording adapter, not the scope of this new integration.
|
|
10
|
+
|
|
11
|
+
The new TypeScript functions add npm exports, a child-process boundary, UTF-8 Windows IPC, local HTTP integration and UI report projection. `runWorkflow`, Laya decisions, discovery, assertions, state/auth handling and the original Python/openpyxl workbook contract remain upstream implementations. `vendor/patches/0001-native-field-recipes.patch` tracks three focused adaptations: constrain data recipes using native number/email types, accept text recipes that preserve the unique record variable, and mark absent optional detail views as not applicable only during automatic discovery. Explicit view requests and execution errors still fail. Model thresholds and refusal behavior are unchanged. Original and modified hashes are both retained.
|
|
12
|
+
|
|
13
|
+
The abandoned replacement planner and ExcelJS workbook grammar are not part of this package. Model weights and the Python environment are not distributed. The new APIs require 0.1.1 or later.
|
|
14
|
+
|
|
15
|
+
Version 0.1.2 extension (2026-10-07): the same cumulative patch now adds bounded semantic tree navigation, exact tree-record ownership, region-bound filters, standalone editor activation, Ant Design 6 selected-value observation, input replacement checks and additional trace-flush time. `lib/page-capabilities.mjs` contains functional helpers called by the existing workflow, not a separate planner. Two upstream test doubles are updated for the editor/record contract; their retry and write-safety assertions remain intact. `UPSTREAM.json` separately records original-file modifications and the added helper. Old upstream workbooks remain readable; workbooks containing the new `expand-tree` step require this extended engine.
|
|
16
|
+
|
|
17
|
+
Playwright and dom-accessibility-api retain their own licenses. Python libraries and Laya model weights retain their own licenses. This package is not an official npm release of upstream `laya-pilot`.
|
|
18
|
+
|
|
19
|
+
Version 0.1.2 also reuses upstream discovery for default read-only filter testing. Workflow and replay policy allow only validated filter recipes in that mode; form and CRUD restrictions remain. Startup phase messages are persisted to the existing checkpoint for UI polling. This is recorded in the same cumulative patch and modification hashes.
|
|
20
|
+
|
|
21
|
+
Visible-mode readiness is provided by the shared session helper after interactions and filter assertions, without slowing headless verification. Default generation combines required-field validation with creation in the same editor; explicit validation-only runs are retained. Unsupported interval checks do not reopen a known form.
|
|
22
|
+
|
|
23
|
+
The 0.1.2 cumulative patch also adds functional `page-exploration.mjs`: owned inline detail navigation, result-set query assertions, semantic tab/panel traversal, bounded disclosure checks, and observed coverage gaps. It reuses upstream `matchReplayTarget` for dynamic record labels and retains model confidence/refusal handling. `workflow_excel.py` preserves the new grammar and exports an additional coverage sheet; the main 17-column contract is unchanged. These are executor extensions, not capabilities claimed to be in the original upstream snapshot.
|
|
24
|
+
|
|
25
|
+
The 0.1.2 tree extension additionally persists semantic ownership for create actions, resolves nested hover triggers within the owning node, excludes global navigation trees, and rejects ambiguous collections, paths and regions. These are bounded structural capabilities, not application-name or route-based adapters. Reordered-tree replay and ambiguity regressions are retained with the package tests.
|
|
26
|
+
|
|
27
|
+
The same 0.1.2 patch replaces generated document reloads with immediate visible-page assertions and separate headless persistence checks. `page-session.mjs` adds functional session/identity helpers; the browser provider accepts an in-memory pre-write authentication snapshot. Discovery restores only observed form/filter controls and stops on uncertain restoration. New persistence assertions are preserved in Excel. Microfrontend hosts can expose active app/instance markers; legacy Excel reloads are rejected there before executing cases. This continuity guard is not complete application/frame/portal isolation.
|
|
28
|
+
|
|
29
|
+
`related-records.mjs` extends the existing workflow with bounded relation-picker transactions on run-owned parents, using observed semantic controls and the upstream model matcher. It independently verifies addition and removal, preserves data identity through Excel and refuses to retry a failed compound transaction. A shared headless browser creates fresh verification contexts; it is started before the visible window to avoid repeated Chrome process activation during the run. These 0.1.2 extensions contain no securities-specific labels or endpoints.
|
package/README.md
CHANGED
|
@@ -1,76 +1,102 @@
|
|
|
1
|
-
# gz-laya-pilot
|
|
2
|
-
|
|
3
|
-
Node 22+ package based on LayaPilot. Functional TypeScript host API, ESM and declarations; Playwright execution stays in Node.
|
|
4
|
-
|
|
5
|
-
## Autonomous exploration (0.1.
|
|
6
|
-
|
|
7
|
-
Version 0.1.1
|
|
8
|
-
|
|
9
|
-
```ts
|
|
10
|
-
import { runAgent } from 'gz-laya-pilot';
|
|
11
|
-
const options = {
|
|
12
|
-
url: 'http://localhost:3000/customers',
|
|
13
|
-
python: '/absolute/path/to/python',
|
|
14
|
-
model: '/absolute/path/to/laya-multilingual',
|
|
15
|
-
channel: 'chrome', allowWrite: true,
|
|
16
|
-
};
|
|
17
|
-
await runAgent({ ...options, outputDir: './results/explore', onProgress: console.log });
|
|
18
|
-
await runAgent({ ...options, workbook: './results/explore/cases.xlsx', outputDir: './results/replay' });
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
`runAgent` starts an isolated worker calling the vendored `runWorkflow`. Upstream owns DOM observation, field/option decisions, CRUD and supplemental discovery, assertions, retries, pending-write journal, screenshots, Trace and Excel. The original 17-column workbook and hidden `__laya_steps__` contract are preserved, including visible-column integrity checks. There is no second planner or custom workbook grammar. Both generation and replay use real Laya decisions; replay binds recorded targets to the new DOM and creates new test identifiers. A model refusal or assertion failure remains a failure.
|
|
22
|
-
|
|
23
|
-
`createAgentBridge({targets: [{url, authState?, authCheck?}], python, model, outputDir, channel?, headed?})` returns `{middleware, stop, isRunning}`. Mount at `<assistant bridgeUrl>/agent` in a same-origin local Node server. It validates target permissions, serializes runs and serves upstream reports. The default is installed Chrome in headless mode. This is local middleware, not a production multi-user service. Saved login state must use the upstream auth-state format and a login-success selector. Browser cookies are not implicitly copied from the host page.
|
|
24
|
-
|
|
25
|
-
The CLI delegates to upstream and preserves its flags. Generate: `gz-laya-pilot --mode generate --url <url> --case-file ./cases.xlsx --out ./results/generate --python <path> --model <path> --browser-channel chrome --headless --allow-write`. Replay uses `--mode execute` with the same URL/case file and a new output directory. `--help` lists all upstream modes, including existing natural-language Excel via `--excel`.
|
|
26
|
-
|
|
27
|
-
Install Python dependencies from the vendored `requirements-local.txt` (or the repository's tested Windows lock), then download the pinned model. Python runs Laya and openpyxl; this is **not** a pure TypeScript model/Excel rewrite. Python, model weights and browser binaries are not bundled into npm. Windows IPC explicitly uses UTF-8. No model/API fallback is silently substituted.
|
|
28
|
-
|
|
29
|
-
See the [integration and acceptance guide](https://github.com/chenhui996/gz-zd-web/blob/codex/research-assistant/docs/研发小蜜自主探索.md) for pinned setup, support boundaries and real-model verification. Browser consumers use `gz-laya-pilot/agent-schema` without importing Node/Excel/Playwright.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
1
|
+
# gz-laya-pilot
|
|
2
|
+
|
|
3
|
+
Node 22+ package based on LayaPilot. Functional TypeScript host API, ESM and declarations; Playwright execution stays in Node.
|
|
4
|
+
|
|
5
|
+
## Autonomous exploration (0.1.2)
|
|
6
|
+
|
|
7
|
+
Version 0.1.1 introduced the full upstream generation and replay workflow, pinned at `9f1bb801e0ca5eb4ded82413ab112ab0da0716d8`. Version 0.1.2 extends that workflow with semantic record trees, continuous microfrontend execution, query/detail assertions and related-record transactions. Version 0.1.0 only contains the recorded JSON adapter. Original and modified source hashes are in `vendor/UPSTREAM.json`; the complete diff is under `vendor/patches/`.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { runAgent } from 'gz-laya-pilot';
|
|
11
|
+
const options = {
|
|
12
|
+
url: 'http://localhost:3000/customers',
|
|
13
|
+
python: '/absolute/path/to/python',
|
|
14
|
+
model: '/absolute/path/to/laya-multilingual',
|
|
15
|
+
channel: 'chrome', allowWrite: true,
|
|
16
|
+
};
|
|
17
|
+
await runAgent({ ...options, outputDir: './results/explore', onProgress: console.log });
|
|
18
|
+
await runAgent({ ...options, workbook: './results/explore/cases.xlsx', outputDir: './results/replay' });
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
`runAgent` starts an isolated worker calling the vendored `runWorkflow`. Upstream owns DOM observation, field/option decisions, CRUD and supplemental discovery, assertions, retries, pending-write journal, screenshots, Trace and Excel. The original 17-column workbook and hidden `__laya_steps__` contract are preserved, including visible-column integrity checks. There is no second planner or custom workbook grammar. Both generation and replay use real Laya decisions; replay binds recorded targets to the new DOM and creates new test identifiers. A model refusal or assertion failure remains a failure.
|
|
22
|
+
|
|
23
|
+
`createAgentBridge({targets: [{url, authState?, authCheck?}], python, model, outputDir, channel?, headed?})` returns `{middleware, stop, isRunning}`. Mount at `<assistant bridgeUrl>/agent` in a same-origin local Node server. It validates target permissions, serializes runs and serves upstream reports. The default is installed Chrome in headless mode. This is local middleware, not a production multi-user service. Saved login state must use the upstream auth-state format and a login-success selector. Browser cookies are not implicitly copied from the host page.
|
|
24
|
+
|
|
25
|
+
The CLI delegates to upstream and preserves its flags. Generate: `gz-laya-pilot --mode generate --url <url> --case-file ./cases.xlsx --out ./results/generate --python <path> --model <path> --browser-channel chrome --headless --allow-write`. Replay uses `--mode execute` with the same URL/case file and a new output directory. `--help` lists all upstream modes, including existing natural-language Excel via `--excel`.
|
|
26
|
+
|
|
27
|
+
Install Python dependencies from the vendored `requirements-local.txt` (or the repository's tested Windows lock), then download the pinned model. Python runs Laya and openpyxl; this is **not** a pure TypeScript model/Excel rewrite. Python, model weights and browser binaries are not bundled into npm. Windows IPC explicitly uses UTF-8. No model/API fallback is silently substituted.
|
|
28
|
+
|
|
29
|
+
See the [integration and acceptance guide](https://github.com/chenhui996/gz-zd-web/blob/codex/research-assistant/docs/研发小蜜自主探索.md) for pinned setup, support boundaries and real-model verification. Browser consumers use `gz-laya-pilot/agent-schema` without importing Node/Excel/Playwright.
|
|
30
|
+
|
|
31
|
+
Version 0.1.2 describes observed numeric input constraints in the model's candidates, resolving the `Credit limit` refusal seen in the independent English fixture with 0.1.1. Model refusal and confidence thresholds remain enforced; these results do not guarantee support for arbitrary backends.
|
|
32
|
+
|
|
33
|
+
Real-model acceptance on 2026-10-07 generated and replayed 12 cases on the securities fixture and 11 on an independent English tree/relationship fixture in fresh sessions. These cover supported CRUD, search, detail and related-record flows, not every feature on either page. A backend that ignores edits fails persistence verification and blocks later deletion. Windows checkpoint replacement retries transient locks; replaced inputs/actions are re-observed; Ant Design 6 selected values are retained. Test data and these acceptance reports are not bundled in the npm package.
|
|
34
|
+
|
|
35
|
+
Tree support requires unambiguous named ARIA trees/items and expansion state (maximum 24 expansions, path depth 8); it is not a whole-site crawler or a business-rule planner. New `expand-tree` steps extend the existing workbook contract: old upstream workbooks still load, but the unmodified upstream engine cannot replay the new step. React and SDK both use this same Node engine.
|
|
36
|
+
|
|
37
|
+
## Recorded JSON replay
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
npm install gz-laya-pilot
|
|
41
|
+
npx playwright install chromium
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
import { runCase } from 'gz-laya-pilot';
|
|
46
|
+
const result = await runCase(
|
|
47
|
+
{
|
|
48
|
+
schema: 'zhidao-recorded-case',
|
|
49
|
+
version: 1,
|
|
50
|
+
name: 'Customer search',
|
|
51
|
+
path: '/customers',
|
|
52
|
+
steps: [
|
|
53
|
+
{
|
|
54
|
+
kind: 'assert',
|
|
55
|
+
assertion: {
|
|
56
|
+
name: 'Page ready',
|
|
57
|
+
source: 'element-state',
|
|
58
|
+
selector: '[data-testid="search"]',
|
|
59
|
+
operator: 'visible',
|
|
60
|
+
timeout: 5000,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
origin: 'http://127.0.0.1:3000',
|
|
67
|
+
launch: { headless: true },
|
|
68
|
+
onProgress: console.log,
|
|
69
|
+
signal: new AbortController().signal,
|
|
70
|
+
},
|
|
71
|
+
);
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Use `beforeRun(page, context)` for your host's authentication or test setup; use `context.storageState` for an existing test login. Credentials never belong in case JSON. `allowedOrigins` explicitly permits API/asset origins when the test app needs them. By default only the supplied origin is allowed. Abort closes the browser. A run with no assertions reports `completed`, not `passed`.
|
|
75
|
+
|
|
76
|
+
Browser consumers import `gz-laya-pilot/schema` or `gz-laya-pilot/browser`; neither entry imports Node or Playwright. `locate()` uses unique CSS plus W3C accessible name/role. Version 1 CSS/text targets still work. Automatic retry never substitutes another business control.
|
|
77
|
+
|
|
78
|
+
`createApiDecision({base, model, key})` returns a Laya-protocol decision function. `chooseStep(instruction, observedCandidates, decide)` selects a structured step or returns null for uncertainty. It does not execute the candidate or invent locators. The host must observe candidates and review the draft; `runCase` evaluates assertions against real DOM, not model opinions. Recorded JSON replay does not require Python; autonomous Excel generation/replay uses the vendored upstream engine described above. The older `tools/laya-pilot` snapshot is retained for compatibility, not used as the new agent engine.
|
|
79
|
+
|
|
80
|
+
See NOTICE.md and LICENSE for upstream provenance and the scope of the port.
|
|
81
|
+
|
|
82
|
+
## 0.1.2: continuous microfrontend exploration
|
|
83
|
+
|
|
84
|
+
Relation pickers support a `related-records` transaction: an empty collection on a newly created parent, an add/remove pair, and a dialog with selectable existing records and disabled confirmation until selection. The executor adds one uniquely identified sample, verifies the visible collection and fresh-session persistence, removes only that relation and independently verifies the empty collection again. HTML tables and ARIA grids (including split pinned rows) use the same observer; names and codes come from the page. Failed writes or persistence checks retain the test parent and stop later writes. This does not infer arbitrary nested business rules or grant access to existing parents.
|
|
85
|
+
|
|
86
|
+
Persistence checks reuse one headless Chrome process prepared before the visible test window. Each read still creates a new browser context using pre-write authentication only. This removes repeated background Chrome startup/shutdown during a visible run without weakening session isolation.
|
|
87
|
+
|
|
88
|
+
Visible execution waits for a non-loading, stable control layout for at least 650ms after key interactions. A fixed sleep alone did not prevent advancing during asynchronous panel replacement. Headless verification retains its normal speed. Default CRUD generation validates the empty form and creates the record in one editor visit; explicit validation-only runs still have their own case. Existing visible-page and persistence assertions remain required.
|
|
89
|
+
|
|
90
|
+
The same workflow now opens an owned tree record's inline detail, verifies identity outside the list, then explores its semantic tab group and re-observes after each transition. `aria-controls` must identify a visible panel; a selected tab label alone cannot pass. Bounded disclosure checks can inspect newly revealed controls and restore their state. Model refusals remain coverage gaps. Replay grounds dynamic record labels through the upstream `matchReplayTarget` helper without reducing confidence thresholds. Positive search must reduce the visible collection to the uniquely named test record; edit/delete do not redundantly re-filter it. The functional extension lives in `lib/page-exploration.mjs`, with no application routes or business labels.
|
|
91
|
+
|
|
92
|
+
The workbook's “探索范围” sheet and run-result metadata list observed but unverified entry states. Passing cases are not a whole-page coverage guarantee: file import/export, nested business transactions, permission scenarios and business-specific oracles still require supported recipes and test data. New detail/disclosure/query assertion steps require version 0.1.2 or later; earlier engines cannot replay these new workbooks.
|
|
93
|
+
|
|
94
|
+
The default `allowWrite: false` mode now also runs the existing model-selected filter discovery on semantic tables and record trees. It expands bounded tree paths, verifies an unmatched query and restores the list without refreshing. These recipes are saved under the existing `filters` operation; read-only validation permits only `filter-empty` / `filter-reset`, never form or CRUD actions. Startup checkpoints distinguish opening/authenticating the page from waiting for local model warmup. Run `npm test -w gz-laya-pilot` from the repository root for package and vendored-engine regression tests; real-model acceptance additionally requires the Python/model setup and a supported test target.
|
|
95
|
+
|
|
96
|
+
Generated workflows check the visible page after each CRUD write, then query the same module in a separate headless browser/context for persistence. They no longer reload the visible host to reset a child app. Discovery clears only its observed business filter and cancels its observed editor; failed restoration stops the workflow. Background checks use a pre-write authentication snapshot and produce their own screenshot/trace. New `assert-persisted-row` and `assert-persisted-absent` Excel steps require version 0.1.2 or later.
|
|
97
|
+
|
|
98
|
+
Hosts may expose `data-laya-host` on the viewport, and `data-laya-app`, `data-laya-instance`, and `data-laya-active="true"` on their application containers. Continuity checks bind the current app/instance and exact URL; fresh verification sessions bind the logical app and URL. An inactive child cache does not prevent testing the host view. Old workbooks containing `reload` must be regenerated for such hosts; they are rejected before any case runs. This is not yet a complete DOM/frame/portal access boundary. Persistence assertions retain their observed semantic query steps for replay. React and SDK bridges use the same workflow.
|
|
99
|
+
## 0.1.3 recorded-case assertions
|
|
100
|
+
|
|
101
|
+
Recorded cases support exact request counts and HTTP success checks. The full observation window starts immediately before the previous recorded action. Only same-origin Fetch and XHR requests count, matched by HTTP method and exact pathname, ignoring query strings. Success requires at least one request and HTTP 2xx completion for every match before the deadline. Results report total, successful, failed and incomplete calls without capturing headers or bodies.
|
|
102
|
+
|
package/dist/agent/bridge.js
CHANGED
|
@@ -49,7 +49,7 @@ export function createAgentBridge(options) {
|
|
|
49
49
|
if (req.method === 'GET' && url.pathname === '/artifact') {
|
|
50
50
|
const id = url.searchParams.get('id') ?? '', file = url.searchParams.get('file') ?? '';
|
|
51
51
|
if (!/^[\da-f-]{36}$/.test(id) ||
|
|
52
|
-
!/^(cases\.xlsx|results\.xlsx|results\.json|decisions\.ndjson|checkpoint\.json|trace\.zip|evidence\/[a-zA-Z0-9_-]{1,150}\.png)$/.test(file))
|
|
52
|
+
!/^(cases\.xlsx|results\.xlsx|results\.json|decisions\.ndjson|checkpoint\.json|trace\.zip|persistence-[a-zA-Z0-9_-]{1,85}\.zip|evidence\/[a-zA-Z0-9_-]{1,150}\.png)$/.test(file))
|
|
53
53
|
return send(400, { message: '无效的报告文件' });
|
|
54
54
|
const filename = path.join(root, id, file === 'results.xlsx' ? '执行结果.xlsx' : file);
|
|
55
55
|
if (!existsSync(filename))
|
package/dist/agent/bridge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../../src/agent/bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,OAAO,EAAoB,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAgBpC,gGAAgG;AAChG,MAAM,UAAU,iBAAiB,CAAC,OAA2B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
15
15
|
title: string;
|
|
16
|
+
operation?: string;
|
|
16
17
|
status: string;
|
|
17
18
|
reason: string;
|
|
18
19
|
steps: UpstreamStep[];
|
|
@@ -37,6 +38,7 @@ export interface UpstreamReport {
|
|
|
37
38
|
activeCase?: {
|
|
38
39
|
title?: string;
|
|
39
40
|
};
|
|
41
|
+
activity?: string;
|
|
40
42
|
caseFile?: string;
|
|
41
43
|
retainedRecord?: string;
|
|
42
44
|
pendingWrite?: unknown;
|
|
@@ -46,6 +48,7 @@ export interface UpstreamReport {
|
|
|
46
48
|
runtime?: {
|
|
47
49
|
currentName?: string;
|
|
48
50
|
};
|
|
51
|
+
coverage?: AgentStatus['coverage'];
|
|
49
52
|
}
|
|
50
53
|
/** Preserve upstream truth: recorded assertion steps are appended after successful execution. */
|
|
51
54
|
export declare function projectReport(report: UpstreamReport, mode: AgentStatus['mode'], final: boolean): AgentStatus;
|
package/dist/agent/report.js
CHANGED
|
@@ -18,7 +18,14 @@ function assertionTitle(step) {
|
|
|
18
18
|
'assert-input-invalid': `输入校验阻止无效数据:${target}`,
|
|
19
19
|
'assert-row': `列表存在唯一记录:${value}`,
|
|
20
20
|
'assert-absent': `列表中记录已消失:${value}`,
|
|
21
|
+
'assert-persisted-row': `独立会话重新打开后存在唯一记录:${value}`,
|
|
22
|
+
'assert-persisted-absent': `独立会话重新打开后记录不存在:${value}`,
|
|
21
23
|
'assert-text': `页面显示文本:${value}`,
|
|
24
|
+
'assert-record-detail': `列表之外的详情显示本轮记录:${value}`,
|
|
25
|
+
'assert-tab-panel': `页签已选中且关联内容面板可见:${target}`,
|
|
26
|
+
'assert-query-result': `唯一关键词查询仅返回本轮记录:${value}`,
|
|
27
|
+
'assert-disclosure': `展开 ${target} 后出现新控件,并已恢复原状态`,
|
|
28
|
+
'assert-related-records': '关联添加后显示唯一记录,独立会话确认持久化;移除后列表恢复为空,并再次独立核对',
|
|
22
29
|
};
|
|
23
30
|
return titles[step.kind] ?? `${step.kind} ${target}`;
|
|
24
31
|
}
|
|
@@ -27,6 +34,7 @@ export function projectReport(report, mode, final) {
|
|
|
27
34
|
const cases = (report.results ?? []).map((c) => ({
|
|
28
35
|
id: c.id,
|
|
29
36
|
title: c.title,
|
|
37
|
+
...(c.operation ? { operation: c.operation } : {}),
|
|
30
38
|
state: ['通过', '已验证'].includes(c.status)
|
|
31
39
|
? 'passed'
|
|
32
40
|
: ['不适用', '未选择'].includes(c.status)
|
|
@@ -81,10 +89,11 @@ export function projectReport(report, mode, final) {
|
|
|
81
89
|
state,
|
|
82
90
|
cases,
|
|
83
91
|
decisions: report.metrics?.modelCalls ?? 0,
|
|
92
|
+
...(report.coverage ? { coverage: report.coverage } : {}),
|
|
84
93
|
message: !final
|
|
85
|
-
?
|
|
94
|
+
? report.activity || report.activeCase?.title || '正在识别页面控件并生成可验证用例'
|
|
86
95
|
: (report.error ??
|
|
87
|
-
`${mode === 'explore' ? '探索' : '回放'}结束:${passed} 条通过,${cases.filter((c) => c.state === 'failed').length} 条失败,${cases.filter((c) => c.state === 'skipped').length}
|
|
96
|
+
`${mode === 'explore' ? '探索' : '回放'}结束:${passed} 条通过,${cases.filter((c) => c.state === 'failed').length} 条失败,${cases.filter((c) => c.state === 'skipped').length} 条不适用/未选择${report.coverage?.gaps.length ? `;另有 ${report.coverage.gaps.length} 项入口尚未验证` : ''}`),
|
|
88
97
|
...(final && mode === 'explore' && report.caseFile ? { workbook: 'cases.xlsx' } : {}),
|
|
89
98
|
};
|
|
90
99
|
}
|
package/dist/agent/report.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/agent/report.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/agent/report.ts"],"names":[],"mappings":"AAkCA,SAAS,cAAc,CAAC,IAAkB;IACxC,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CA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,CAAC,OAAO,EAAE,UAAU,IAAI,CAAC;QAC1C,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACzD,OAAO,EAAE,CAAC,KAAK;YACb,CAAC,CAAC,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,UAAU,EAAE,KAAK,IAAI,kBAAkB;YACnE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK;gBACb,GAAG,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,MAAM,MAAM,QAAQ,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,MAAM,QAAQ,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,MAAM,YAAY,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QACnQ,GAAG,CAAC,KAAK,IAAI,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACtF,CAAC;AACJ,CAAC"}
|
package/dist/agent/schema.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export interface CaseEvidence {
|
|
3
3
|
id: string;
|
|
4
4
|
title: string;
|
|
5
|
+
operation?: string;
|
|
5
6
|
state: 'passed' | 'failed' | 'skipped';
|
|
6
7
|
reason: string;
|
|
7
8
|
assertions: {
|
|
@@ -23,6 +24,15 @@ export interface AgentStatus {
|
|
|
23
24
|
decisions: number;
|
|
24
25
|
workbook?: string;
|
|
25
26
|
trace?: string;
|
|
27
|
+
coverage?: {
|
|
28
|
+
states: string[];
|
|
29
|
+
gaps: {
|
|
30
|
+
state: string;
|
|
31
|
+
role: string;
|
|
32
|
+
name: string;
|
|
33
|
+
reason: string;
|
|
34
|
+
}[];
|
|
35
|
+
};
|
|
26
36
|
}
|
|
27
37
|
export interface AgentCapabilities {
|
|
28
38
|
configured: boolean;
|
package/dist/agent/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/agent/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/agent/schema.ts"],"names":[],"mappings":"AA+BA,MAAM,UAAU,OAAO,CAAC,KAAc;IACpC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,IAAI;QAAE,MAAM,KAAK,CAAC,UAAU,CAAC,CAAC;IAC9E,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;IAC3B,IAAI,CAAC,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,QAAQ;QAC7E,MAAM,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACzC,OAAO,GAAG,CAAC,IAAI,CAAC;AAClB,CAAC"}
|
package/dist/assertions.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Page } from 'playwright';
|
|
2
|
-
import type
|
|
2
|
+
import { type Assertion, type AssertionResult } from './schema.js';
|
|
3
3
|
export declare function runAssertion(page: Page, assertion: Assertion, step: number, isStopped?: () => boolean): Promise<AssertionResult>;
|
package/dist/assertions.js
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
|
+
import { assertionOperators, isRequestAssertion } from './schema.js';
|
|
1
2
|
// Declarative browser assertions. Native CSS only; imported cases never execute scripts.
|
|
2
3
|
export async function runAssertion(page, assertion, step, isStopped = () => false) {
|
|
4
|
+
if (isRequestAssertion(assertion.source))
|
|
5
|
+
throw Error('接口断言需通过 runCase 在前一操作之前开始观察');
|
|
3
6
|
const started = Date.now();
|
|
4
7
|
let actual = '尚未采样';
|
|
5
8
|
let passed = false;
|
|
6
9
|
let stableSince;
|
|
7
|
-
const names = {
|
|
8
|
-
contains: '包含',
|
|
9
|
-
'not-contains': '不包含',
|
|
10
|
-
equals: '等于',
|
|
11
|
-
'not-equals': '不等于',
|
|
12
|
-
visible: '可见',
|
|
13
|
-
hidden: '不可见或不存在',
|
|
14
|
-
};
|
|
15
10
|
while (Date.now() - started < assertion.timeout) {
|
|
16
11
|
if (isStopped())
|
|
17
12
|
throw Error('已停止');
|
|
@@ -103,7 +98,7 @@ export async function runAssertion(page, assertion, step, isStopped = () => fals
|
|
|
103
98
|
step,
|
|
104
99
|
name: assertion.name,
|
|
105
100
|
passed,
|
|
106
|
-
expected: `${
|
|
101
|
+
expected: `${assertionOperators[assertion.operator]}${assertion.expected === undefined ? '' : ` ${assertion.expected === '' ? '空字符串' : assertion.expected}`}`,
|
|
107
102
|
actual: actual === 'visible' ? '可见' : actual === 'hidden' ? '不可见或不存在' : actual,
|
|
108
103
|
duration: Date.now() - started,
|
|
109
104
|
};
|
package/dist/assertions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertions.js","sourceRoot":"","sources":["../src/assertions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"assertions.js","sourceRoot":"","sources":["../src/assertions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAwC,MAAM,aAAa,CAAC;AAC3G,yFAAyF;AACzF,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,IAAU,EACV,SAAoB,EACpB,IAAY,EACZ,SAAS,G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,SAAS,CAAC,CAAC,CAAC,MAAM;QAC9E,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO;KAC/B,CAAC;AACJ,CAAC"}
|
package/dist/replay.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { openBrowser } from './browser.js';
|
|
2
2
|
import { waitForReady } from './readiness.js';
|
|
3
3
|
import { runAssertion } from './assertions.js';
|
|
4
|
-
import { parseCase } from './schema.js';
|
|
4
|
+
import { isRequestAssertion, parseCase, } from './schema.js';
|
|
5
|
+
import { observeActionRequests } from './request-assertions.js';
|
|
5
6
|
async function resolveTarget(page, target) {
|
|
6
7
|
await page.evaluate((selector) => document.querySelectorAll(selector).length, target.selector);
|
|
7
8
|
const locator = page.locator('css=' + target.selector);
|
|
@@ -72,6 +73,7 @@ export async function runCase(value, options) {
|
|
|
72
73
|
void browser.close().catch(() => { });
|
|
73
74
|
};
|
|
74
75
|
options.signal?.addEventListener('abort', stop, { once: true });
|
|
76
|
+
let requests;
|
|
75
77
|
try {
|
|
76
78
|
if (options.signal?.aborted)
|
|
77
79
|
throw Error('已停止');
|
|
@@ -105,7 +107,9 @@ export async function runCase(value, options) {
|
|
|
105
107
|
expected: step.value,
|
|
106
108
|
timeout: 10000,
|
|
107
109
|
};
|
|
108
|
-
const result =
|
|
110
|
+
const result = isRequestAssertion(assertion.source)
|
|
111
|
+
? await requests.check(assertion, index + 1, options.signal)
|
|
112
|
+
: await runAssertion(page, assertion, index + 1, () => options.signal?.aborted === true);
|
|
109
113
|
assertions.push(result);
|
|
110
114
|
report({});
|
|
111
115
|
if (!result.passed)
|
|
@@ -115,6 +119,17 @@ export async function runCase(value, options) {
|
|
|
115
119
|
if (step.kind === 'unsupported' || !step.target)
|
|
116
120
|
throw Error('请先补充未支持的步骤');
|
|
117
121
|
const target = await resolveTarget(page, step.target);
|
|
122
|
+
requests?.close();
|
|
123
|
+
const upcoming = [];
|
|
124
|
+
for (const next of testCase.steps.slice(index + 1)) {
|
|
125
|
+
if (next.kind !== 'assert' && next.kind !== 'assert-text')
|
|
126
|
+
break;
|
|
127
|
+
if (next.assertion && isRequestAssertion(next.assertion.source))
|
|
128
|
+
upcoming.push(next.assertion);
|
|
129
|
+
}
|
|
130
|
+
requests = upcoming.length
|
|
131
|
+
? observeActionRequests(page, origin.origin, upcoming)
|
|
132
|
+
: undefined;
|
|
118
133
|
if (step.kind === 'click')
|
|
119
134
|
await target.click();
|
|
120
135
|
else if (step.kind === 'fill')
|
|
@@ -144,6 +159,7 @@ export async function runCase(value, options) {
|
|
|
144
159
|
});
|
|
145
160
|
}
|
|
146
161
|
finally {
|
|
162
|
+
requests?.close();
|
|
147
163
|
options.signal?.removeEventListener('abort', stop);
|
|
148
164
|
await browser.close();
|
|
149
165
|
}
|
package/dist/replay.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replay.js","sourceRoot":"","sources":["../src/replay.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,
|
|
1
|
+
{"version":3,"file":"replay.js","sourceRoot":"","sources":["../src/replay.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EACL,kBAAkB,EAClB,SAAS,GAKV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAchE,KAAK,UAAU,aAAa,CAAC,IAAU,EAAE,MAAc;IACrD,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,g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AC;YAClE,CAAC;YACD,MAAM,YAAY,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;QAC7D,CAAC;QACD,MAAM,CAAC;YACL,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW;YACjD,OAAO,EAAE,UAAU,CAAC,MAAM;gBACxB,CAAC,CAAC,QAAQ,UAAU,CAAC,MAAM,UAAU;gBACrC,CAAC,CAAC,uBAAuB;SAC5B,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC;YACL,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ;YACrD,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO;gBAC9B,CAAC,CAAC,OAAO;gBACT,CAAC,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC;SAC5E,CAAC,CAAC;IACL,CAAC;YAAS,CAAC;QACT,QAAQ,EAAE,KAAK,EAAE,CAAC;QAClB,OAAO,CAAC,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACnD,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Page } from 'playwright';
|
|
2
|
+
import type { Assertion, AssertionResult } from './schema.js';
|
|
3
|
+
export declare function observeActionRequests(page: Page, origin: string, assertions: Assertion[]): {
|
|
4
|
+
close(): void;
|
|
5
|
+
check(assertion: Assertion, step: number, signal?: AbortSignal): Promise<AssertionResult>;
|
|
6
|
+
};
|