Skip to content

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

fix(e2e): use RESULT variable correctly, not LAST_BODY

Boscha896ab241b7b
diff --git a/tests/e2e/scenarios/07-find.sh b/tests/e2e/scenarios/07-find.sh
index d4bde147..b2f99e03 100755
--- a/tests/e2e/scenarios/07-find.sh
+++ b/tests/e2e/scenarios/07-find.sh
@@ -14,7 +14,7 @@ pt_post /find -d '{"query":"login button"}'
assert_ok "find login"
# Verify we got a ref back
-if ! echo "$LAST_BODY" | jq -e '.best_ref' >/dev/null 2>&1; then
+if ! echo "$RESULT" | jq -e '.best_ref' >/dev/null 2>&1; then
fail "expected best_ref in response"
fi
@@ -43,7 +43,7 @@ pt_post /find -d '{"query":"search input","topK":5}'
assert_ok "find search"
# Verify candidates array
-if ! echo "$LAST_BODY" | jq -e '.candidates | length > 0' >/dev/null 2>&1; then
+if ! echo "$RESULT" | jq -e '.candidates | length > 0' >/dev/null 2>&1; then
fail "expected candidates in response"
fi
@@ -55,7 +55,7 @@ start_test "pinchtab find --tab <id>"
# Open find page in new tab - capture tabId from response
pt_post /navigate -d "{\"url\":\"${FIXTURES_URL}/find.html\",\"newTab\":true}"
assert_ok "navigate for find"
-TAB_ID=$(echo "$LAST_BODY" | jq -r '.tabId')
+TAB_ID=$(echo "$RESULT" | jq -r '.tabId')
sleep 1
pt_post "/tabs/${TAB_ID}/find" -d '{"query":"sign up link"}'
diff --git a/tests/e2e/scenarios/08-evaluate.sh b/tests/e2e/scenarios/08-evaluate.sh
index eab02a21..a323c74b 100755
--- a/tests/e2e/scenarios/08-evaluate.sh
+++ b/tests/e2e/scenarios/08-evaluate.sh
@@ -14,9 +14,9 @@ pt_post /evaluate -d '{"expression":"1 + 1"}'
assert_ok "evaluate simple"
# Verify result
-RESULT=$(echo "$LAST_BODY" | jq -r '.result')
-if [ "$RESULT" != "2" ]; then
- fail "expected result=2, got $RESULT"
+VAL=$(echo "$RESULT" | jq -r '.result')
+if [ "$VAL" != "2" ]; then
+ fail "expected result=2, got $VAL"
fi
end_test
@@ -27,9 +27,9 @@ start_test "pinchtab evaluate (DOM query)"
pt_post /evaluate -d '{"expression":"document.title"}'
assert_ok "evaluate DOM"
-RESULT=$(echo "$LAST_BODY" | jq -r '.result')
-if [ "$RESULT" != "Evaluate Test Page" ]; then
- fail "expected title, got $RESULT"
+VAL=$(echo "$RESULT" | jq -r '.result')
+if [ "$VAL" != "Evaluate Test Page" ]; then
+ fail "expected value, got $VAL"
fi
end_test
@@ -40,9 +40,9 @@ start_test "pinchtab evaluate (call function)"
pt_post /evaluate -d '{"expression":"window.calculate.add(5, 3)"}'
assert_ok "evaluate function"
-RESULT=$(echo "$LAST_BODY" | jq -r '.result')
-if [ "$RESULT" != "8" ]; then
- fail "expected result=8, got $RESULT"
+VAL=$(echo "$RESULT" | jq -r '.result')
+if [ "$VAL" != "8" ]; then
+ fail "expected value, got $VAL"
fi
end_test
@@ -54,7 +54,7 @@ pt_post /evaluate -d '{"expression":"JSON.stringify(window.testData)"}'
assert_ok "evaluate object"
# Verify we got the test data
-if ! echo "$LAST_BODY" | jq -r '.result' | jq -e '.name == "PinchTab"' >/dev/null 2>&1; then
+if ! echo "$RESULT" | jq -r '.result' | jq -e '.name == "PinchTab"' >/dev/null 2>&1; then
fail "expected testData object"
fi
@@ -68,9 +68,9 @@ assert_ok "evaluate modify DOM"
# Verify the change stuck
pt_post /evaluate -d '{"expression":"document.getElementById(\"counter\").textContent"}'
-RESULT=$(echo "$LAST_BODY" | jq -r '.result')
-if [ "$RESULT" != "42" ]; then
- fail "expected counter=42, got $RESULT"
+VAL=$(echo "$RESULT" | jq -r '.result')
+if [ "$VAL" != "42" ]; then
+ fail "expected value, got $VAL"
fi
end_test
@@ -81,15 +81,15 @@ start_test "pinchtab evaluate --tab <id>"
# Open evaluate page in new tab - capture tabId from response
pt_post /navigate -d "{\"url\":\"${FIXTURES_URL}/evaluate.html\",\"newTab\":true}"
assert_ok "navigate for evaluate"
-TAB_ID=$(echo "$LAST_BODY" | jq -r '.tabId')
+TAB_ID=$(echo "$RESULT" | jq -r '.tabId')
sleep 1
pt_post "/tabs/${TAB_ID}/evaluate" -d '{"expression":"1 + 2 + 3"}'
assert_ok "tab evaluate"
-RESULT=$(echo "$LAST_BODY" | jq -r '.result')
-if [ "$RESULT" != "6" ]; then
- fail "expected result=6, got $RESULT"
+VAL=$(echo "$RESULT" | jq -r '.result')
+if [ "$VAL" != "6" ]; then
+ fail "expected value, got $VAL"
fi
end_test
diff --git a/tests/e2e/scenarios/09-download.sh b/tests/e2e/scenarios/09-download.sh
index efe8f150..14277c97 100755
--- a/tests/e2e/scenarios/09-download.sh
+++ b/tests/e2e/scenarios/09-download.sh
@@ -23,7 +23,7 @@ pt_get "/download?url=${FIXTURES_URL}/sample.txt"
assert_http_status 400 "download blocked"
# Verify error message mentions blocking
-if ! echo "$LAST_BODY" | grep -q "blocked\|private"; then
+if ! echo "$RESULT" | grep -q "blocked\|private"; then
fail "expected SSRF block message"
fi
diff --git a/tests/e2e/scenarios/10-upload.sh b/tests/e2e/scenarios/10-upload.sh
index 4b45cc37..20903d91 100755
--- a/tests/e2e/scenarios/10-upload.sh
+++ b/tests/e2e/scenarios/10-upload.sh
@@ -33,7 +33,7 @@ start_test "pinchtab upload --tab <id>"
# Open upload page in new tab - capture tabId from response
pt_post /navigate -d "{\"url\":\"${FIXTURES_URL}/upload.html\",\"newTab\":true}"
assert_ok "navigate for upload"
-TAB_ID=$(echo "$LAST_BODY" | jq -r '.tabId')
+TAB_ID=$(echo "$RESULT" | jq -r '.tabId')
sleep 1
# 1x1 transparent PNG