@unotest/web 0.30.0 → 0.31.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 +12 -0
- package/.claude/skills/write-e2e-test-ground/SKILL.md +12 -0
- package/CHANGELOG.md +266 -0
- package/bin/unotest-web.js +3 -1
- package/dist/config/schema.d.ts +9 -9
- package/dist/config/schema.js +1 -1
- package/dist/driver/index.d.ts +11 -3
- package/dist/driver/index.js +1 -1
- package/dist/dsl/index.d.ts +34 -4
- package/dist/dsl/index.js +1 -1
- package/dist/dsl/web-dsl-language-service.d.ts +22 -2
- package/dist/dsl/web-dsl-language-service.js +1 -1
- package/dist/inspection/page-inject.d.ts +1 -1
- package/dist/{interfaces-BluheUKs.d.ts → interfaces-B34N4rfI.d.ts} +8 -0
- package/dist/legacy-layout-By62PkbP.d.ts +8 -0
- package/dist/linter-Yf4gPe5J.d.ts +36 -0
- package/dist/mcp/server.js +1 -1
- package/dist/runner/cli.d.ts +13 -2
- 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 +43 -2
- package/guides/dsl-reference.md +156 -9
- package/package.json +8 -8
- package/src/mcp/prompts/agent-test-author.md +11 -1
- package/types/unotest-dsl.d.ts +29 -5
- package/dist/linter-CM2CpIyW.d.ts +0 -21
|
@@ -226,6 +226,10 @@ interface ScreenshotOptions {
|
|
|
226
226
|
* pins that floor. */
|
|
227
227
|
type?: "png" | "jpeg" | "webp";
|
|
228
228
|
}
|
|
229
|
+
/** Encoding options for an element capture — `ScreenshotOptions` minus
|
|
230
|
+
* the page-geometry fields (`fullPage`, `clip`) that have no meaning for a
|
|
231
|
+
* single element. */
|
|
232
|
+
type ElementScreenshotOptions = Pick<ScreenshotOptions, "type" | "quality">;
|
|
229
233
|
interface CookieOptions {
|
|
230
234
|
domain?: string;
|
|
231
235
|
path?: string;
|
|
@@ -429,6 +433,10 @@ interface DriverPage {
|
|
|
429
433
|
evaluate<T = unknown>(js: string, arg?: unknown): Promise<T>;
|
|
430
434
|
evaluateOnLocator<T = unknown>(loc: LocatorValue, js: string): Promise<T>;
|
|
431
435
|
screenshot(opts?: ScreenshotOptions): Promise<Buffer>;
|
|
436
|
+
/** Capture ONE element (first match, scrolled into view) instead of the
|
|
437
|
+
* viewport — the evidence shot of a card / row / dialog. Same encoding
|
|
438
|
+
* options as `screenshot`; `fullPage` / `clip` don't apply. */
|
|
439
|
+
screenshotElement(loc: LocatorValue, opts?: ElementScreenshotOptions): Promise<Buffer>;
|
|
432
440
|
inspectElement(loc: LocatorValue): Promise<ElementHint | null>;
|
|
433
441
|
/** outerHTML of the element the locator matches (first match), or null
|
|
434
442
|
* when it resolves to zero elements. Used by debug logging to persist
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface LegacyLayout {
|
|
2
|
+
/** Root-relative config path that is no longer read, if there is one. */
|
|
3
|
+
configPath?: string;
|
|
4
|
+
/** True when the product's own manifest still carries the runner. */
|
|
5
|
+
pinInProductManifest: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type { LegacyLayout as L };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { BlockStatement } from '@unotest/dsl';
|
|
2
|
+
|
|
3
|
+
type LintSeverity = 'error' | 'warning' | 'info';
|
|
4
|
+
interface LintDiagnostic {
|
|
5
|
+
rule: string;
|
|
6
|
+
severity: LintSeverity;
|
|
7
|
+
message: string;
|
|
8
|
+
line: number;
|
|
9
|
+
col: number;
|
|
10
|
+
}
|
|
11
|
+
/** What the linter may ask about external variables (bare UPPER_SNAKE
|
|
12
|
+
* identifiers). A predicate, not a list, because the two callers hold
|
|
13
|
+
* different truths: `lint` knows the NAMES declared in the project's
|
|
14
|
+
* files, a run knows what the runtime will actually RESOLVE (files plus
|
|
15
|
+
* the ambient shell) — and the run-time store already answers `has`. */
|
|
16
|
+
interface ExternalVariableLookup {
|
|
17
|
+
has(name: string): boolean;
|
|
18
|
+
/** Where `has` looked, for the diagnostic (`unotest/.env, unotest/.env.dev (no such file)`). */
|
|
19
|
+
describeSources?(): string;
|
|
20
|
+
}
|
|
21
|
+
interface LintOptions {
|
|
22
|
+
/** Per-rule severity override. Default severities live with each rule. */
|
|
23
|
+
ruleSeverity?: Partial<Record<string, LintSeverity>>;
|
|
24
|
+
/** Pass through if the agent provided documented justification — e.g. a
|
|
25
|
+
* `// reason:` comment immediately above the line. The lexer doesn't
|
|
26
|
+
* preserve comments today; for v1 we accept a flag from the caller. */
|
|
27
|
+
allowDisambigByIndex?: boolean;
|
|
28
|
+
/** Enables `lint:external-variable-undeclared`: every bare UPPER_SNAKE
|
|
29
|
+
* identifier that is neither bound in this file nor known to the
|
|
30
|
+
* lookup is an error. Absent → the rule is off (the caller has no
|
|
31
|
+
* project to check against, e.g. an ad-hoc source string). */
|
|
32
|
+
externalVariables?: ExternalVariableLookup;
|
|
33
|
+
}
|
|
34
|
+
declare function lintAst(ast: BlockStatement, opts?: LintOptions): LintDiagnostic[];
|
|
35
|
+
|
|
36
|
+
export { type ExternalVariableLookup as E, type LintDiagnostic as L, type LintSeverity as a, type LintOptions as b, lintAst as l };
|