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.shindex 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; thenfail "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; thenfail "expected candidates in response"fi@@ -55,7 +55,7 @@ start_test "pinchtab find --tab <id>"# Open find page in new tab - capture tabId from responsept_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 1pt_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.shindex 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"fiend_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"fiend_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"fiend_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; thenfail "expected testData object"fi@@ -68,9 +68,9 @@ assert_ok "evaluate modify DOM"# Verify the change stuckpt_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"fiend_test@@ -81,15 +81,15 @@ start_test "pinchtab evaluate --tab <id>"# Open evaluate page in new tab - capture tabId from responsept_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 1pt_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"fiend_testdiff --git a/tests/e2e/scenarios/09-download.sh b/tests/e2e/scenarios/09-download.shindex 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"; thenfail "expected SSRF block message"fidiff --git a/tests/e2e/scenarios/10-upload.sh b/tests/e2e/scenarios/10-upload.shindex 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 responsept_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