@browserflow-ai/exploration 0.0.6
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/adapters/claude-cli.d.ts +57 -0
- package/dist/adapters/claude-cli.d.ts.map +1 -0
- package/dist/adapters/claude-cli.js +195 -0
- package/dist/adapters/claude-cli.js.map +1 -0
- package/dist/adapters/claude.d.ts +54 -0
- package/dist/adapters/claude.d.ts.map +1 -0
- package/dist/adapters/claude.js +160 -0
- package/dist/adapters/claude.js.map +1 -0
- package/dist/adapters/index.d.ts +6 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +4 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/types.d.ts +196 -0
- package/dist/adapters/types.d.ts.map +1 -0
- package/dist/adapters/types.js +3 -0
- package/dist/adapters/types.js.map +1 -0
- package/dist/agent-browser-session.d.ts +62 -0
- package/dist/agent-browser-session.d.ts.map +1 -0
- package/dist/agent-browser-session.js +272 -0
- package/dist/agent-browser-session.js.map +1 -0
- package/dist/evidence.d.ts +111 -0
- package/dist/evidence.d.ts.map +1 -0
- package/dist/evidence.js +144 -0
- package/dist/evidence.js.map +1 -0
- package/dist/explorer.d.ts +180 -0
- package/dist/explorer.d.ts.map +1 -0
- package/dist/explorer.js +393 -0
- package/dist/explorer.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/locator-candidates.d.ts +127 -0
- package/dist/locator-candidates.d.ts.map +1 -0
- package/dist/locator-candidates.js +358 -0
- package/dist/locator-candidates.js.map +1 -0
- package/dist/step-executor.d.ts +99 -0
- package/dist/step-executor.d.ts.map +1 -0
- package/dist/step-executor.js +646 -0
- package/dist/step-executor.js.map +1 -0
- package/package.json +34 -0
- package/src/adapters/claude-cli.test.ts +134 -0
- package/src/adapters/claude-cli.ts +240 -0
- package/src/adapters/claude.test.ts +195 -0
- package/src/adapters/claude.ts +190 -0
- package/src/adapters/index.ts +21 -0
- package/src/adapters/types.ts +207 -0
- package/src/agent-browser-session.test.ts +369 -0
- package/src/agent-browser-session.ts +349 -0
- package/src/evidence.test.ts +239 -0
- package/src/evidence.ts +203 -0
- package/src/explorer.test.ts +321 -0
- package/src/explorer.ts +565 -0
- package/src/index.ts +51 -0
- package/src/locator-candidates.test.ts +602 -0
- package/src/locator-candidates.ts +441 -0
- package/src/step-executor.test.ts +696 -0
- package/src/step-executor.ts +783 -0
|
@@ -0,0 +1,646 @@
|
|
|
1
|
+
// @browserflow-ai/exploration - Step executor
|
|
2
|
+
import { parseDuration } from '@browserflow-ai/core';
|
|
3
|
+
/**
|
|
4
|
+
* Parse a timeout/duration value that can be string or number
|
|
5
|
+
* Supports duration strings like "500ms", "5s", "1m" as well as plain numbers
|
|
6
|
+
*/
|
|
7
|
+
function parseTimeout(value, defaultValue) {
|
|
8
|
+
if (value === undefined)
|
|
9
|
+
return defaultValue;
|
|
10
|
+
try {
|
|
11
|
+
return parseDuration(value);
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return defaultValue;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* StepExecutor - Executes individual spec steps against a browser session
|
|
19
|
+
*
|
|
20
|
+
* Handles:
|
|
21
|
+
* - Navigation: navigate, back, forward, refresh
|
|
22
|
+
* - Interaction: click, fill, type, select, check, press
|
|
23
|
+
* - Waiting: wait for element, text, url, time
|
|
24
|
+
* - Assertions: verify_state with various checks
|
|
25
|
+
* - Capture: screenshot, scroll
|
|
26
|
+
*/
|
|
27
|
+
export class StepExecutor {
|
|
28
|
+
browser;
|
|
29
|
+
adapter;
|
|
30
|
+
baseUrl;
|
|
31
|
+
defaultTimeout;
|
|
32
|
+
screenshotDir;
|
|
33
|
+
captureBeforeScreenshots;
|
|
34
|
+
captureAfterScreenshots;
|
|
35
|
+
customActionHandlers;
|
|
36
|
+
constructor(config = {}) {
|
|
37
|
+
this.browser = config.browser;
|
|
38
|
+
this.adapter = config.adapter;
|
|
39
|
+
this.baseUrl = config.baseUrl ?? '';
|
|
40
|
+
this.defaultTimeout = config.defaultTimeout ?? 30000;
|
|
41
|
+
this.screenshotDir = config.screenshotDir ?? './screenshots';
|
|
42
|
+
this.captureBeforeScreenshots = config.captureBeforeScreenshots ?? false;
|
|
43
|
+
this.captureAfterScreenshots = config.captureAfterScreenshots ?? true;
|
|
44
|
+
this.customActionHandlers = config.customActionHandlers ?? {};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Configure the executor with browser and adapter (for lazy initialization)
|
|
48
|
+
*/
|
|
49
|
+
configure(config) {
|
|
50
|
+
if (config.browser)
|
|
51
|
+
this.browser = config.browser;
|
|
52
|
+
if (config.adapter)
|
|
53
|
+
this.adapter = config.adapter;
|
|
54
|
+
if (config.baseUrl)
|
|
55
|
+
this.baseUrl = config.baseUrl;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Check if executor is properly configured
|
|
59
|
+
*/
|
|
60
|
+
isConfigured() {
|
|
61
|
+
return !!this.browser && !!this.adapter;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Execute a single step
|
|
65
|
+
*
|
|
66
|
+
* @param step - The step definition from the spec
|
|
67
|
+
* @param stepIndex - Index of this step in the spec
|
|
68
|
+
* @returns Promise resolving to step result
|
|
69
|
+
*/
|
|
70
|
+
async execute(step, stepIndex = 0) {
|
|
71
|
+
const startTime = Date.now();
|
|
72
|
+
const screenshotPrefix = `step-${String(stepIndex).padStart(2, '0')}`;
|
|
73
|
+
let beforeScreenshot;
|
|
74
|
+
let afterScreenshot;
|
|
75
|
+
// Check if executor is configured
|
|
76
|
+
if (!this.browser || !this.adapter) {
|
|
77
|
+
return {
|
|
78
|
+
stepIndex,
|
|
79
|
+
specAction: step,
|
|
80
|
+
execution: {
|
|
81
|
+
status: 'failed',
|
|
82
|
+
method: step.action,
|
|
83
|
+
durationMs: Date.now() - startTime,
|
|
84
|
+
error: 'StepExecutor not configured - browser and adapter required',
|
|
85
|
+
},
|
|
86
|
+
screenshots: {
|
|
87
|
+
before: `${this.screenshotDir}/${screenshotPrefix}-before.png`,
|
|
88
|
+
after: `${this.screenshotDir}/${screenshotPrefix}-after.png`,
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
try {
|
|
93
|
+
// Capture before screenshot if configured
|
|
94
|
+
if (this.captureBeforeScreenshots) {
|
|
95
|
+
beforeScreenshot = await this.captureScreenshot(`${screenshotPrefix}-before`);
|
|
96
|
+
}
|
|
97
|
+
// Execute the action
|
|
98
|
+
const execution = await this.executeAction(step);
|
|
99
|
+
// Capture after screenshot (always for screenshot action, or if configured)
|
|
100
|
+
if (step.action === 'screenshot') {
|
|
101
|
+
const name = step.name || screenshotPrefix;
|
|
102
|
+
afterScreenshot = await this.captureScreenshot(name);
|
|
103
|
+
}
|
|
104
|
+
else if (this.captureAfterScreenshots) {
|
|
105
|
+
afterScreenshot = await this.captureScreenshot(`${screenshotPrefix}-after`);
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
stepIndex,
|
|
109
|
+
specAction: step,
|
|
110
|
+
execution: {
|
|
111
|
+
...execution,
|
|
112
|
+
durationMs: Date.now() - startTime,
|
|
113
|
+
},
|
|
114
|
+
screenshots: {
|
|
115
|
+
before: beforeScreenshot ?? `${this.screenshotDir}/${screenshotPrefix}-before.png`,
|
|
116
|
+
after: afterScreenshot ?? `${this.screenshotDir}/${screenshotPrefix}-after.png`,
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
122
|
+
return {
|
|
123
|
+
stepIndex,
|
|
124
|
+
specAction: step,
|
|
125
|
+
execution: {
|
|
126
|
+
status: 'failed',
|
|
127
|
+
method: step.action,
|
|
128
|
+
durationMs: Date.now() - startTime,
|
|
129
|
+
error: errorMessage,
|
|
130
|
+
},
|
|
131
|
+
screenshots: {
|
|
132
|
+
before: beforeScreenshot ?? `${this.screenshotDir}/${screenshotPrefix}-before.png`,
|
|
133
|
+
after: `${this.screenshotDir}/${screenshotPrefix}-after.png`,
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Execute a single action based on step type
|
|
140
|
+
*/
|
|
141
|
+
async executeAction(step) {
|
|
142
|
+
switch (step.action) {
|
|
143
|
+
// Navigation actions
|
|
144
|
+
case 'navigate':
|
|
145
|
+
return this.executeNavigate(step);
|
|
146
|
+
case 'back':
|
|
147
|
+
return this.executeBack();
|
|
148
|
+
case 'forward':
|
|
149
|
+
return this.executeForward();
|
|
150
|
+
case 'reload': // Alias for refresh
|
|
151
|
+
case 'refresh':
|
|
152
|
+
return this.executeRefresh();
|
|
153
|
+
// Interaction actions
|
|
154
|
+
case 'click':
|
|
155
|
+
return this.executeClick(step);
|
|
156
|
+
case 'fill':
|
|
157
|
+
return this.executeFill(step);
|
|
158
|
+
case 'type':
|
|
159
|
+
return this.executeType(step);
|
|
160
|
+
case 'select':
|
|
161
|
+
return this.executeSelect(step);
|
|
162
|
+
case 'check':
|
|
163
|
+
return this.executeCheck(step);
|
|
164
|
+
case 'press':
|
|
165
|
+
return this.executePress(step);
|
|
166
|
+
// Wait actions
|
|
167
|
+
case 'wait':
|
|
168
|
+
return this.executeWait(step);
|
|
169
|
+
// Verification actions
|
|
170
|
+
case 'verify_state':
|
|
171
|
+
return this.executeVerifyState(step);
|
|
172
|
+
// Capture actions
|
|
173
|
+
case 'screenshot':
|
|
174
|
+
return this.executeScreenshot(step);
|
|
175
|
+
case 'scroll':
|
|
176
|
+
return this.executeScroll(step);
|
|
177
|
+
case 'scroll_into_view':
|
|
178
|
+
return this.executeScrollIntoView(step);
|
|
179
|
+
// AI-powered actions
|
|
180
|
+
case 'identify_element':
|
|
181
|
+
return this.executeIdentifyElement(step);
|
|
182
|
+
case 'ai_verify':
|
|
183
|
+
return this.executeAIVerify(step);
|
|
184
|
+
// Custom actions
|
|
185
|
+
case 'custom':
|
|
186
|
+
return this.executeCustom(step);
|
|
187
|
+
default:
|
|
188
|
+
return {
|
|
189
|
+
status: 'failed',
|
|
190
|
+
method: step.action,
|
|
191
|
+
durationMs: 0,
|
|
192
|
+
error: `Unknown action type: ${step.action}`,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
// ============ Navigation Actions ============
|
|
197
|
+
async executeNavigate(step) {
|
|
198
|
+
// Support both url (canonical) and to (legacy)
|
|
199
|
+
const targetUrl = step.url ?? step.to;
|
|
200
|
+
if (!targetUrl) {
|
|
201
|
+
return {
|
|
202
|
+
status: 'failed',
|
|
203
|
+
method: 'navigate',
|
|
204
|
+
durationMs: 0,
|
|
205
|
+
error: 'Navigate action requires "url" field',
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
const url = targetUrl.startsWith('http') ? targetUrl : `${this.baseUrl}${targetUrl}`;
|
|
209
|
+
await this.browser.navigate(url);
|
|
210
|
+
return {
|
|
211
|
+
status: 'completed',
|
|
212
|
+
method: 'navigate',
|
|
213
|
+
durationMs: 0,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
async executeBack() {
|
|
217
|
+
if (this.browser.back) {
|
|
218
|
+
await this.browser.back();
|
|
219
|
+
}
|
|
220
|
+
return {
|
|
221
|
+
status: 'completed',
|
|
222
|
+
method: 'back',
|
|
223
|
+
durationMs: 0,
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
async executeForward() {
|
|
227
|
+
if (this.browser.forward) {
|
|
228
|
+
await this.browser.forward();
|
|
229
|
+
}
|
|
230
|
+
return {
|
|
231
|
+
status: 'completed',
|
|
232
|
+
method: 'forward',
|
|
233
|
+
durationMs: 0,
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
async executeRefresh() {
|
|
237
|
+
if (this.browser.refresh) {
|
|
238
|
+
await this.browser.refresh();
|
|
239
|
+
}
|
|
240
|
+
return {
|
|
241
|
+
status: 'completed',
|
|
242
|
+
method: 'refresh',
|
|
243
|
+
durationMs: 0,
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
// ============ Interaction Actions ============
|
|
247
|
+
async executeClick(step) {
|
|
248
|
+
const target = await this.resolveTarget(step);
|
|
249
|
+
if (!target) {
|
|
250
|
+
return {
|
|
251
|
+
status: 'failed',
|
|
252
|
+
method: 'click',
|
|
253
|
+
durationMs: 0,
|
|
254
|
+
error: 'Click action requires ref, selector, or query',
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
if (this.browser.click) {
|
|
258
|
+
await this.browser.click(target.ref);
|
|
259
|
+
}
|
|
260
|
+
return {
|
|
261
|
+
status: 'completed',
|
|
262
|
+
method: 'click',
|
|
263
|
+
elementRef: target.ref,
|
|
264
|
+
selectorUsed: target.selector,
|
|
265
|
+
durationMs: 0,
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
async executeFill(step) {
|
|
269
|
+
const target = await this.resolveTarget(step);
|
|
270
|
+
if (!target) {
|
|
271
|
+
return {
|
|
272
|
+
status: 'failed',
|
|
273
|
+
method: 'fill',
|
|
274
|
+
durationMs: 0,
|
|
275
|
+
error: 'Fill action requires ref, selector, or query',
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
const value = step.value ?? '';
|
|
279
|
+
if (this.browser.fill) {
|
|
280
|
+
await this.browser.fill(target.ref, value);
|
|
281
|
+
}
|
|
282
|
+
return {
|
|
283
|
+
status: 'completed',
|
|
284
|
+
method: 'fill',
|
|
285
|
+
elementRef: target.ref,
|
|
286
|
+
selectorUsed: target.selector,
|
|
287
|
+
durationMs: 0,
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
async executeType(step) {
|
|
291
|
+
const target = await this.resolveTarget(step);
|
|
292
|
+
if (!target) {
|
|
293
|
+
return {
|
|
294
|
+
status: 'failed',
|
|
295
|
+
method: 'type',
|
|
296
|
+
durationMs: 0,
|
|
297
|
+
error: 'Type action requires ref, selector, or query',
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
const text = step.value ?? '';
|
|
301
|
+
if (this.browser.type) {
|
|
302
|
+
await this.browser.type(target.ref, text);
|
|
303
|
+
}
|
|
304
|
+
return {
|
|
305
|
+
status: 'completed',
|
|
306
|
+
method: 'type',
|
|
307
|
+
elementRef: target.ref,
|
|
308
|
+
selectorUsed: target.selector,
|
|
309
|
+
durationMs: 0,
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
async executeSelect(step) {
|
|
313
|
+
const target = await this.resolveTarget(step);
|
|
314
|
+
if (!target) {
|
|
315
|
+
return {
|
|
316
|
+
status: 'failed',
|
|
317
|
+
method: 'select',
|
|
318
|
+
durationMs: 0,
|
|
319
|
+
error: 'Select action requires ref, selector, or query',
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
const option = step.option ?? '';
|
|
323
|
+
if (this.browser.select) {
|
|
324
|
+
await this.browser.select(target.ref, option);
|
|
325
|
+
}
|
|
326
|
+
return {
|
|
327
|
+
status: 'completed',
|
|
328
|
+
method: 'select',
|
|
329
|
+
elementRef: target.ref,
|
|
330
|
+
selectorUsed: target.selector,
|
|
331
|
+
durationMs: 0,
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
async executeCheck(step) {
|
|
335
|
+
const target = await this.resolveTarget(step);
|
|
336
|
+
if (!target) {
|
|
337
|
+
return {
|
|
338
|
+
status: 'failed',
|
|
339
|
+
method: 'check',
|
|
340
|
+
durationMs: 0,
|
|
341
|
+
error: 'Check action requires ref, selector, or query',
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
const checked = step.checked !== false; // Default to true
|
|
345
|
+
if (this.browser.check) {
|
|
346
|
+
await this.browser.check(target.ref, checked);
|
|
347
|
+
}
|
|
348
|
+
return {
|
|
349
|
+
status: 'completed',
|
|
350
|
+
method: 'check',
|
|
351
|
+
elementRef: target.ref,
|
|
352
|
+
selectorUsed: target.selector,
|
|
353
|
+
durationMs: 0,
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
async executePress(step) {
|
|
357
|
+
const key = step.value ?? '';
|
|
358
|
+
if (!key) {
|
|
359
|
+
return {
|
|
360
|
+
status: 'failed',
|
|
361
|
+
method: 'press',
|
|
362
|
+
durationMs: 0,
|
|
363
|
+
error: 'Press action requires "value" field with key name',
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
if (this.browser.press) {
|
|
367
|
+
await this.browser.press(key);
|
|
368
|
+
}
|
|
369
|
+
return {
|
|
370
|
+
status: 'completed',
|
|
371
|
+
method: 'press',
|
|
372
|
+
durationMs: 0,
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
// ============ Wait Actions ============
|
|
376
|
+
async executeWait(step) {
|
|
377
|
+
const waitFor = step.for;
|
|
378
|
+
const timeout = parseTimeout(step.timeout, this.defaultTimeout);
|
|
379
|
+
switch (waitFor) {
|
|
380
|
+
case 'element':
|
|
381
|
+
if (step.selector && this.browser.waitForSelector) {
|
|
382
|
+
await this.browser.waitForSelector(step.selector, timeout);
|
|
383
|
+
}
|
|
384
|
+
break;
|
|
385
|
+
case 'url':
|
|
386
|
+
if (step.contains && this.browser.waitForURL) {
|
|
387
|
+
await this.browser.waitForURL(step.contains, timeout);
|
|
388
|
+
}
|
|
389
|
+
break;
|
|
390
|
+
case 'text':
|
|
391
|
+
if (step.text && this.browser.waitForText) {
|
|
392
|
+
await this.browser.waitForText(step.text, timeout);
|
|
393
|
+
}
|
|
394
|
+
break;
|
|
395
|
+
case 'time':
|
|
396
|
+
if (step.duration && this.browser.waitForTimeout) {
|
|
397
|
+
await this.browser.waitForTimeout(parseTimeout(step.duration, 1000));
|
|
398
|
+
}
|
|
399
|
+
break;
|
|
400
|
+
case 'load_state':
|
|
401
|
+
if (this.browser.waitForLoadState) {
|
|
402
|
+
await this.browser.waitForLoadState('load');
|
|
403
|
+
}
|
|
404
|
+
break;
|
|
405
|
+
default:
|
|
406
|
+
// No specific wait type - just mark as completed
|
|
407
|
+
break;
|
|
408
|
+
}
|
|
409
|
+
return {
|
|
410
|
+
status: 'completed',
|
|
411
|
+
method: 'wait',
|
|
412
|
+
durationMs: 0,
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
// ============ Verification Actions ============
|
|
416
|
+
async executeVerifyState(step) {
|
|
417
|
+
const checks = (step.checks || []);
|
|
418
|
+
const snapshot = await this.browser.getSnapshot({ interactive: true });
|
|
419
|
+
const currentURL = this.browser.getCurrentURL?.() ?? '';
|
|
420
|
+
for (const check of checks) {
|
|
421
|
+
// Check element_visible
|
|
422
|
+
if (check.element_visible) {
|
|
423
|
+
const found = this.findElementInSnapshot(check.element_visible, snapshot);
|
|
424
|
+
if (!found) {
|
|
425
|
+
return {
|
|
426
|
+
status: 'failed',
|
|
427
|
+
method: 'verify_state',
|
|
428
|
+
durationMs: 0,
|
|
429
|
+
error: `Element not visible: ${check.element_visible}`,
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
// Check element_not_visible
|
|
434
|
+
if (check.element_not_visible) {
|
|
435
|
+
const found = this.findElementInSnapshot(check.element_not_visible, snapshot);
|
|
436
|
+
if (found) {
|
|
437
|
+
return {
|
|
438
|
+
status: 'failed',
|
|
439
|
+
method: 'verify_state',
|
|
440
|
+
durationMs: 0,
|
|
441
|
+
error: `Element should not be visible: ${check.element_not_visible}`,
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
// Check url_contains
|
|
446
|
+
if (check.url_contains) {
|
|
447
|
+
if (!currentURL.includes(check.url_contains)) {
|
|
448
|
+
return {
|
|
449
|
+
status: 'failed',
|
|
450
|
+
method: 'verify_state',
|
|
451
|
+
durationMs: 0,
|
|
452
|
+
error: `URL does not contain: ${check.url_contains}`,
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
// Check text_contains
|
|
457
|
+
if (check.text_contains) {
|
|
458
|
+
if (!snapshot.tree.includes(check.text_contains)) {
|
|
459
|
+
return {
|
|
460
|
+
status: 'failed',
|
|
461
|
+
method: 'verify_state',
|
|
462
|
+
durationMs: 0,
|
|
463
|
+
error: `Text not found: ${check.text_contains}`,
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
// Check text_not_contains
|
|
468
|
+
if (check.text_not_contains) {
|
|
469
|
+
if (snapshot.tree.includes(check.text_not_contains)) {
|
|
470
|
+
return {
|
|
471
|
+
status: 'failed',
|
|
472
|
+
method: 'verify_state',
|
|
473
|
+
durationMs: 0,
|
|
474
|
+
error: `Text should not be present: ${check.text_not_contains}`,
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
return {
|
|
480
|
+
status: 'completed',
|
|
481
|
+
method: 'verify_state',
|
|
482
|
+
durationMs: 0,
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
// ============ Capture Actions ============
|
|
486
|
+
async executeScreenshot(step) {
|
|
487
|
+
// Screenshot is captured in the main execute method
|
|
488
|
+
return {
|
|
489
|
+
status: 'completed',
|
|
490
|
+
method: 'screenshot',
|
|
491
|
+
durationMs: 0,
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
async executeScroll(step) {
|
|
495
|
+
const x = step.scrollX ?? 0;
|
|
496
|
+
const y = step.scrollY ?? 0;
|
|
497
|
+
if (this.browser.scroll) {
|
|
498
|
+
await this.browser.scroll(x, y);
|
|
499
|
+
}
|
|
500
|
+
return {
|
|
501
|
+
status: 'completed',
|
|
502
|
+
method: 'scroll',
|
|
503
|
+
durationMs: 0,
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
async executeScrollIntoView(step) {
|
|
507
|
+
const target = await this.resolveTarget(step);
|
|
508
|
+
if (!target) {
|
|
509
|
+
return {
|
|
510
|
+
status: 'failed',
|
|
511
|
+
method: 'scroll_into_view',
|
|
512
|
+
durationMs: 0,
|
|
513
|
+
error: 'scroll_into_view action requires ref, selector, or query',
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
if (this.browser.scrollIntoView) {
|
|
517
|
+
await this.browser.scrollIntoView(target.ref);
|
|
518
|
+
}
|
|
519
|
+
return {
|
|
520
|
+
status: 'completed',
|
|
521
|
+
method: 'scroll_into_view',
|
|
522
|
+
elementRef: target.ref,
|
|
523
|
+
durationMs: 0,
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
// ============ AI-Powered Actions ============
|
|
527
|
+
async executeIdentifyElement(step) {
|
|
528
|
+
if (!step.query) {
|
|
529
|
+
return {
|
|
530
|
+
status: 'failed',
|
|
531
|
+
method: 'identify_element',
|
|
532
|
+
durationMs: 0,
|
|
533
|
+
error: 'identify_element action requires "query" field',
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
const snapshot = await this.browser.getSnapshot({ interactive: true });
|
|
537
|
+
const result = await this.adapter.findElement(step.query, snapshot);
|
|
538
|
+
if (result.ref === 'NOT_FOUND') {
|
|
539
|
+
return {
|
|
540
|
+
status: 'failed',
|
|
541
|
+
method: 'identify_element',
|
|
542
|
+
durationMs: 0,
|
|
543
|
+
error: `Element not found for query: ${step.query}`,
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
return {
|
|
547
|
+
status: 'completed',
|
|
548
|
+
method: 'identify_element',
|
|
549
|
+
elementRef: result.ref,
|
|
550
|
+
durationMs: 0,
|
|
551
|
+
};
|
|
552
|
+
}
|
|
553
|
+
async executeAIVerify(step) {
|
|
554
|
+
// AI verification is more complex - for now just mark as completed
|
|
555
|
+
// Full implementation would use adapter to verify visual/semantic state
|
|
556
|
+
return {
|
|
557
|
+
status: 'completed',
|
|
558
|
+
method: 'ai_verify',
|
|
559
|
+
durationMs: 0,
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
// ============ Custom Actions ============
|
|
563
|
+
async executeCustom(step) {
|
|
564
|
+
const handlerName = step.name;
|
|
565
|
+
if (!handlerName || !this.customActionHandlers[handlerName]) {
|
|
566
|
+
return {
|
|
567
|
+
status: 'failed',
|
|
568
|
+
method: 'custom',
|
|
569
|
+
durationMs: 0,
|
|
570
|
+
error: `Custom action handler not found: ${handlerName}`,
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
return this.customActionHandlers[handlerName](step, this.browser);
|
|
574
|
+
}
|
|
575
|
+
// ============ Helper Methods ============
|
|
576
|
+
/**
|
|
577
|
+
* Resolve target to element ref
|
|
578
|
+
*/
|
|
579
|
+
async resolveTarget(step) {
|
|
580
|
+
// If step has a direct ref, use it
|
|
581
|
+
if (step.ref) {
|
|
582
|
+
return { ref: step.ref };
|
|
583
|
+
}
|
|
584
|
+
// If step has a selector, use it as ref
|
|
585
|
+
if (step.selector) {
|
|
586
|
+
return { ref: step.selector, selector: step.selector };
|
|
587
|
+
}
|
|
588
|
+
// Use AI adapter to find element from query
|
|
589
|
+
if (step.query) {
|
|
590
|
+
const snapshot = await this.browser.getSnapshot({ interactive: true });
|
|
591
|
+
const result = await this.adapter.findElement(step.query, snapshot);
|
|
592
|
+
if (result.ref === 'NOT_FOUND') {
|
|
593
|
+
throw new Error(`Element not found for query: ${step.query}`);
|
|
594
|
+
}
|
|
595
|
+
return { ref: result.ref };
|
|
596
|
+
}
|
|
597
|
+
return null;
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* Find element in snapshot by selector/query
|
|
601
|
+
*/
|
|
602
|
+
findElementInSnapshot(selector, snapshot) {
|
|
603
|
+
// Check if element exists in tree or refs
|
|
604
|
+
if (snapshot.tree.includes(selector)) {
|
|
605
|
+
return true;
|
|
606
|
+
}
|
|
607
|
+
// Check refs for matching tag or attribute
|
|
608
|
+
for (const ref of Object.values(snapshot.refs)) {
|
|
609
|
+
const element = ref;
|
|
610
|
+
if (element.tag === selector ||
|
|
611
|
+
element.text?.toString().includes(selector) ||
|
|
612
|
+
element.className?.toString().includes(selector) ||
|
|
613
|
+
element.id === selector) {
|
|
614
|
+
return true;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
return false;
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* Capture a screenshot
|
|
621
|
+
*/
|
|
622
|
+
async captureScreenshot(name) {
|
|
623
|
+
const { promises: fs } = await import('fs');
|
|
624
|
+
const path = await import('path');
|
|
625
|
+
const filepath = path.join(this.screenshotDir, `${name}.png`);
|
|
626
|
+
// Ensure directory exists
|
|
627
|
+
await fs.mkdir(path.dirname(filepath), { recursive: true });
|
|
628
|
+
// Capture and write screenshot
|
|
629
|
+
const buffer = await this.browser.screenshot();
|
|
630
|
+
await fs.writeFile(filepath, buffer);
|
|
631
|
+
return filepath;
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* Get the default timeout value
|
|
635
|
+
*/
|
|
636
|
+
getDefaultTimeout() {
|
|
637
|
+
return this.defaultTimeout;
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* Get the screenshot directory
|
|
641
|
+
*/
|
|
642
|
+
getScreenshotDir() {
|
|
643
|
+
return this.screenshotDir;
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
//# sourceMappingURL=step-executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-executor.js","sourceRoot":"","sources":["../src/step-executor.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAWrD;;;GAGG;AACH,SAAS,YAAY,CAAC,KAAkC,EAAE,YAAoB;IAC5E,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,YAAY,CAAC;IAC7C,IAAI,CAAC;QACH,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,YAAY,CAAC;IACtB,CAAC;AACH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