@e2e-dev/testmu runs targets on
TestMu AI (formerly LambdaTest). testmu() is
a device provider for Android emulators, iOS
simulators, and real devices. testmuBrowsers() from @e2e-dev/testmu/web
is a browser provider for hosted Chrome and
Edge. Tests stay the same.
Authenticate
Set LT_USERNAME and LT_ACCESS_KEY in the environment e2e run starts
in, such as CI secrets. Copy them from Account Settings → Password &
Security → Username and Access Key
(accounts.lambdatest.com/security/username-accesskey).
Without either, the lease fails before any test starts. testmuBrowsers()
sends them only in each session’s CDP URL, never in a log line.
Run mobile targets on devices
Each worker slot leases one device when the run starts and releases it when the run ends.
No Mac, Xcode, or Android SDK on the machine that runs e2e.
Install the integration alongside the mobile engine:
device and osVersion must match TestMu AI’s catalog exactly, as the
capabilities generator
lists them: 18.0 for a virtual iOS device, 18 for a real one, 14 for
Android. Real and virtual devices have separate catalogs.
app is the build TestMu AI installs on every session: an lt:// app id,
an https URL, or a local path, resolved against the directory of
e2e.config.ts and uploaded. Use an .apk or .aab on Android, a zipped
.app on an iOS simulator, and a signed .ipa on a real iOS device. Leave
the target’s app.appPath out, and keep app.bundleId for app.open().
Example test
Example test
Run web targets in browsers
Each worker slot gets its own Chrome or Edge session for the run. Every attempt gets a new browser context in that session, as in a local run, so a test never sees another test’s cookies, storage, or permissions.
Install the integration alongside the web engine:
Set the target’s browser to testmuBrowsers():
Device options
Device features are set when the session starts and hold for the whole
session. An unknown option or an invalid value fails the config load with
INVALID_CONFIG.
Browser options
The provider sends platform (Windows 11, since TestMu AI refuses a
session without one), build (the run id), project (e2e), and
idleTimeout (600 seconds) unless capabilities sets them. Edge sessions get
--user-data-dir=remote-debug-profile-edge in browserOptions unless
capabilities set one. It sets user, accessKey, and name itself, so
capabilities that set any of them fail the config with INVALID_CONFIG.
So do a nested LT:Options, a browserName (use the option), a value JSON
cannot carry, and a misspelled testmuBrowsers() option. Other
capabilities keys go to TestMu AI unchecked.
Find sessions and videos
By default, the dashboard names each session e2e-<run id>-<target>-<slot>.
An attempt that records video gets:
- On a device, a link to TestMu AI’s recording of the session, found by
its
buildandsessionName. The recording covers the whole session, so every attempt on a worker slot links the same video. Runs that overlap and share a fixedbuildandsessionNamecan link each other’s videos; the defaults never do. - In a browser, the web engine’s screencast of the page, as in a local
run. TestMu AI records the session’s screen when you pass
capabilities: { video: true }. Watch it in the TestMu AI dashboard.
Limits
- Parallel sessions. Keep
workerstimes the number of TestMu AI targets within your plan’s parallel sessions. A browser session beyond the plan waits in TestMu AI’s queue. - Device sessions are billed while leased. A device session starts when its slot is leased, which takes about 30 to 75 seconds. It is billed until the run releases it, even when no test runs on it.
- Stopped runner on a device. If the runner is killed before it releases a device, nothing sends the session another command. TestMu AI’s idle timeout (120 seconds by default) ends it, about three minutes after its last command.
- Device settings and logs. Device settings (permissions, location, network, appearance), system alerts, recording and device logs through agent-device, and port reverse are not available. Read logs on the TestMu AI dashboard, and use TestMu AI Tunnel to reach a server on your network.
- 60-second browser connect. The web engine waits at most 60 seconds for
a browser session to accept the CDP connection. A shorter
launchTimeoutends the wait sooner, but a longer one does not extend it. A session still queued or provisioning after that fails withLAUNCH_TIMEOUT, or withENGINE_FAILUREwhenlaunchTimeoutis over 60 seconds. - Dropped browser connections. A browser session cannot be resumed, so a dropped connection fails the attempt.
- Browser downloads. TestMu AI’s browsers save downloads on their own
machines, so
browser.waitForDownloadfails withENGINE_FAILURE. Assert on the download link or the request instead.