sedum-cli 0.1.0-alpha.5 → 0.1.0-alpha.7
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.
|
@@ -84,10 +84,29 @@ function executionLines(value) {
|
|
|
84
84
|
const steps = value.tests.flatMap(
|
|
85
85
|
(test) => test.attempts.flatMap((attempt) => attempt.steps)
|
|
86
86
|
);
|
|
87
|
-
const
|
|
87
|
+
const attempts = steps.flatMap(
|
|
88
|
+
(step) => step.locator?.vision ? [step.locator.vision] : []
|
|
89
|
+
);
|
|
90
|
+
const selected = attempts.filter(
|
|
91
|
+
(vision) => vision.outcome === "selected"
|
|
92
|
+
).length;
|
|
93
|
+
const abstained = attempts.filter(
|
|
94
|
+
(vision) => vision.outcome === "abstained"
|
|
95
|
+
).length;
|
|
96
|
+
const failed = attempts.filter(
|
|
97
|
+
(vision) => vision.outcome === "failed" || !vision.outcome && vision.failure
|
|
98
|
+
).length;
|
|
99
|
+
const unrecorded = attempts.length - selected - abstained - failed;
|
|
88
100
|
lines.push(
|
|
89
|
-
|
|
101
|
+
attempts.length ? `vision ${execution.vision.model}: attempted on ${attempts.length} step(s); ${selected} selected, ${abstained} abstained, ${failed} failed${unrecorded ? `, ${unrecorded} outcome unrecorded` : ""}` : `vision ${execution.vision.model}: enabled, no fallback attempted`
|
|
90
102
|
);
|
|
103
|
+
const failedWithoutVision = steps.filter(
|
|
104
|
+
(step) => step.operation === "click" && (step.verdict === "failed" || step.state === "error") && !step.locator?.vision
|
|
105
|
+
).length;
|
|
106
|
+
if (failedWithoutVision)
|
|
107
|
+
lines.push(
|
|
108
|
+
`vision not attempted on ${failedWithoutVision} failed click step(s); see step errors for details`
|
|
109
|
+
);
|
|
91
110
|
if (execution.vision.key === "rejected")
|
|
92
111
|
lines.push(
|
|
93
112
|
"vision warning: OpenRouter rejected OPEN_ROUTER_API_KEY, so vision fallback cannot work. Check it with `sedum doctor --vision`."
|
|
@@ -645,7 +664,7 @@ async function runCli(args, version, runtime = {}) {
|
|
|
645
664
|
const writeOut = (value) => rawOut(withCommand(value, command));
|
|
646
665
|
const writeErr = (value) => rawErr(withCommand(value, command));
|
|
647
666
|
const capabilities = runtime.capabilities ?? plainOutput;
|
|
648
|
-
const executeRun = runtime.executeRun ?? (async (options) => (await import("./run-command-
|
|
667
|
+
const executeRun = runtime.executeRun ?? (async (options) => (await import("./run-command-GQN53UWF.js")).executeRunCommand(options));
|
|
649
668
|
const cwd = runtime.cwd ?? process.cwd();
|
|
650
669
|
let exitCode = 3;
|
|
651
670
|
const program = new Command().name("sedum").description(
|
|
@@ -663,7 +682,7 @@ async function runCli(args, version, runtime = {}) {
|
|
|
663
682
|
"after",
|
|
664
683
|
"\nCreates a config, a SauceDemo example, .env.example, and ignore rules.\nExisting files are never replaced.\n"
|
|
665
684
|
).action(async () => {
|
|
666
|
-
const { executeInitCommand } = await import("./init-command-
|
|
685
|
+
const { executeInitCommand } = await import("./init-command-CTZAAPJ5.js");
|
|
667
686
|
const interactive = capabilities.stdoutIsTTY && (process.stdin.isTTY === true || runtime.confirmInit !== void 0);
|
|
668
687
|
const confirm = runtime.confirmInit ?? (interactive ? async (question) => {
|
|
669
688
|
const { createInterface } = await import("readline/promises");
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -40,7 +40,12 @@ TYPESAFE_API_KEY=
|
|
|
40
40
|
# Public SauceDemo sample account; no Sauce Labs account is required.
|
|
41
41
|
SAUCE_PASSWORD=secret_sauce
|
|
42
42
|
`;
|
|
43
|
-
var IGNORE = [
|
|
43
|
+
var IGNORE = [
|
|
44
|
+
"node_modules/",
|
|
45
|
+
".env",
|
|
46
|
+
".sedum/runs/",
|
|
47
|
+
".sedum/reports/"
|
|
48
|
+
];
|
|
44
49
|
var WORDMARK = [
|
|
45
50
|
" \u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588 \u2588 \u2588 \u2588 \u2588 \u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588 \u2588",
|
|
46
51
|
"\u2588 \u2591\u2591\u2591\u2591\u2588\u2591\u2591\u2591\u2591\u2591\u2588\u2591\u2591\u2591\u2588 \u2588\u2591 \u2588\u2591\u2588\u2588 \u2588\u2588\u2591 \u2588\u2591\u2591\u2591\u2588 \u2588\u2591\u2591\u2591\u2591\u2591\u2588\u2591 \u2588\u2591",
|
|
@@ -421,6 +421,11 @@ var SUPPORTED_REPORTERS = [
|
|
|
421
421
|
"markdown",
|
|
422
422
|
"junit"
|
|
423
423
|
];
|
|
424
|
+
function verifyGraceMs(value) {
|
|
425
|
+
if (value === void 0) return 5e3;
|
|
426
|
+
const parsed = Number(value);
|
|
427
|
+
return Number.isFinite(parsed) && parsed >= 0 && parsed <= 12e4 ? parsed : 5e3;
|
|
428
|
+
}
|
|
424
429
|
function strayRejectionDiagnostic(strays, config) {
|
|
425
430
|
const stray = strays[0];
|
|
426
431
|
const where = stray.source ? `${path3.relative(config.projectRoot, stray.source.file).split(path3.sep).join("/")}:${stray.source.line}: ` : "";
|
|
@@ -1113,6 +1118,7 @@ async function executeRunCommand(options) {
|
|
|
1113
1118
|
browserKind: config.browser,
|
|
1114
1119
|
viewport: config.viewport,
|
|
1115
1120
|
verifyPolicy: config.thresholds,
|
|
1121
|
+
verifyGraceMs: verifyGraceMs(process.env.SEDUM_VERIFY_GRACE_MS),
|
|
1116
1122
|
...config.baseUrl ? { baseUrl: config.baseUrl } : {},
|
|
1117
1123
|
...options.urlOverride ? { urlOverride: options.urlOverride } : {},
|
|
1118
1124
|
...options.headed ? { headless: false } : {},
|
|
@@ -1256,5 +1262,6 @@ async function executeRunCommand(options) {
|
|
|
1256
1262
|
}
|
|
1257
1263
|
export {
|
|
1258
1264
|
executeRunCommand,
|
|
1259
|
-
strayRejectionDiagnostic
|
|
1265
|
+
strayRejectionDiagnostic,
|
|
1266
|
+
verifyGraceMs
|
|
1260
1267
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sedum-cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.7",
|
|
4
4
|
"repository": "https://github.com/sedum-dev/sedum",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"commander": "14.0.2",
|
|
26
26
|
"minimatch": "10.2.6",
|
|
27
27
|
"yaml": "2.9.1",
|
|
28
|
-
"@sedum-dev/core": "0.1.0-alpha.
|
|
29
|
-
"@sedum-dev/
|
|
30
|
-
"@sedum-dev/
|
|
28
|
+
"@sedum-dev/core": "0.1.0-alpha.7",
|
|
29
|
+
"@sedum-dev/provider-typesafe": "0.1.0-alpha.7",
|
|
30
|
+
"@sedum-dev/reporters": "0.1.0-alpha.7"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "tsup src/index.ts src/cli.ts --format esm --dts --clean --out-dir dist",
|