Repository navigation
Add e2e example: end-to-end tests on Android and in Chromium (JavaScript) - #178
Draft
tomasvarga wants to merge 1 commit into
Draft
tomasvarga wants to merge 1 commit into
tomasvarga wants to merge 1 commit into
Conversation
…ipt) examples/e2e-android-web-tests-js runs e2e tests in E2B sandboxes with the e2b() and e2bBrowsers() providers from @e2e-dev/e2b: 2048 on Android 16 and Wikipedia in Chromium, each with one scripted test and one agent test. No package-lock.json yet: @e2e-dev/e2b 0.0.1 is not on npm until e2e-inc/e2e#1590 is released.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
examples/e2e-android-web-tests-js: end-to-end tests that run in E2B sandboxes with e2e, an open-source test runner, and the two providers from@e2e-dev/e2b(merged upstream in e2e-inc/e2e#1598).e2b()leases Android 16 sandboxes from the publicandroid-16template. The example tests the game 2048. No Android SDK, emulator, oradbon the machine.e2bBrowsers()leases Chromium sandboxes from a template built one time from the Playwright image. The example tests Wikipedia.Each target has one scripted test and one agent test (a model works toward a goal, and a scripted assertion checks the result).
Draft until the package is on npm
@e2e-dev/e2b0.0.1 is not on npm yet. It ships with the pending e2e release, e2e-inc/e2e#1590, together with e2e 0.23.1,@e2e-dev/web0.16.0 and@e2e-dev/mobile0.12.7.package.jsonalready pins those versions, sonpm installfails until the release. After it:package-lock.jsonDesign
npm startruns only the Android target, which needs an E2B key and one APK download. The Chromium template build and the agent tests are optional later steps in the README.ANTHROPIC_API_KEY, they are skipped and the scripted tests still run.npm run download-apkgets Privacy Friendly 2048 (GPL-3.0) from F-Droid and checks a pinned SHA-256.tests/run-examples.tswould nest sandboxes, and the web target needs the template on the account first. The note in that file explains this.Also adds a row to the root README under "Remote execution integrations".
Testing
npm run check(typecheck, oxlint): passing.main(046bd08f), E2B SDK 2.63.0 and Node.js 24:npm run test:allwith an Anthropic key: 4 of 4 tests pass in about 35 s.npm startwithout the key: the scripted Android test passes, the agent test is skipped.npm run download-apkandnpm run build-template: both work.