diff --git a/scripts/src/hwlab-node/web-probe-observe.ts b/scripts/src/hwlab-node/web-probe-observe.ts index 01c0f94a..afb74fcd 100644 --- a/scripts/src/hwlab-node/web-probe-observe.ts +++ b/scripts/src/hwlab-node/web-probe-observe.ts @@ -513,7 +513,8 @@ export function runNodeWebProbeScreenshot(options: NodeWebProbeScreenshotOptions "30000", ...(options.keepRemote ? ["--keep-remote"] : []), ], repoRoot, { input: script, timeoutMs: options.commandTimeoutSeconds * 1000 }); - const transport = parseJsonObject(result.stdout); + const transport = record(parseJsonObject(result.stdout)); + const transportParsed = Object.keys(transport).length > 0; const artifacts = Array.isArray(transport.artifacts) ? transport.artifacts.map(record) : []; const screenshot = artifacts.find((artifact) => { const remotePath = typeof artifact.remotePath === "string" ? artifact.remotePath : ""; @@ -529,11 +530,13 @@ export function runNodeWebProbeScreenshot(options: NodeWebProbeScreenshotOptions ? null : result.timedOut ? "web-probe-screenshot-command-timeout" - : transport.ok === false - ? "web-probe-screenshot-remote-failed" - : screenshot === null - ? "web-probe-screenshot-artifact-missing" - : "web-probe-screenshot-download-unverified"; + : !transportParsed + ? "web-probe-screenshot-transport-unparseable" + : transport.ok === false + ? "web-probe-screenshot-remote-failed" + : screenshot === null + ? "web-probe-screenshot-artifact-missing" + : "web-probe-screenshot-download-unverified"; return { ok, status: ok ? "pass" : "blocked",