@unotest/web 0.9.1 → 0.11.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/.claude/skills/write-e2e-test/SKILL.md +118 -38
- package/.claude/skills/write-e2e-test-ground/SKILL.md +787 -0
- package/CHANGELOG.md +297 -0
- package/dist/config/schema.d.ts +29 -10
- package/dist/config/schema.js +1 -1
- package/dist/driver/index.d.ts +5 -2
- package/dist/driver/index.js +1 -1
- package/dist/dsl/index.d.ts +19 -3
- package/dist/dsl/index.js +1 -1
- package/dist/dsl/web-dsl-language-service.js +1 -1
- package/dist/inspection/page-inject.d.ts +11 -35
- package/dist/inspection/page-inject.js +173 -1032
- package/dist/{interfaces-dbZG10RS.d.ts → interfaces-MxHi1Air.d.ts} +50 -3
- package/dist/mcp/server.js +1 -1
- package/dist/runner/cli.d.ts +11 -1
- package/dist/runner/cli.js +1 -1
- package/dist/runner/init/chrome-probe.js +1 -1
- package/dist/runner/init.js +1 -1
- package/dist/runner/install-chromium.js +1 -1
- package/dist/runner/prepare-fix.js +1 -1
- package/dist/runner/scaffold-workspace.js +1 -1
- package/dist/runner/serve-fixture.js +1 -1
- package/dist/runner/web-runner-adapter.js +1 -1
- package/guides/agent-integration.md +103 -2
- package/guides/dsl-reference.md +150 -13
- package/package.json +10 -38
- package/src/mcp/prompts/agent-test-author.md +71 -3
package/dist/dsl/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as LocatorValue, W as WebDriver, D as DriverContext, d as DriverPage } from '../interfaces-
|
|
2
|
-
export { j as LocatorStep, k as appendStep, l as describeLocator, m as isLocatorValue, r as rootedAt } from '../interfaces-
|
|
1
|
+
import { i as LocatorValue, W as WebDriver, D as DriverContext, d as DriverPage } from '../interfaces-MxHi1Air.js';
|
|
2
|
+
export { j as LocatorStep, k as appendStep, l as describeLocator, m as isLocatorValue, r as rootedAt } from '../interfaces-MxHi1Air.js';
|
|
3
3
|
import { Matcher, RegexLiteral } from '@unotest/protocol';
|
|
4
4
|
import { ExecutionWalker, ExecutionEvent, RunResult, RunOptions } from '@unotest/dsl/executor';
|
|
5
5
|
export { ExecutionError, ExecutionEvent, RunOptions, RunResult } from '@unotest/dsl/executor';
|
|
@@ -46,6 +46,7 @@ declare function filter(loc: LocatorValue, options: {
|
|
|
46
46
|
declare function first(loc: LocatorValue): LocatorValue;
|
|
47
47
|
declare function last(loc: LocatorValue): LocatorValue;
|
|
48
48
|
declare function nth(loc: LocatorValue, index: number): LocatorValue;
|
|
49
|
+
declare function randomNth(loc: LocatorValue): LocatorValue;
|
|
49
50
|
declare function contentFrame(loc: LocatorValue): LocatorValue;
|
|
50
51
|
declare function chainGetByRole(loc: LocatorValue, role: string, options?: {
|
|
51
52
|
name?: Matcher;
|
|
@@ -83,6 +84,12 @@ interface Logger {
|
|
|
83
84
|
child(prefix: string): Logger;
|
|
84
85
|
}
|
|
85
86
|
|
|
87
|
+
interface ScreenshotSink {
|
|
88
|
+
/** Persist one PNG capture. Returns the project-relative path the
|
|
89
|
+
* artifact landed at. */
|
|
90
|
+
save(name: string, png: Buffer): Promise<string>;
|
|
91
|
+
}
|
|
92
|
+
|
|
86
93
|
type DslPrimitive = string | number | boolean | null;
|
|
87
94
|
type DslObject = {
|
|
88
95
|
readonly [key: string]: DslValue;
|
|
@@ -107,6 +114,10 @@ interface TestRuntimeDeps {
|
|
|
107
114
|
readonly baseUrl?: string;
|
|
108
115
|
/** Injectable clock — defaults to Date.now. Tests pass a fake. */
|
|
109
116
|
readonly nowFn?: () => number;
|
|
117
|
+
/** Sink for on-demand `screenshot()` captures. Wired by the CLI runner
|
|
118
|
+
* to the run dir; absent in ad-hoc / explore runtimes (the DSL
|
|
119
|
+
* function then logs and skips). */
|
|
120
|
+
readonly screenshots?: ScreenshotSink;
|
|
110
121
|
}
|
|
111
122
|
declare class TestRuntime {
|
|
112
123
|
readonly runId: string;
|
|
@@ -115,6 +126,7 @@ declare class TestRuntime {
|
|
|
115
126
|
readonly logger: Logger;
|
|
116
127
|
readonly sandbox: SandboxConfig;
|
|
117
128
|
readonly baseUrl?: string;
|
|
129
|
+
readonly screenshots?: ScreenshotSink;
|
|
118
130
|
private readonly variables;
|
|
119
131
|
private readonly nowFn;
|
|
120
132
|
private readonly scope;
|
|
@@ -254,6 +266,10 @@ declare class TestRuntimeManager {
|
|
|
254
266
|
* attach its overlay to the page held open during a debug pause.
|
|
255
267
|
* Returns null when the runtime is gone or has no page yet. */
|
|
256
268
|
currentPage(id: string): DriverPage | null;
|
|
269
|
+
/** Every open page of the runtime's context (debug picker arms its overlay
|
|
270
|
+
* on all of them at once, Playwright-codegen style). Empty when the runtime
|
|
271
|
+
* is gone or has no context yet. */
|
|
272
|
+
pages(id: string): readonly DriverPage[];
|
|
257
273
|
/** The runtime's driver context (for capture artifacts — console/network).
|
|
258
274
|
* Null when the runtime isn't registered. */
|
|
259
275
|
currentContext(id: string): DriverContext | null;
|
|
@@ -266,4 +282,4 @@ declare class TestRuntimeManager {
|
|
|
266
282
|
/** Build a fully-populated FunctionRegistry. */
|
|
267
283
|
declare function buildDefaultRegistry(): FunctionRegistry;
|
|
268
284
|
|
|
269
|
-
export { AstExecutor, type DslArg, type DslArray, type DslFunction, type DslObject, type DslValue, FunctionRegistry, LocatorValue, TestRuntime, TestRuntimeManager, buildDefaultRegistry, chainGetByAltText, chainGetByLabel, chainGetByPlaceholder, chainGetByRole, chainGetByTestId, chainGetByText, chainGetByTitle, contentFrame, filter, first, getByAltText, getByLabel, getByPlaceholder, getByRole, getByTestId, getByText, getByTitle, last, locator, nth, re };
|
|
285
|
+
export { AstExecutor, type DslArg, type DslArray, type DslFunction, type DslObject, type DslValue, FunctionRegistry, LocatorValue, TestRuntime, TestRuntimeManager, buildDefaultRegistry, chainGetByAltText, chainGetByLabel, chainGetByPlaceholder, chainGetByRole, chainGetByTestId, chainGetByText, chainGetByTitle, contentFrame, filter, first, getByAltText, getByLabel, getByPlaceholder, getByRole, getByTestId, getByText, getByTitle, last, locator, nth, randomNth, re };
|