@qontinui/ui-bridge 0.3.0 → 0.3.1
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/dist/ai/index.d.mts +312 -155
- package/dist/ai/index.d.ts +312 -155
- package/dist/ai/index.js +2363 -67
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/index.mjs +2328 -68
- package/dist/ai/index.mjs.map +1 -1
- package/dist/annotations/index.d.mts +218 -0
- package/dist/annotations/index.d.ts +218 -0
- package/dist/annotations/index.js +246 -0
- package/dist/annotations/index.js.map +1 -0
- package/dist/annotations/index.mjs +241 -0
- package/dist/annotations/index.mjs.map +1 -0
- package/dist/assertions-BSR3afVr.d.ts +161 -0
- package/dist/assertions-CTw1hfOx.d.mts +161 -0
- package/dist/babel-plugin/index.js +23 -34
- package/dist/babel-plugin/index.js.map +1 -1
- package/dist/babel-plugin/index.mjs +23 -34
- package/dist/babel-plugin/index.mjs.map +1 -1
- package/dist/browser-capture-Bms60T6f.d.mts +47 -0
- package/dist/browser-capture-CsTU29mb.d.ts +47 -0
- package/dist/control/index.d.mts +26 -7
- package/dist/control/index.d.ts +26 -7
- package/dist/control/index.js +276 -48
- package/dist/control/index.js.map +1 -1
- package/dist/control/index.mjs +276 -48
- package/dist/control/index.mjs.map +1 -1
- package/dist/core/index.d.mts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs.map +1 -1
- package/dist/debug/index.d.mts +5 -3
- package/dist/debug/index.d.ts +5 -3
- package/dist/debug/index.js +925 -1
- package/dist/debug/index.js.map +1 -1
- package/dist/debug/index.mjs +924 -2
- package/dist/debug/index.mjs.map +1 -1
- package/dist/index.d.mts +12 -7
- package/dist/index.d.ts +12 -7
- package/dist/index.js +4720 -173
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4656 -174
- package/dist/index.mjs.map +1 -1
- package/dist/{metrics-DTA2bwG7.d.mts → metrics-DuA2qIIz.d.mts} +2 -2
- package/dist/{metrics-BfiT_rhZ.d.ts → metrics-KFAAKNEB.d.ts} +2 -2
- package/dist/native/control/index.js +2 -7
- package/dist/native/control/index.js.map +1 -1
- package/dist/native/control/index.mjs +2 -7
- package/dist/native/control/index.mjs.map +1 -1
- package/dist/native/core/index.js.map +1 -1
- package/dist/native/core/index.mjs.map +1 -1
- package/dist/native/debug/index.js +23 -66
- package/dist/native/debug/index.js.map +1 -1
- package/dist/native/debug/index.mjs +23 -66
- package/dist/native/debug/index.mjs.map +1 -1
- package/dist/native/index.js +89 -131
- package/dist/native/index.js.map +1 -1
- package/dist/native/index.mjs +89 -131
- package/dist/native/index.mjs.map +1 -1
- package/dist/native/react/index.js +28 -52
- package/dist/native/react/index.js.map +1 -1
- package/dist/native/react/index.mjs +28 -52
- package/dist/native/react/index.mjs.map +1 -1
- package/dist/native/server/index.js +38 -13
- package/dist/native/server/index.js.map +1 -1
- package/dist/native/server/index.mjs +38 -13
- package/dist/native/server/index.mjs.map +1 -1
- package/dist/react/index.d.mts +107 -8
- package/dist/react/index.d.ts +107 -8
- package/dist/react/index.js +2194 -84
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +2194 -85
- package/dist/react/index.mjs.map +1 -1
- package/dist/{registry-BKLEm-yk.d.ts → registry-C6dDtn1v.d.ts} +27 -2
- package/dist/{registry-BmZgyCz8.d.mts → registry-POtcxnal.d.mts} +27 -2
- package/dist/render-log/index.d.mts +1 -1
- package/dist/render-log/index.d.ts +1 -1
- package/dist/server/express.d.mts +5 -4
- package/dist/server/express.d.ts +5 -4
- package/dist/server/express.js +104 -2
- package/dist/server/express.js.map +1 -1
- package/dist/server/express.mjs +104 -2
- package/dist/server/express.mjs.map +1 -1
- package/dist/server/handlers.d.mts +36 -5
- package/dist/server/handlers.d.ts +36 -5
- package/dist/server/handlers.js +3129 -224
- package/dist/server/handlers.js.map +1 -1
- package/dist/server/handlers.mjs +3129 -224
- package/dist/server/handlers.mjs.map +1 -1
- package/dist/server/index.d.mts +7 -5
- package/dist/server/index.d.ts +7 -5
- package/dist/server/index.js +3215 -183
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +3215 -183
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/nextjs.d.mts +6 -4
- package/dist/server/nextjs.d.ts +6 -4
- package/dist/server/nextjs.js +106 -3
- package/dist/server/nextjs.js.map +1 -1
- package/dist/server/nextjs.mjs +106 -3
- package/dist/server/nextjs.mjs.map +1 -1
- package/dist/server/standalone.d.mts +6 -5
- package/dist/server/standalone.d.ts +6 -5
- package/dist/server/standalone.js +131 -5
- package/dist/server/standalone.js.map +1 -1
- package/dist/server/standalone.mjs +131 -5
- package/dist/server/standalone.mjs.map +1 -1
- package/dist/specs/index.d.mts +365 -0
- package/dist/specs/index.d.ts +365 -0
- package/dist/specs/index.js +2809 -0
- package/dist/specs/index.js.map +1 -0
- package/dist/specs/index.mjs +2786 -0
- package/dist/specs/index.mjs.map +1 -0
- package/dist/{standalone-BURj8J3G.d.ts → standalone-B6GLIEmR.d.ts} +6 -2
- package/dist/{standalone-Dwmel29d.d.mts → standalone-CjdYqj3P.d.mts} +6 -2
- package/dist/{types-CHnlwiTK.d.ts → types-B2EfvEaq.d.ts} +83 -3
- package/dist/{types-B7J7noLK.d.mts → types-C7gVYRnF.d.ts} +72 -2
- package/dist/{types-BkNRILUa.d.ts → types-CJGrBEhC.d.mts} +72 -2
- package/dist/types-CebMQj76.d.ts +1275 -0
- package/dist/types-D_ypYl3T.d.mts +1275 -0
- package/dist/types-UBtp7R0u.d.mts +132 -0
- package/dist/types-UBtp7R0u.d.ts +132 -0
- package/dist/{types-CEQLnFMv.d.mts → types-gO696T_t.d.mts} +83 -3
- package/dist/{types-jKVgTI6_.d.mts → types-suaYwWWg.d.mts} +173 -2
- package/dist/{types-jKVgTI6_.d.ts → types-suaYwWWg.d.ts} +173 -2
- package/package.json +18 -2
- package/dist/types-B5Q0GVo0.d.mts +0 -646
- package/dist/types-DfPqwU-i.d.ts +0 -646
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
import { a8 as SearchCriteria, f as AssertionType, e as AssertionResult, A as AIDiscoveredElement, d as AssertionRequest } from '../types-D_ypYl3T.mjs';
|
|
2
|
+
import { A as AssertionConfig } from '../assertions-CTw1hfOx.mjs';
|
|
3
|
+
import { D as DiscoveredElement } from '../types-CJGrBEhC.mjs';
|
|
4
|
+
import '../types-suaYwWWg.mjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Spec Types
|
|
8
|
+
*
|
|
9
|
+
* Type definitions for the UI Bridge specification system.
|
|
10
|
+
* Specs define declarative assertions about UI elements that can be
|
|
11
|
+
* authored, stored, executed, and used for regression testing.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
type SpecCategory = 'element-presence' | 'accessibility' | 'form-validation' | 'state-consistency' | 'modal-dialog' | 'navigation' | 'cross-page-consistency' | 'custom';
|
|
15
|
+
type SpecSeverity = 'critical' | 'warning' | 'info';
|
|
16
|
+
type SpecSource = 'auto' | 'manual' | 'ai-generated';
|
|
17
|
+
/**
|
|
18
|
+
* Unified target for spec assertions.
|
|
19
|
+
* Bridges to AssertionRequest.target (string | SearchCriteria).
|
|
20
|
+
*/
|
|
21
|
+
type SpecTarget = {
|
|
22
|
+
type: 'elementId';
|
|
23
|
+
elementId: string;
|
|
24
|
+
label?: string;
|
|
25
|
+
} | {
|
|
26
|
+
type: 'search';
|
|
27
|
+
criteria: SearchCriteria;
|
|
28
|
+
label?: string;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* A condition that must be met for an assertion to be evaluated.
|
|
32
|
+
* If the condition is not met, the assertion is skipped (passes with no opinion).
|
|
33
|
+
*
|
|
34
|
+
* Use case: "Button is disabled WHEN runner is not connected"
|
|
35
|
+
* - The assertion only has an opinion when the runner is NOT connected
|
|
36
|
+
* - When connected, the assertion should skip (not fail)
|
|
37
|
+
*/
|
|
38
|
+
type AssertionCondition = {
|
|
39
|
+
/** Check if a target element exists */
|
|
40
|
+
type: 'exists';
|
|
41
|
+
target: SpecTarget;
|
|
42
|
+
} | {
|
|
43
|
+
/** Check if a target element does NOT exist */
|
|
44
|
+
type: 'notExists';
|
|
45
|
+
target: SpecTarget;
|
|
46
|
+
} | {
|
|
47
|
+
/** Check if a target element has specific text content */
|
|
48
|
+
type: 'hasText';
|
|
49
|
+
target: SpecTarget;
|
|
50
|
+
text: string;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* A single spec assertion — wraps an AssertionRequest with metadata.
|
|
54
|
+
*/
|
|
55
|
+
interface SpecAssertion {
|
|
56
|
+
id: string;
|
|
57
|
+
description: string;
|
|
58
|
+
category: SpecCategory;
|
|
59
|
+
severity: SpecSeverity;
|
|
60
|
+
target: SpecTarget;
|
|
61
|
+
/** Strongly typed assertion type from ui-bridge/ai */
|
|
62
|
+
assertionType: AssertionType;
|
|
63
|
+
expected?: unknown;
|
|
64
|
+
attributeName?: string;
|
|
65
|
+
propertyName?: string;
|
|
66
|
+
message?: string;
|
|
67
|
+
timeout?: number;
|
|
68
|
+
source: SpecSource;
|
|
69
|
+
reviewed: boolean;
|
|
70
|
+
enabled: boolean;
|
|
71
|
+
notes?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Optional condition that must be met for this assertion to be evaluated.
|
|
74
|
+
* If condition is not met, the assertion is skipped (passes with no opinion).
|
|
75
|
+
*
|
|
76
|
+
* Example: "A is false when B is false" → condition checks if B is false,
|
|
77
|
+
* and only then evaluates whether A is false. If B is true, skip.
|
|
78
|
+
*/
|
|
79
|
+
condition?: AssertionCondition;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* A named collection of related spec assertions.
|
|
83
|
+
*/
|
|
84
|
+
interface SpecGroup {
|
|
85
|
+
id: string;
|
|
86
|
+
name: string;
|
|
87
|
+
description: string;
|
|
88
|
+
category: SpecCategory;
|
|
89
|
+
assertions: SpecAssertion[];
|
|
90
|
+
stateId?: string;
|
|
91
|
+
transitionId?: string;
|
|
92
|
+
source: SpecSource;
|
|
93
|
+
tags?: string[];
|
|
94
|
+
}
|
|
95
|
+
interface SpecMetadata {
|
|
96
|
+
component?: string;
|
|
97
|
+
author?: string;
|
|
98
|
+
createdAt?: string;
|
|
99
|
+
updatedAt?: string;
|
|
100
|
+
pageUrl?: string;
|
|
101
|
+
tags?: string[];
|
|
102
|
+
/** Explicit element source: "control" for runner UI, "external" for browser tab */
|
|
103
|
+
elementSource?: 'control' | 'external';
|
|
104
|
+
[key: string]: unknown;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Top-level spec config — the JSON file format.
|
|
108
|
+
*/
|
|
109
|
+
interface SpecConfig {
|
|
110
|
+
version: '1.0.0';
|
|
111
|
+
description?: string;
|
|
112
|
+
groups: SpecGroup[];
|
|
113
|
+
/** Ungrouped assertions (convenience for simple specs) */
|
|
114
|
+
assertions?: SpecAssertion[];
|
|
115
|
+
metadata?: SpecMetadata;
|
|
116
|
+
}
|
|
117
|
+
interface SpecAssertionResult {
|
|
118
|
+
assertionId: string;
|
|
119
|
+
groupId?: string;
|
|
120
|
+
severity: SpecSeverity;
|
|
121
|
+
category: SpecCategory;
|
|
122
|
+
skipped: boolean;
|
|
123
|
+
/** Reason for skipping (if skipped) */
|
|
124
|
+
skipReason?: 'disabled' | 'condition_not_met' | 'filtered';
|
|
125
|
+
/** The underlying assertion result (null if skipped) */
|
|
126
|
+
result: AssertionResult | null;
|
|
127
|
+
}
|
|
128
|
+
interface SpecGroupResult {
|
|
129
|
+
groupId: string;
|
|
130
|
+
groupName: string;
|
|
131
|
+
assertionResults: SpecAssertionResult[];
|
|
132
|
+
passedCount: number;
|
|
133
|
+
failedCount: number;
|
|
134
|
+
skippedCount: number;
|
|
135
|
+
passed: boolean;
|
|
136
|
+
durationMs: number;
|
|
137
|
+
timestamp: number;
|
|
138
|
+
}
|
|
139
|
+
interface SpecExecutionResult {
|
|
140
|
+
specVersion: string;
|
|
141
|
+
groupResults: SpecGroupResult[];
|
|
142
|
+
ungroupedResults: SpecAssertionResult[];
|
|
143
|
+
totalAssertions: number;
|
|
144
|
+
passedCount: number;
|
|
145
|
+
failedCount: number;
|
|
146
|
+
skippedCount: number;
|
|
147
|
+
passed: boolean;
|
|
148
|
+
durationMs: number;
|
|
149
|
+
timestamp: number;
|
|
150
|
+
}
|
|
151
|
+
interface SpecExecutionOptions {
|
|
152
|
+
categories?: SpecCategory[];
|
|
153
|
+
severities?: SpecSeverity[];
|
|
154
|
+
groupIds?: string[];
|
|
155
|
+
assertionIds?: string[];
|
|
156
|
+
stopOnFailure?: boolean;
|
|
157
|
+
skipUnreviewed?: boolean;
|
|
158
|
+
timeout?: number;
|
|
159
|
+
}
|
|
160
|
+
interface SpecCoverage {
|
|
161
|
+
totalElements: number;
|
|
162
|
+
specifiedElements: number;
|
|
163
|
+
coveragePercent: number;
|
|
164
|
+
specifiedIds: string[];
|
|
165
|
+
unspecifiedIds: string[];
|
|
166
|
+
timestamp: number;
|
|
167
|
+
}
|
|
168
|
+
type SpecEventType = 'spec:loaded' | 'spec:unloaded' | 'spec:updated' | 'spec:cleared' | 'spec:assertion-added' | 'spec:assertion-removed' | 'spec:group-added' | 'spec:group-removed';
|
|
169
|
+
interface SpecEvent {
|
|
170
|
+
type: SpecEventType;
|
|
171
|
+
specId?: string;
|
|
172
|
+
groupId?: string;
|
|
173
|
+
assertionId?: string;
|
|
174
|
+
timestamp: number;
|
|
175
|
+
}
|
|
176
|
+
declare const SPEC_CONFIG_VERSION = "1.0.0";
|
|
177
|
+
declare const SPEC_FILE_EXTENSION = ".spec.uibridge.json";
|
|
178
|
+
declare const VALID_ASSERTION_TYPES: readonly AssertionType[];
|
|
179
|
+
declare const VALID_SPEC_CATEGORIES: readonly SpecCategory[];
|
|
180
|
+
declare const VALID_SPEC_SEVERITIES: readonly SpecSeverity[];
|
|
181
|
+
declare const VALID_SPEC_SOURCES: readonly SpecSource[];
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Spec Validator
|
|
185
|
+
*
|
|
186
|
+
* Structural validation for .spec.uibridge.json files.
|
|
187
|
+
* No JSON Schema dependency — validates manually.
|
|
188
|
+
*/
|
|
189
|
+
|
|
190
|
+
interface ValidationError {
|
|
191
|
+
path: string;
|
|
192
|
+
message: string;
|
|
193
|
+
}
|
|
194
|
+
interface ValidationResult {
|
|
195
|
+
valid: boolean;
|
|
196
|
+
errors: ValidationError[];
|
|
197
|
+
}
|
|
198
|
+
declare function isValidAssertionType(value: unknown): value is AssertionType;
|
|
199
|
+
declare function isValidSpecCategory(value: unknown): value is SpecCategory;
|
|
200
|
+
declare function isValidSpecSeverity(value: unknown): value is SpecSeverity;
|
|
201
|
+
declare function isValidSpecSource(value: unknown): value is SpecSource;
|
|
202
|
+
declare function validateSpecAssertion(data: unknown, path?: string): ValidationError[];
|
|
203
|
+
declare function validateSpecGroup(data: unknown, path?: string): ValidationError[];
|
|
204
|
+
declare function validateSpecConfig(data: unknown): ValidationResult;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Spec Migration
|
|
208
|
+
*
|
|
209
|
+
* Converts legacy TestGeneratorOutput format (from qontinui-schemas)
|
|
210
|
+
* to the new SpecConfig format.
|
|
211
|
+
*/
|
|
212
|
+
|
|
213
|
+
interface LegacyTestTarget {
|
|
214
|
+
type: 'elementId' | 'formId' | 'modalId';
|
|
215
|
+
elementId?: string;
|
|
216
|
+
formId?: string;
|
|
217
|
+
modalId?: string;
|
|
218
|
+
label?: string;
|
|
219
|
+
}
|
|
220
|
+
interface LegacyTestAssertion {
|
|
221
|
+
id: string;
|
|
222
|
+
description: string;
|
|
223
|
+
category: string;
|
|
224
|
+
severity: string;
|
|
225
|
+
target: LegacyTestTarget;
|
|
226
|
+
assertionType: string;
|
|
227
|
+
expected?: unknown;
|
|
228
|
+
attributeName?: string;
|
|
229
|
+
source: string;
|
|
230
|
+
reviewed: boolean;
|
|
231
|
+
enabled: boolean;
|
|
232
|
+
notes?: string;
|
|
233
|
+
}
|
|
234
|
+
interface LegacyTestSpecification {
|
|
235
|
+
id: string;
|
|
236
|
+
name: string;
|
|
237
|
+
description: string;
|
|
238
|
+
category: string;
|
|
239
|
+
assertions: LegacyTestAssertion[];
|
|
240
|
+
stateId: string;
|
|
241
|
+
transitionId?: string;
|
|
242
|
+
source: string;
|
|
243
|
+
createdAt: string;
|
|
244
|
+
updatedAt: string;
|
|
245
|
+
}
|
|
246
|
+
interface LegacyTestGeneratorOutput {
|
|
247
|
+
version: string;
|
|
248
|
+
projectId?: string;
|
|
249
|
+
generatorType?: string;
|
|
250
|
+
states?: unknown[];
|
|
251
|
+
transitions?: unknown[];
|
|
252
|
+
testSpecifications: LegacyTestSpecification[];
|
|
253
|
+
snapshotMetadata?: Record<string, unknown>;
|
|
254
|
+
explorationMetadata?: Record<string, unknown>;
|
|
255
|
+
createdAt?: string;
|
|
256
|
+
updatedAt?: string;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Coerce a raw string to a valid AssertionType, or return null.
|
|
260
|
+
*/
|
|
261
|
+
declare function coerceAssertionType(raw: string): AssertionType | null;
|
|
262
|
+
/**
|
|
263
|
+
* Convert a legacy TestTarget to a SpecTarget.
|
|
264
|
+
*/
|
|
265
|
+
declare function migrateLegacyTarget(legacy: LegacyTestTarget): SpecTarget;
|
|
266
|
+
/**
|
|
267
|
+
* Convert a legacy TestAssertion to a SpecAssertion.
|
|
268
|
+
*/
|
|
269
|
+
declare function migrateLegacyAssertion(legacy: LegacyTestAssertion): SpecAssertion;
|
|
270
|
+
/**
|
|
271
|
+
* Convert a legacy TestGeneratorOutput to a SpecConfig.
|
|
272
|
+
*/
|
|
273
|
+
declare function migrateFromTestGeneratorOutput(legacy: LegacyTestGeneratorOutput): SpecConfig;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Spec Store
|
|
277
|
+
*
|
|
278
|
+
* In-memory store for spec configs with CRUD operations,
|
|
279
|
+
* import/export, coverage tracking, and event emission.
|
|
280
|
+
* Follows the AnnotationStore pattern.
|
|
281
|
+
*/
|
|
282
|
+
|
|
283
|
+
type SpecListener = (event: SpecEvent) => void;
|
|
284
|
+
interface SpecFilterOptions {
|
|
285
|
+
categories?: SpecCategory[];
|
|
286
|
+
severities?: SpecSeverity[];
|
|
287
|
+
enabledOnly?: boolean;
|
|
288
|
+
reviewedOnly?: boolean;
|
|
289
|
+
}
|
|
290
|
+
declare class SpecStore {
|
|
291
|
+
private configs;
|
|
292
|
+
private listeners;
|
|
293
|
+
load(specId: string, config: SpecConfig): void;
|
|
294
|
+
unload(specId: string): boolean;
|
|
295
|
+
get(specId: string): SpecConfig | undefined;
|
|
296
|
+
has(specId: string): boolean;
|
|
297
|
+
getIds(): string[];
|
|
298
|
+
getAll(): Map<string, SpecConfig>;
|
|
299
|
+
get count(): number;
|
|
300
|
+
clear(): void;
|
|
301
|
+
addGroup(specId: string, group: SpecGroup): boolean;
|
|
302
|
+
removeGroup(specId: string, groupId: string): boolean;
|
|
303
|
+
getGroup(specId: string, groupId: string): SpecGroup | undefined;
|
|
304
|
+
addAssertion(specId: string, groupId: string | null, assertion: SpecAssertion): boolean;
|
|
305
|
+
removeAssertion(specId: string, groupId: string | null, assertionId: string): boolean;
|
|
306
|
+
toggleAssertion(specId: string, groupId: string | null, assertionId: string): boolean;
|
|
307
|
+
markReviewed(specId: string, groupId: string | null, assertionId: string): boolean;
|
|
308
|
+
getAllAssertions(): SpecAssertion[];
|
|
309
|
+
filterAssertions(opts: SpecFilterOptions): SpecAssertion[];
|
|
310
|
+
getCoverage(allElementIds: string[]): SpecCoverage;
|
|
311
|
+
importConfig(specId: string, config: SpecConfig): boolean;
|
|
312
|
+
exportConfig(specId: string): SpecConfig | undefined;
|
|
313
|
+
on(listener: SpecListener): () => void;
|
|
314
|
+
private emit;
|
|
315
|
+
private findAssertion;
|
|
316
|
+
}
|
|
317
|
+
declare function getGlobalSpecStore(): SpecStore;
|
|
318
|
+
declare function resetGlobalSpecStore(): void;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Spec Executor
|
|
322
|
+
*
|
|
323
|
+
* Converts SpecAssertions to AssertionRequests and delegates
|
|
324
|
+
* to the existing AssertionExecutor from ui-bridge/ai.
|
|
325
|
+
*/
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Resolve a SpecTarget to an AssertionRequest target.
|
|
329
|
+
*
|
|
330
|
+
* For elementId targets, returns a SearchCriteria with idPattern for exact
|
|
331
|
+
* ID matching rather than a raw string (which would be treated as a text search).
|
|
332
|
+
*/
|
|
333
|
+
declare function resolveTarget(target: SpecTarget): string | SearchCriteria;
|
|
334
|
+
declare class SpecExecutor {
|
|
335
|
+
private assertionExecutor;
|
|
336
|
+
constructor(config?: Partial<AssertionConfig>);
|
|
337
|
+
/**
|
|
338
|
+
* Update the element registry (pass-through to AssertionExecutor).
|
|
339
|
+
*/
|
|
340
|
+
updateElements(elements: Array<DiscoveredElement | AIDiscoveredElement>): void;
|
|
341
|
+
/**
|
|
342
|
+
* Convert a SpecAssertion to an AssertionRequest.
|
|
343
|
+
*/
|
|
344
|
+
toAssertionRequest(assertion: SpecAssertion): AssertionRequest;
|
|
345
|
+
/**
|
|
346
|
+
* Evaluate a condition to determine if an assertion should be executed.
|
|
347
|
+
* Returns true if the condition is met (assertion should run),
|
|
348
|
+
* false if condition is not met (assertion should skip/pass).
|
|
349
|
+
*/
|
|
350
|
+
private evaluateCondition;
|
|
351
|
+
/**
|
|
352
|
+
* Execute a single SpecAssertion.
|
|
353
|
+
*/
|
|
354
|
+
executeAssertion(assertion: SpecAssertion): Promise<SpecAssertionResult>;
|
|
355
|
+
/**
|
|
356
|
+
* Execute all assertions in a SpecGroup.
|
|
357
|
+
*/
|
|
358
|
+
executeGroup(group: SpecGroup, options?: SpecExecutionOptions): Promise<SpecGroupResult>;
|
|
359
|
+
/**
|
|
360
|
+
* Execute a full SpecConfig.
|
|
361
|
+
*/
|
|
362
|
+
execute(config: SpecConfig, options?: SpecExecutionOptions): Promise<SpecExecutionResult>;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
export { type AssertionCondition, AssertionType, type LegacyTestAssertion, type LegacyTestGeneratorOutput, type LegacyTestSpecification, type LegacyTestTarget, SPEC_CONFIG_VERSION, SPEC_FILE_EXTENSION, SearchCriteria, type SpecAssertion, type SpecAssertionResult, type SpecCategory, type SpecConfig, type SpecCoverage, type SpecEvent, type SpecEventType, type SpecExecutionOptions, type SpecExecutionResult, SpecExecutor, type SpecFilterOptions, type SpecGroup, type SpecGroupResult, type SpecListener, type SpecMetadata, type SpecSeverity, type SpecSource, SpecStore, type SpecTarget, VALID_ASSERTION_TYPES, VALID_SPEC_CATEGORIES, VALID_SPEC_SEVERITIES, VALID_SPEC_SOURCES, type ValidationError, type ValidationResult, coerceAssertionType, getGlobalSpecStore, isValidAssertionType, isValidSpecCategory, isValidSpecSeverity, isValidSpecSource, migrateFromTestGeneratorOutput, migrateLegacyAssertion, migrateLegacyTarget, resetGlobalSpecStore, resolveTarget, validateSpecAssertion, validateSpecConfig, validateSpecGroup };
|