Skip to content

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

fix(e2e): truncate long output, fix instance tabs race + proxy route

Boschb9734c7f19de
diff --git a/tests/e2e/scenarios/31-multi-instance.sh b/tests/e2e/scenarios/31-multi-instance.sh
index c20bcee1..4b7118e4 100755
--- a/tests/e2e/scenarios/31-multi-instance.sh
+++ b/tests/e2e/scenarios/31-multi-instance.sh
@@ -82,6 +82,15 @@ end_test
# ─────────────────────────────────────────────────────────────────
start_test "orchestrator: instance tabs"
+# Wait for instance to be running (may still be starting)
+for i in $(seq 1 10); do
+ INST_STATUS=$(curl -sf "${PINCHTAB_URL}/instances/${INST_ID}" 2>/dev/null | jq -r '.status // empty' || true)
+ if [ "$INST_STATUS" = "running" ]; then
+ break
+ fi
+ sleep 1
+done
+
pt_get "/instances/${INST_ID}/tabs"
assert_ok "instance tabs"
@@ -200,12 +209,12 @@ ISO_INST2=$(echo "$RESULT" | jq -r '.id')
sleep 3
-# Navigate on each instance
-pt_post "/instances/${ISO_INST1}/proxy/navigate" "{\"url\":\"${FIXTURES_URL}/index.html\"}"
-TAB1=$(echo "$RESULT" | jq -r '.tabId')
+# Open tabs on each instance
+pt_post "/instances/${ISO_INST1}/tabs/open" "{\"url\":\"${FIXTURES_URL}/index.html\"}"
+TAB1=$(echo "$RESULT" | jq -r '.tabId // .id // empty')
-pt_post "/instances/${ISO_INST2}/proxy/navigate" "{\"url\":\"${FIXTURES_URL}/form.html\"}"
-TAB2=$(echo "$RESULT" | jq -r '.tabId')
+pt_post "/instances/${ISO_INST2}/tabs/open" "{\"url\":\"${FIXTURES_URL}/form.html\"}"
+TAB2=$(echo "$RESULT" | jq -r '.tabId // .id // empty')
if [ "$TAB1" != "$TAB2" ] || [ -z "$TAB1" ]; then
echo -e " ${GREEN}✓${NC} instances have separate tabs"
diff --git a/tests/e2e/scenarios/common.sh b/tests/e2e/scenarios/common.sh
index 0873ef1f..65d90888 100755
--- a/tests/e2e/scenarios/common.sh
+++ b/tests/e2e/scenarios/common.sh
@@ -310,7 +310,17 @@ pinchtab() {
# pt_post /path '{"json":"data"}'
# pt_post /path -d '{"json":"data"}' (also works)
pt() { pinchtab "$@"; }
-pt_get() { pinchtab GET "$1"; echo "$RESULT"; }
+
+# Truncate output for display (avoid flooding logs with base64 blobs)
+_echo_truncated() {
+ if [ ${#RESULT} -gt 1000 ]; then
+ echo "${RESULT:0:200}...[truncated ${#RESULT} chars]"
+ else
+ echo "$RESULT"
+ fi
+}
+
+pt_get() { pinchtab GET "$1"; _echo_truncated; }
pt_post() {
local path="$1"
shift
@@ -319,7 +329,7 @@ pt_post() {
shift
fi
pinchtab POST "$path" -d "$1"
- echo "$RESULT"
+ _echo_truncated
}
pt_patch() {
@@ -334,7 +344,7 @@ pt_patch() {
-d "$body")
RESULT=$(echo "$response" | head -n -1)
HTTP_STATUS=$(echo "$response" | tail -n 1)
- echo "$RESULT"
+ _echo_truncated
}
pt_delete() {
@@ -346,7 +356,7 @@ pt_delete() {
"${PINCHTAB_URL}$path")
RESULT=$(echo "$response" | head -n -1)
HTTP_STATUS=$(echo "$response" | tail -n 1)
- echo "$RESULT"
+ _echo_truncated
}
# POST raw body (for testing malformed JSON)
@@ -362,7 +372,7 @@ pt_post_raw() {
-d "$body")
RESULT=$(echo "$response" | head -n -1)
HTTP_STATUS=$(echo "$response" | tail -n 1)
- echo "$RESULT"
+ _echo_truncated
}
# ================================================================