Skip to content

feature: add sandbox e2e test#7236

Open
janicduplessis wants to merge 8 commits into
developfrom
@janic/sandbox-e2e-test
Open

feature: add sandbox e2e test#7236
janicduplessis wants to merge 8 commits into
developfrom
@janic/sandbox-e2e-test

Conversation

@janicduplessis
Copy link
Copy Markdown
Contributor

@janicduplessis janicduplessis commented Mar 10, 2026

What changed (plus any additional context for devs)

Adds an automated Maestro e2e test for the WebView sandbox. Triggered via the existing rainbow://e2e/<command> deeplink mechanism by adding a new sandbox-test action.

TestDeeplinkHandler moves from src/components/ to src/features/e2e/ui/ alongside the new sandbox UI.

What to test

  • CI: the new security Maestro test passes on the iOS and Android e2e shards.

@github-actions
Copy link
Copy Markdown

Launch in simulator or device for aead192

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 10, 2026

🧪 Flashlight Performance Report (AWS Device Farm)

🔀 Commit: b987ccd

📎 View Artifacts

Metric Current Δ vs Baseline
Time to Interactive (TTI) 5430 ms
Average FPS 56.88
Average RAM 387.4 MB

@janicduplessis janicduplessis changed the title feature: add sandbox security e2e test feature: add sandbox e2e test Mar 10, 2026
@github-actions
Copy link
Copy Markdown

Launch in simulator or device for 6f7d49e

@janicduplessis janicduplessis force-pushed the @janic/sandbox-e2e-test branch from 0dae5cc to 0229901 Compare March 19, 2026 07:58
@github-actions
Copy link
Copy Markdown

Launch in simulator or device for dd0710e

Comment thread src/features/e2e/core/sandboxSecurityTest.ts Dismissed
@github-actions
Copy link
Copy Markdown

Launch in simulator or device for c8fb112

@github-actions
Copy link
Copy Markdown

Launch in simulator or device for 9b16969

@github-actions
Copy link
Copy Markdown

Launch in simulator or device for 9932e12

@github-actions
Copy link
Copy Markdown

Launch in simulator or device for 317c99d

@github-actions
Copy link
Copy Markdown

Launch in simulator or device for 06f1edc

@github-actions
Copy link
Copy Markdown

Launch in simulator or device for f5cde07

@janicduplessis janicduplessis force-pushed the @janic/sandbox-e2e-test branch from fc2334e to 8b4179e Compare March 20, 2026 10:01
@github-actions
Copy link
Copy Markdown

Launch in simulator or device for 9c4af76

@github-actions
Copy link
Copy Markdown

Launch in simulator or device for 17bf257

@github-actions
Copy link
Copy Markdown

Launch in simulator or device for b784601

Adds automated Maestro tests that verify the sandbox correctly blocks
unauthorized HTTP and WebSocket connections while allowing approved domains.
Moves TestDeeplinkHandler to features/e2e/ domain structure.
- Native module test: verifies NativeModules proxy blocks access from
  non-whitelisted files
- WebView initial load test: loads blocked URL directly, asserts onError
- WebView JS navigation test: loads allowed page, attempts JS navigation
  to blocked URL, verifies URL didn't change via postMessage
- Simplified Maestro assertions to just check overall pass/fail
Points rainbow-scripts postinstall at the @janic/emit-close-on-blocked-ws
branch of react-native-sandbox until those fixes are merged.
Security layer removed, native module test no longer applicable.
@janicduplessis janicduplessis force-pushed the @janic/sandbox-e2e-test branch from db47c29 to d65dabe Compare April 20, 2026 14:38
@github-actions
Copy link
Copy Markdown

Launch in simulator or device for 00cb937

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 13a7026. Configure here.

setWebViewDone(true);
});
const syncResults = await runSandboxTests();
setResults(syncResults);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Direct state set can overwrite webview test results

Medium Severity

setResults(syncResults) is a direct state set that overwrites the entire results array. If the Promise.all .then() callback on line 48–51 fires before runSandboxTests() resolves (e.g., under slow CI network), it sets results to wvResults and webViewDone to true. Then setResults(syncResults) overwrites results to only the sync tests — losing the webview results while webViewDone remains true. The Maestro assertion then checks only 3 of 5 expected results and may show SANDBOX_TEST_PASSED without verifying webview sandbox enforcement.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 13a7026. Configure here.

@github-actions
Copy link
Copy Markdown

Launch in simulator or device for b987ccd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants