Skip to content

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

test(e2e): restore .gz download test with allowlisted fixtures domain

Data298459fe8cd5
diff --git a/tests/e2e/config/pinchtab.json b/tests/e2e/config/pinchtab.json
index c74c4bfb..874c35af 100644
--- a/tests/e2e/config/pinchtab.json
+++ b/tests/e2e/config/pinchtab.json
@@ -38,6 +38,7 @@
"allowDownload": true,
"allowUpload": true,
"allowClipboard": true,
+ "downloadAllowedDomains": ["fixtures"],
"attach": {
"enabled": true,
"allowHosts": [
diff --git a/tests/e2e/scenarios-cli/files-full.sh b/tests/e2e/scenarios-cli/files-full.sh
index 6745cc6a..2955316f 100644
--- a/tests/e2e/scenarios-cli/files-full.sh
+++ b/tests/e2e/scenarios-cli/files-full.sh
@@ -63,7 +63,27 @@ rm -f /tmp/e2e-scaled.pdf
end_test
# ─────────────────────────────────────────────────────────────────
-# NOTE: .gz download fallback is tested in unit tests (download_fallback_test.go).
-# E2E testing requires either a public .gz URL or allowlisting internal domains.
-# The core gzip decompression logic is covered by unit tests; e2e tests focus on
-# the download endpoint's basic functionality which is tested above.
+start_test "pinchtab download .gz file (gzip fallback)"
+
+# The fixtures domain is allowlisted in security.downloadAllowedDomains for e2e tests.
+# This tests the full fallback path: Chrome navigation aborts on .gz, we fall back
+# to Go HTTP fetch with cookie forwarding, decompress gzip, return plain XML.
+GZ_URL="${FIXTURES_URL:-http://fixtures:80}/sitemap.xml.gz"
+
+pt_ok download "$GZ_URL" -o /tmp/e2e-download-gz.xml
+if [ -f /tmp/e2e-download-gz.xml ]; then
+ if grep -q "example.com" /tmp/e2e-download-gz.xml; then
+ echo -e " ${GREEN}✓${NC} .gz file downloaded and decompressed"
+ ((ASSERTIONS_PASSED++)) || true
+ else
+ echo -e " ${RED}✗${NC} file downloaded but content not decompressed"
+ cat /tmp/e2e-download-gz.xml | head -5
+ ((ASSERTIONS_FAILED++)) || true
+ fi
+ rm -f /tmp/e2e-download-gz.xml
+else
+ echo -e " ${RED}✗${NC} .gz download file not created"
+ ((ASSERTIONS_FAILED++)) || true
+fi
+
+end_test