Skip to content

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

test(e2e): align the annotate unmatched-selector row with 404 element_not_found and the wildcard instance row with no private-IP override for a bare *

Luigi Agosti890ce022e9bf
diff --git a/tests/e2e/scenarios/api/annotate-basic.sh b/tests/e2e/scenarios/api/annotate-basic.sh
index f2f54608..4c8db449 100755
--- a/tests/e2e/scenarios/api/annotate-basic.sh
+++ b/tests/e2e/scenarios/api/annotate-basic.sh
@@ -118,10 +118,11 @@ assert_result_eq '.result' 'true' 'stale overlay removed on zero-result refresh'
end_test
# ─────────────────────────────────────────────────────────────────
-start_test "annotate: bad selector is a 400, not a 500"
+start_test "annotate: a selector that matches nothing is 404 element_not_found, not a 500"
pt_get "/annotate?selector=%23definitely-not-here"
-assert_http_status "400" "bad selector returns 400"
+assert_http_status "404" "unmatched selector returns 404"
+assert_json_eq "$RESULT" '.code' 'element_not_found' "the refusal carries the element_not_found code"
end_test
diff --git a/tests/e2e/scenarios/infra/security-smoke.sh b/tests/e2e/scenarios/infra/security-smoke.sh
index cc29137c..b101fc58 100644
--- a/tests/e2e/scenarios/infra/security-smoke.sh
+++ b/tests/e2e/scenarios/infra/security-smoke.sh
@@ -53,7 +53,7 @@ fi
end_test
# ─────────────────────────────────────────────────────────────────
-start_test "security: instance-scoped wildcard widens one strict instance only"
+start_test "security: an instance-scoped bare wildcard grants no private-IP override"
secure_post /instances/start -d '{"mode":"headless","securityPolicy":{"allowedDomains":["*"]}}'
assert_http_status 201 "start wildcard instance"
@@ -67,13 +67,8 @@ if [ -n "$SECURE_WILDCARD_INST_ID" ] && wait_for_orchestrator_instance_status "$
fi
secure_post "/instances/${SECURE_WILDCARD_INST_ID}/tabs/open" "{\"url\":\"${PIVOT_URL}\"}"
- assert_ok "wildcard instance can open pivot-target"
- WILDCARD_TAB_ID=$(echo "$RESULT" | jq -r '.tabId // empty')
- if [ -n "$WILDCARD_TAB_ID" ]; then
- secure_get "/tabs/${WILDCARD_TAB_ID}/text"
- assert_ok "wildcard instance text works on pivot-target"
- assert_contains "$RESULT" "Welcome to the E2E test fixtures." "wildcard instance reaches non-baseline host"
- fi
+ assert_http_status 403 "wildcard instance is refused the private pivot-target"
+ assert_contains "$RESULT" "private/internal IP" "the refusal names the private-IP guard, not the domain allowlist"
fi
secure_post /navigate -d "{\"url\":\"${PIVOT_URL}\"}"