spana-test 0.5.0 → 0.7.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/.agents/skills/spana-testing/SKILL.md +126 -246
- package/README.md +2 -2
- package/dist/agent/index.d.ts +2 -2
- package/dist/agent/index.js +5 -5
- package/dist/{storybook-CxaP3YDz.d.ts → app-D_UyZBsl.d.ts} +213 -10
- package/dist/{chunk-WSA5QPTA.js → chunk-2IXXEXTL.js} +2 -2
- package/dist/{chunk-3YE2POGD.js → chunk-3SH5JQF7.js} +143 -3
- package/dist/chunk-3SH5JQF7.js.map +1 -0
- package/dist/chunk-54ASKII6.js +183 -0
- package/dist/chunk-54ASKII6.js.map +1 -0
- package/dist/{chunk-LRGT342X.js → chunk-6B5Y75V4.js} +1633 -533
- package/dist/chunk-6B5Y75V4.js.map +1 -0
- package/dist/{chunk-SQL3YRR5.js → chunk-JYFPZRCN.js} +21 -3
- package/dist/chunk-JYFPZRCN.js.map +1 -0
- package/dist/{chunk-UJQ7PID5.js → chunk-KNSAHEXI.js} +78 -3
- package/dist/chunk-KNSAHEXI.js.map +1 -0
- package/dist/{chunk-3TRMQCUT.js → chunk-PLE7RFQE.js} +31 -2
- package/dist/chunk-PLE7RFQE.js.map +1 -0
- package/dist/{chunk-H3RWZCID.js → chunk-RURZVMZ7.js} +104 -3
- package/dist/chunk-RURZVMZ7.js.map +1 -0
- package/dist/{chunk-XENRC3YO.js → chunk-T3EBOYLS.js} +751 -59
- package/dist/chunk-T3EBOYLS.js.map +1 -0
- package/dist/{chunk-PJKIXVSO.js → chunk-T5CROOR7.js} +898 -238
- package/dist/chunk-T5CROOR7.js.map +1 -0
- package/dist/{chunk-5245YBLL.js → chunk-Y2RZNOKU.js} +2 -2
- package/dist/cli.js +11 -11
- package/dist/cli.js.map +1 -1
- package/dist/config-loader-NIDQGP3K.js +9 -0
- package/dist/{doctor-command-WB3O2H64.js → doctor-command-WPEVZEZ4.js} +3 -3
- package/dist/{filters-Q3ALKWZ5.js → filters-MQG2RMPX.js} +4 -2
- package/dist/flow-g6AICPAl.d.ts +95 -0
- package/dist/gherkin/steps.d.ts +2 -2
- package/dist/{html-F3X3XPSX.js → html-IKCTZH2U.js} +194 -3
- package/dist/html-IKCTZH2U.js.map +1 -0
- package/dist/index.d.ts +436 -21
- package/dist/index.js +328 -7
- package/dist/index.js.map +1 -1
- package/dist/{runner-6HK62Q7B.js → runner-TF4OKPYP.js} +2 -2
- package/dist/{screenshot-compare-3QRHHSFZ.js → screenshot-compare-POTXVUTL.js} +21 -1
- package/dist/screenshot-compare-POTXVUTL.js.map +1 -0
- package/dist/{server-PRM7BVVD.js → server-EBPYK3VE.js} +5 -5
- package/dist/{server-QWJJB3WG.js → server-IGLBFEU7.js} +2 -2
- package/dist/{session-2E6OK6BH.js → session-QRWH3SPW.js} +4 -4
- package/dist/{session-Ddem-Q5n.d.ts → session-cJ_tZjCL.d.ts} +22 -1
- package/dist/{studio-command-O3NN5BCG.js → studio-command-FLA5HKRK.js} +2 -2
- package/dist/{test-command-FYOZ6QAE.js → test-command-P5W7UD52.js} +24 -10
- package/dist/test-command-P5W7UD52.js.map +1 -0
- package/dist/{validator-HZ2A3NEI.js → validator-BLOLIHUY.js} +3 -3
- package/package.json +3 -2
- package/dist/chunk-3TRMQCUT.js.map +0 -1
- package/dist/chunk-3YE2POGD.js.map +0 -1
- package/dist/chunk-H3RWZCID.js.map +0 -1
- package/dist/chunk-LRGT342X.js.map +0 -1
- package/dist/chunk-PJKIXVSO.js.map +0 -1
- package/dist/chunk-SQL3YRR5.js.map +0 -1
- package/dist/chunk-UJQ7PID5.js.map +0 -1
- package/dist/chunk-XENRC3YO.js.map +0 -1
- package/dist/config-loader-XGDDJGVY.js +0 -9
- package/dist/flow-CyRC-tTc.d.ts +0 -176
- package/dist/html-F3X3XPSX.js.map +0 -1
- package/dist/screenshot-compare-3QRHHSFZ.js.map +0 -1
- package/dist/test-command-FYOZ6QAE.js.map +0 -1
- /package/dist/{chunk-WSA5QPTA.js.map → chunk-2IXXEXTL.js.map} +0 -0
- /package/dist/{chunk-5245YBLL.js.map → chunk-Y2RZNOKU.js.map} +0 -0
- /package/dist/{config-loader-XGDDJGVY.js.map → config-loader-NIDQGP3K.js.map} +0 -0
- /package/dist/{doctor-command-WB3O2H64.js.map → doctor-command-WPEVZEZ4.js.map} +0 -0
- /package/dist/{filters-Q3ALKWZ5.js.map → filters-MQG2RMPX.js.map} +0 -0
- /package/dist/{runner-6HK62Q7B.js.map → runner-TF4OKPYP.js.map} +0 -0
- /package/dist/{server-PRM7BVVD.js.map → server-EBPYK3VE.js.map} +0 -0
- /package/dist/{server-QWJJB3WG.js.map → server-IGLBFEU7.js.map} +0 -0
- /package/dist/{session-2E6OK6BH.js.map → session-QRWH3SPW.js.map} +0 -0
- /package/dist/{studio-command-O3NN5BCG.js.map → studio-command-FLA5HKRK.js.map} +0 -0
- /package/dist/{validator-HZ2A3NEI.js.map → validator-BLOLIHUY.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
|
+
buildPlaybackTraceFromSteps,
|
|
3
|
+
exportFramesToMp4,
|
|
4
|
+
launchDirectCdpBrowser,
|
|
2
5
|
makeLightweightCdpDriver,
|
|
3
6
|
orderFlowsLongestFirst,
|
|
4
|
-
|
|
5
|
-
|
|
7
|
+
resolveWebEngine,
|
|
8
|
+
speculativelyPrelaunchWebBrowser,
|
|
9
|
+
startAndroidVideoRecorder,
|
|
10
|
+
startCdpScreencastRecorder,
|
|
11
|
+
startIosSimulatorVideoRecorder
|
|
12
|
+
} from "./chunk-6B5Y75V4.js";
|
|
6
13
|
import {
|
|
7
14
|
SPANA_MCP_TOOLS,
|
|
8
15
|
SpanaMcpServer,
|
|
9
16
|
buildFlowFileFromLines,
|
|
10
17
|
formatSelectorCode
|
|
11
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-RURZVMZ7.js";
|
|
12
19
|
import {
|
|
13
20
|
defineConfig
|
|
14
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-JYFPZRCN.js";
|
|
15
22
|
import "./chunk-X2TJP7LB.js";
|
|
16
23
|
import {
|
|
17
24
|
createGitHubPrReporter,
|
|
@@ -24,12 +31,14 @@ import {
|
|
|
24
31
|
createLogprobDecisionJudge,
|
|
25
32
|
createOllamaDecisionJudge,
|
|
26
33
|
decisionFilter,
|
|
34
|
+
deterministicImpactFilter,
|
|
27
35
|
formatFilterSummary,
|
|
28
36
|
pathRuleFilter,
|
|
29
37
|
probabilityFromTopLogprobs
|
|
30
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-3SH5JQF7.js";
|
|
31
39
|
import {
|
|
32
40
|
connectPlaywrightOverCDP,
|
|
41
|
+
connectPlaywrightOverWS,
|
|
33
42
|
domRectToScreenBounds,
|
|
34
43
|
ensureWarmBrowserDaemon,
|
|
35
44
|
findWebViewFrame,
|
|
@@ -41,7 +50,7 @@ import {
|
|
|
41
50
|
makeElectronDriver,
|
|
42
51
|
resolveElementAcrossChannels,
|
|
43
52
|
systemUI
|
|
44
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-T5CROOR7.js";
|
|
45
54
|
import {
|
|
46
55
|
AndroidWebViewCdpChannel,
|
|
47
56
|
AppleWebInspectorClient,
|
|
@@ -49,6 +58,9 @@ import {
|
|
|
49
58
|
SpanaBridgeChannel,
|
|
50
59
|
TARGET_CHANNEL_MATRIX,
|
|
51
60
|
WebKitInspectorChannel,
|
|
61
|
+
buildDomFillScript,
|
|
62
|
+
buildDomWaitForHiddenScript,
|
|
63
|
+
buildDomWaitForMatchScript,
|
|
52
64
|
buildDomWaitForSelectorScript,
|
|
53
65
|
createAndroidWebViewCdpChannel,
|
|
54
66
|
createCdpDomChannel,
|
|
@@ -65,7 +77,7 @@ import {
|
|
|
65
77
|
resolveElectrobunEngine,
|
|
66
78
|
resolveElectrobunLaunchPlan,
|
|
67
79
|
resolveTargetDescriptor
|
|
68
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-T3EBOYLS.js";
|
|
69
81
|
import "./chunk-HYSTRWYN.js";
|
|
70
82
|
import {
|
|
71
83
|
getHealthyWarmDaemon,
|
|
@@ -76,6 +88,12 @@ import {
|
|
|
76
88
|
} from "./chunk-DTNK54C2.js";
|
|
77
89
|
import "./chunk-S5JNNDXS.js";
|
|
78
90
|
import "./chunk-OBCFACUW.js";
|
|
91
|
+
import {
|
|
92
|
+
comparePngNative,
|
|
93
|
+
getNativeAcceleratorPath,
|
|
94
|
+
isNativeAcceleratorActive,
|
|
95
|
+
tokenizeXmlNative
|
|
96
|
+
} from "./chunk-54ASKII6.js";
|
|
79
97
|
import "./chunk-H27IBIGA.js";
|
|
80
98
|
import "./chunk-DGUM43GV.js";
|
|
81
99
|
|
|
@@ -333,6 +351,147 @@ function createFlowWithFixtures(options) {
|
|
|
333
351
|
}
|
|
334
352
|
return extendedFlow;
|
|
335
353
|
}
|
|
354
|
+
function createApiClient(options) {
|
|
355
|
+
const baseUrl = options.baseUrl.replace(/\/+$/, "");
|
|
356
|
+
const defaultHeaders = options.headers ?? {};
|
|
357
|
+
const fetchFn = options.fetchFn ?? fetch;
|
|
358
|
+
const cleanups = [];
|
|
359
|
+
const request = async (method, path, body, opts) => {
|
|
360
|
+
const cleanPath = path.startsWith("http://") || path.startsWith("https://") ? path : `${baseUrl}/${path.replace(/^\/+/, "")}`;
|
|
361
|
+
const url = new URL(cleanPath);
|
|
362
|
+
if (opts?.query) {
|
|
363
|
+
for (const [k, v] of Object.entries(opts.query)) {
|
|
364
|
+
if (v !== void 0) url.searchParams.set(k, String(v));
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
const headers = {
|
|
368
|
+
...defaultHeaders,
|
|
369
|
+
...body !== void 0 ? { "content-type": "application/json" } : {},
|
|
370
|
+
...opts?.headers
|
|
371
|
+
};
|
|
372
|
+
const res = await fetchFn(url.toString(), {
|
|
373
|
+
method,
|
|
374
|
+
headers,
|
|
375
|
+
...body !== void 0 ? { body: typeof body === "string" ? body : JSON.stringify(body) } : {},
|
|
376
|
+
...opts?.signal ? { signal: opts.signal } : {}
|
|
377
|
+
});
|
|
378
|
+
const contentType = res.headers.get("content-type") ?? "";
|
|
379
|
+
let data;
|
|
380
|
+
if (contentType.includes("application/json")) {
|
|
381
|
+
data = await res.json().catch(() => null);
|
|
382
|
+
} else {
|
|
383
|
+
const text = await res.text().catch(() => "");
|
|
384
|
+
try {
|
|
385
|
+
data = text ? JSON.parse(text) : text;
|
|
386
|
+
} catch {
|
|
387
|
+
data = text;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
return {
|
|
391
|
+
status: res.status,
|
|
392
|
+
ok: res.ok,
|
|
393
|
+
headers: res.headers,
|
|
394
|
+
data
|
|
395
|
+
};
|
|
396
|
+
};
|
|
397
|
+
return {
|
|
398
|
+
get: (path, opts) => request("GET", path, void 0, opts),
|
|
399
|
+
post: (path, body, opts) => request("POST", path, body, opts),
|
|
400
|
+
put: (path, body, opts) => request("PUT", path, body, opts),
|
|
401
|
+
patch: (path, body, opts) => request("PATCH", path, body, opts),
|
|
402
|
+
delete: (path, opts) => request("DELETE", path, void 0, opts),
|
|
403
|
+
onCleanup: (fn) => {
|
|
404
|
+
cleanups.push(fn);
|
|
405
|
+
},
|
|
406
|
+
cleanup: async () => {
|
|
407
|
+
const pending = cleanups.splice(0, cleanups.length).toReversed();
|
|
408
|
+
const errors = [];
|
|
409
|
+
for (const fn of pending) {
|
|
410
|
+
try {
|
|
411
|
+
await fn();
|
|
412
|
+
} catch (err) {
|
|
413
|
+
errors.push(err);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
if (errors.length > 0) {
|
|
417
|
+
throw errors[0];
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
function createApiFixture(options) {
|
|
423
|
+
return async (ctx, use) => {
|
|
424
|
+
const resolved = typeof options === "function" ? options(ctx) : options;
|
|
425
|
+
const api = createApiClient(resolved);
|
|
426
|
+
try {
|
|
427
|
+
await use(api);
|
|
428
|
+
} finally {
|
|
429
|
+
await api.cleanup();
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
function definePersona(name, config) {
|
|
434
|
+
return { name, ...config };
|
|
435
|
+
}
|
|
436
|
+
var PersonaAuthCache = class {
|
|
437
|
+
cache = /* @__PURE__ */ new Map();
|
|
438
|
+
inflight = /* @__PURE__ */ new Map();
|
|
439
|
+
keyFor(persona) {
|
|
440
|
+
return `${persona.name}::${persona.cacheKey ?? "default"}`;
|
|
441
|
+
}
|
|
442
|
+
get(name, cacheKey = "default") {
|
|
443
|
+
return this.cache.get(`${name}::${cacheKey}`);
|
|
444
|
+
}
|
|
445
|
+
invalidate(name, cacheKey = "default") {
|
|
446
|
+
if (!name) {
|
|
447
|
+
this.cache.clear();
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
450
|
+
this.cache.delete(`${name}::${cacheKey}`);
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Ensure `persona` is authenticated in `ctx`. On cache miss, executes `persona.signIn(ctx)`
|
|
454
|
+
* once (coalescing concurrent callers); on cache hit, restores cookies/storageState directly.
|
|
455
|
+
*/
|
|
456
|
+
async authenticate(persona, ctx) {
|
|
457
|
+
const key = this.keyFor(persona);
|
|
458
|
+
let state = this.cache.get(key);
|
|
459
|
+
let wasMiss = false;
|
|
460
|
+
if (!state) {
|
|
461
|
+
wasMiss = true;
|
|
462
|
+
let pending = this.inflight.get(key);
|
|
463
|
+
if (!pending) {
|
|
464
|
+
pending = (async () => {
|
|
465
|
+
const produced = await persona.signIn(ctx) ?? {};
|
|
466
|
+
const entry = {
|
|
467
|
+
storage: produced.storage,
|
|
468
|
+
storageStatePath: produced.storageStatePath,
|
|
469
|
+
cachedAt: Date.now()
|
|
470
|
+
};
|
|
471
|
+
this.cache.set(key, entry);
|
|
472
|
+
return entry;
|
|
473
|
+
})().finally(() => {
|
|
474
|
+
this.inflight.delete(key);
|
|
475
|
+
});
|
|
476
|
+
this.inflight.set(key, pending);
|
|
477
|
+
}
|
|
478
|
+
state = await pending;
|
|
479
|
+
}
|
|
480
|
+
const app = ctx.app;
|
|
481
|
+
if (!wasMiss) {
|
|
482
|
+
if (state.storageStatePath && ctx.platform === "web") {
|
|
483
|
+
await app.loadAuthState(state.storageStatePath);
|
|
484
|
+
}
|
|
485
|
+
if (state.storage) {
|
|
486
|
+
await app.setStorage(state.storage);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
if (persona.navigateTo) {
|
|
490
|
+
await app.openLink(persona.navigateTo);
|
|
491
|
+
}
|
|
492
|
+
return state;
|
|
493
|
+
}
|
|
494
|
+
};
|
|
336
495
|
|
|
337
496
|
// src/core/replay-cache.ts
|
|
338
497
|
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "fs";
|
|
@@ -559,10 +718,150 @@ var ReplaySession = class {
|
|
|
559
718
|
return summary;
|
|
560
719
|
}
|
|
561
720
|
};
|
|
721
|
+
|
|
722
|
+
// src/core/worker-pool.ts
|
|
723
|
+
import { spawn } from "child_process";
|
|
724
|
+
import { existsSync as existsSync2, readFileSync as readFileSync2, unlinkSync } from "fs";
|
|
725
|
+
var DEFAULT_MAX_WORKERS_PER_PROCESS = 8;
|
|
726
|
+
function planProcessPool(totalWorkers, maxWorkersPerProcess = DEFAULT_MAX_WORKERS_PER_PROCESS) {
|
|
727
|
+
const safeTotal = Math.max(1, Math.floor(totalWorkers));
|
|
728
|
+
const safeMax = Math.max(1, Math.floor(maxWorkersPerProcess));
|
|
729
|
+
if (safeTotal <= safeMax) {
|
|
730
|
+
return {
|
|
731
|
+
totalWorkers: safeTotal,
|
|
732
|
+
maxWorkersPerProcess: safeMax,
|
|
733
|
+
processCount: 1,
|
|
734
|
+
workersPerProcess: [safeTotal]
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
const processCount = Math.ceil(safeTotal / safeMax);
|
|
738
|
+
const base = Math.floor(safeTotal / processCount);
|
|
739
|
+
const remainder = safeTotal % processCount;
|
|
740
|
+
const workersPerProcess = Array.from(
|
|
741
|
+
{ length: processCount },
|
|
742
|
+
(_v, i) => base + (i < remainder ? 1 : 0)
|
|
743
|
+
);
|
|
744
|
+
return {
|
|
745
|
+
totalWorkers: safeTotal,
|
|
746
|
+
maxWorkersPerProcess: safeMax,
|
|
747
|
+
processCount,
|
|
748
|
+
workersPerProcess
|
|
749
|
+
};
|
|
750
|
+
}
|
|
751
|
+
function partitionFlowsAcrossProcesses(items, processCount, options) {
|
|
752
|
+
const count = Math.max(1, Math.min(Math.floor(processCount), Math.max(1, items.length)));
|
|
753
|
+
if (count === 1 || items.length === 0) {
|
|
754
|
+
return items.length === 0 ? [] : [items];
|
|
755
|
+
}
|
|
756
|
+
const hints = options?.durationHintsMs;
|
|
757
|
+
const getName = options?.getName;
|
|
758
|
+
const known = hints ? Object.values(hints).filter((v) => typeof v === "number" && v > 0) : [];
|
|
759
|
+
const defaultWeight = known.length > 0 ? known.reduce((a, b) => a + b, 0) / known.length : 1e3;
|
|
760
|
+
const indexed = items.map((item, idx) => ({
|
|
761
|
+
item,
|
|
762
|
+
idx,
|
|
763
|
+
weight: hints && getName ? hints[getName(item)] ?? defaultWeight : 1e3
|
|
764
|
+
}));
|
|
765
|
+
const ordered = hints && getName && Object.keys(hints).length > 0 ? indexed.toSorted((a, b) => b.weight - a.weight || a.idx - b.idx) : indexed;
|
|
766
|
+
const loads = Array.from({ length: count }, () => 0);
|
|
767
|
+
const buckets = Array.from({ length: count }, () => []);
|
|
768
|
+
for (const entry of ordered) {
|
|
769
|
+
let best = 0;
|
|
770
|
+
for (let i = 1; i < count; i++) {
|
|
771
|
+
if (loads[i] < loads[best]) best = i;
|
|
772
|
+
}
|
|
773
|
+
loads[best] = loads[best] + entry.weight;
|
|
774
|
+
buckets[best].push({ item: entry.item, idx: entry.idx });
|
|
775
|
+
}
|
|
776
|
+
return buckets.map((bucket) => bucket.toSorted((a, b) => a.idx - b.idx).map((e) => e.item)).filter((b) => b.length > 0);
|
|
777
|
+
}
|
|
778
|
+
function defaultReadJsonReport(reportJsonPath) {
|
|
779
|
+
if (!existsSync2(reportJsonPath)) return [];
|
|
780
|
+
const raw = JSON.parse(readFileSync2(reportJsonPath, "utf8"));
|
|
781
|
+
return Array.isArray(raw.results) ? raw.results : [];
|
|
782
|
+
}
|
|
783
|
+
async function runMultiProcessPool(options) {
|
|
784
|
+
const plan = planProcessPool(options.totalWorkers, options.maxWorkersPerProcess);
|
|
785
|
+
const spawnFn = options.spawnFn ?? spawn;
|
|
786
|
+
const readReport = options.readReportFn ?? defaultReadJsonReport;
|
|
787
|
+
const shouldCleanup = options.cleanupReportFiles !== false;
|
|
788
|
+
const startedAt = Date.now();
|
|
789
|
+
const processResults = await Promise.all(
|
|
790
|
+
plan.workersPerProcess.map(async (workerCount, shardIdx) => {
|
|
791
|
+
const shardStart = Date.now();
|
|
792
|
+
const spec = options.buildShardCommand(shardIdx + 1, plan.processCount, workerCount);
|
|
793
|
+
let exitCode = null;
|
|
794
|
+
let spawnError;
|
|
795
|
+
try {
|
|
796
|
+
exitCode = await new Promise((resolve, reject) => {
|
|
797
|
+
const child = spawnFn(spec.command, spec.args, {
|
|
798
|
+
env: { ...process.env, ...spec.env },
|
|
799
|
+
stdio: "inherit"
|
|
800
|
+
});
|
|
801
|
+
child.on("error", reject);
|
|
802
|
+
child.on("close", (code) => resolve(code));
|
|
803
|
+
});
|
|
804
|
+
} catch (err) {
|
|
805
|
+
spawnError = err instanceof Error ? err.message : String(err);
|
|
806
|
+
}
|
|
807
|
+
let shardResults = [];
|
|
808
|
+
try {
|
|
809
|
+
shardResults = readReport(spec.reportJsonPath);
|
|
810
|
+
} catch (err) {
|
|
811
|
+
if (!spawnError) {
|
|
812
|
+
spawnError = `Failed to parse shard ${shardIdx + 1} report: ${err instanceof Error ? err.message : String(err)}`;
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
if (shouldCleanup) {
|
|
816
|
+
try {
|
|
817
|
+
if (existsSync2(spec.reportJsonPath)) unlinkSync(spec.reportJsonPath);
|
|
818
|
+
} catch {
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
if (exitCode !== 0 && shardResults.length === 0) {
|
|
822
|
+
shardResults.push({
|
|
823
|
+
name: `worker-process-${shardIdx + 1}`,
|
|
824
|
+
platform: "web",
|
|
825
|
+
status: "failed",
|
|
826
|
+
durationMs: Date.now() - shardStart,
|
|
827
|
+
error: {
|
|
828
|
+
category: "driver-error",
|
|
829
|
+
message: spawnError ?? `Worker process ${shardIdx + 1} exited with code ${exitCode ?? "unknown"}`
|
|
830
|
+
}
|
|
831
|
+
});
|
|
832
|
+
}
|
|
833
|
+
return {
|
|
834
|
+
shardIndex: shardIdx + 1,
|
|
835
|
+
workerCount,
|
|
836
|
+
exitCode,
|
|
837
|
+
durationMs: Date.now() - shardStart,
|
|
838
|
+
results: shardResults,
|
|
839
|
+
...spawnError ? { error: spawnError } : {}
|
|
840
|
+
};
|
|
841
|
+
})
|
|
842
|
+
);
|
|
843
|
+
const results = processResults.flatMap((p) => p.results);
|
|
844
|
+
const passed = results.filter((r) => r.status === "passed").length;
|
|
845
|
+
const failed = results.filter((r) => r.status === "failed").length;
|
|
846
|
+
const skipped = results.filter((r) => r.status === "skipped").length;
|
|
847
|
+
const flaky = results.filter((r) => r.flaky).length;
|
|
848
|
+
return {
|
|
849
|
+
results,
|
|
850
|
+
totalDurationMs: Date.now() - startedAt,
|
|
851
|
+
passed,
|
|
852
|
+
failed,
|
|
853
|
+
skipped,
|
|
854
|
+
flaky,
|
|
855
|
+
processCount: plan.processCount,
|
|
856
|
+
processResults
|
|
857
|
+
};
|
|
858
|
+
}
|
|
562
859
|
export {
|
|
563
860
|
AndroidWebViewCdpChannel,
|
|
564
861
|
AppleWebInspectorClient,
|
|
565
862
|
CdpDomChannel,
|
|
863
|
+
DEFAULT_MAX_WORKERS_PER_PROCESS,
|
|
864
|
+
PersonaAuthCache,
|
|
566
865
|
ReplayCacheStore,
|
|
567
866
|
ReplaySession,
|
|
568
867
|
SPANA_MCP_TOOLS,
|
|
@@ -572,13 +871,21 @@ export {
|
|
|
572
871
|
WebKitInspectorChannel,
|
|
573
872
|
applyNamedSetup,
|
|
574
873
|
applyTestFilters,
|
|
874
|
+
buildDomFillScript,
|
|
875
|
+
buildDomWaitForHiddenScript,
|
|
876
|
+
buildDomWaitForMatchScript,
|
|
575
877
|
buildDomWaitForSelectorScript,
|
|
576
878
|
buildFilterCandidates,
|
|
577
879
|
buildFlowFileFromLines,
|
|
880
|
+
buildPlaybackTraceFromSteps,
|
|
578
881
|
buildReplayCacheKey,
|
|
579
882
|
collectGitChanges,
|
|
883
|
+
comparePngNative,
|
|
580
884
|
connectPlaywrightOverCDP,
|
|
885
|
+
connectPlaywrightOverWS,
|
|
581
886
|
createAndroidWebViewCdpChannel,
|
|
887
|
+
createApiClient,
|
|
888
|
+
createApiFixture,
|
|
582
889
|
createCdpDomChannel,
|
|
583
890
|
createCompositeDomChannel,
|
|
584
891
|
createFlowWithFixtures,
|
|
@@ -590,10 +897,13 @@ export {
|
|
|
590
897
|
decisionFilter,
|
|
591
898
|
decodeWebInspectorFrames,
|
|
592
899
|
defineConfig,
|
|
900
|
+
definePersona,
|
|
593
901
|
defineSetup,
|
|
902
|
+
deterministicImpactFilter,
|
|
594
903
|
domRectToScreenBounds,
|
|
595
904
|
encodeWebInspectorPacket,
|
|
596
905
|
ensureWarmBrowserDaemon,
|
|
906
|
+
exportFramesToMp4,
|
|
597
907
|
extractDestructuredParamNames,
|
|
598
908
|
findSimulatorWebInspectorSocket,
|
|
599
909
|
findWebViewFrame,
|
|
@@ -603,10 +913,13 @@ export {
|
|
|
603
913
|
formatSelectorCode,
|
|
604
914
|
formatTargetMatrixTable,
|
|
605
915
|
getHealthyWarmDaemon,
|
|
916
|
+
getNativeAcceleratorPath,
|
|
606
917
|
invalidateWebViewFrameCache,
|
|
918
|
+
isNativeAcceleratorActive,
|
|
607
919
|
isOffscreenInViewport,
|
|
608
920
|
isSystemUISelector,
|
|
609
921
|
isTestIDSelector,
|
|
922
|
+
launchDirectCdpBrowser,
|
|
610
923
|
launchPlaywrightBrowser,
|
|
611
924
|
listWarmDaemons,
|
|
612
925
|
makeElectrobunDriver,
|
|
@@ -615,17 +928,25 @@ export {
|
|
|
615
928
|
orderFlowsLongestFirst,
|
|
616
929
|
parseAndroidWebViewSockets,
|
|
617
930
|
parseWebInspectorXmlFrame,
|
|
931
|
+
partitionFlowsAcrossProcesses,
|
|
618
932
|
pathRuleFilter,
|
|
933
|
+
planProcessPool,
|
|
619
934
|
probabilityFromTopLogprobs,
|
|
620
935
|
replayRecordedAction,
|
|
621
936
|
resolveElectrobunEngine,
|
|
622
937
|
resolveElectrobunLaunchPlan,
|
|
623
938
|
resolveElementAcrossChannels,
|
|
624
939
|
resolveTargetDescriptor,
|
|
940
|
+
resolveWebEngine,
|
|
941
|
+
runMultiProcessPool,
|
|
625
942
|
speculativelyPrelaunchWebBrowser,
|
|
943
|
+
startAndroidVideoRecorder,
|
|
944
|
+
startCdpScreencastRecorder,
|
|
945
|
+
startIosSimulatorVideoRecorder,
|
|
626
946
|
stopAllWarmDaemons,
|
|
627
947
|
stopWarmDaemon,
|
|
628
948
|
systemUI,
|
|
949
|
+
tokenizeXmlNative,
|
|
629
950
|
updateWarmDaemonSession
|
|
630
951
|
};
|
|
631
952
|
//# sourceMappingURL=index.js.map
|