Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

fix: stabilize CLI browser ref lookup e2e

Luigi Agostiedb26013fcbf
diff --git a/tests/e2e/scenarios/cli/browser-basic.sh b/tests/e2e/scenarios/cli/browser-basic.sh
index dc479012..935cd44a 100644
--- a/tests/e2e/scenarios/cli/browser-basic.sh
+++ b/tests/e2e/scenarios/cli/browser-basic.sh
@@ -188,7 +188,7 @@ pt_ok nav "${FIXTURES_URL}/index.html"
# -i keeps the interactive filter; --compact=false forces JSON for jq parsing
pt_ok snap -i --compact=false
# Extract a ref from the snapshot (first link)
-REF=$(echo "$PT_OUT" | safe_jq -r '.nodes[] | select(.role == "link") | .ref' | head -1)
+REF=$(echo "$PT_OUT" | safe_jq -r '[.nodes[] | select(.role == "link") | .ref] | first // empty' 2>/dev/null || true)
if [ -n "$REF" ] && [ "$REF" != "null" ]; then
pt_ok text "$REF"
# Default output is plain text