Repository navigation
feat(testmu): hosted Chrome and Edge for the web engine with testmuBrowsers() - #4
Conversation
b5d120e to
8ca6a64
Compare
amankansal-lt
left a comment
There was a problem hiding this comment.
Thanks, Sahil. This is in good shape, and it's what the upstream maintainer asked for when closing tester-army#765. Two wording fixes are needed before it goes into tester-army#772. Neither needs a code change.
projectgrouping isn't verified.docs/integrations/testmu-browsers.mdx(options table and FAQ) and the JSDoc inpackages/testmu/src/browsers.tssayprojectis the "Dashboard project the sessions are grouped under". Your PR description says the desktop sessions API returns no project field, so that couldn't be confirmed. Please change it to what we know, e.g. "sent asLT:Options.project", or confirm the grouping on the dashboard and say so. A tester-army reviewer would quote this line back at us on tester-army#772./playwright-cdpis still rolling out. The docs say to use it "once TestMu AI serves raw CDP on it for your account", but a user can't find that out. Please say plainly that it's rolling out and may fail on machines without the new backend, keeping/puppeteeras the default. Or drop therouteoption until the rollout finishes, which also shrinks tester-army#772's API surface. Either is fine.
Optional, take or leave:
capabilitiescontainingbrowserName,browserVersionor a nestedLT:Optionsis quietly nested insideLT:Optionsrather than refused. Refusing them like the reserved keys would match the rest of the validation.- With
skipLibCheck: false, a device-only user importing the package root gets a type error, becausedist/browsers.d.tsimports types from the now-optional@e2e-dev/web. The repo usesskipLibCheck: true, so this is minor.
What I checked:
- Key exposure. The only log line holds just the name and build. Playwright 1.63 prints only the path of a failing
wss://URL, never the query. Thehttp://case that would leak is unreachable, becausehubcan't carry a scheme. - Imports.
dist/web.jsimports noagent-deviceand no@e2e-dev/mobile. - Contract and peers. The
BrowserProvidercontract matches, and@e2e-dev/web >=0.11.0already has'attempt'scope. - Gates.
pnpm checkexits 0,pnpm --filter @e2e-dev/testmu run testpasses 106/106, andtest:scriptspasses.
After you update, I'll merge it. Separately from this PR, tester-army#772 needs another sync with tester-army main, because their tester-army#882 touched the same AGENTS.md list, and I'll do that right after.
…owsers() @e2e-dev/testmu/web exports testmuBrowsers(), a BrowserProvider for TestMu AI (formerly LambdaTest) hosted Chrome and Edge on Windows and macOS. A session starts when its CDP websocket opens and ends when the engine closes it, so the provider only builds the CDP URL from the options and LT_USERNAME / LT_ACCESS_KEY (via the package's testmuCredentials()); it calls no API. - One session per worker slot, or per attempt with scope: 'attempt'. - route /puppeteer (default, raw CDP on every machine) or /playwright-cdp (Playwright label; raw CDP only where TestMu AI's newest backend has rolled out). hub cdp.lambdatest.com. - Sessions are named as testmu()'s: build (default the run id, so a run's device and browser sessions share one build) and sessionName (default e2e-<run id>-<target>-<slot or attempt>); project (default e2e) is sent as LT:Options.project. geoLocation and timezone are options, as on testmu(). - idleTimeout defaults to 600 s. Unknown options, out-of-range values, empty or null strings, and capabilities that set what the provider sets (including browserName, browserVersion and a nested LT:Options) fail with INVALID_CONFIG at config load. - The package root stays device-only; the browser provider lives at @e2e-dev/testmu/web, and @e2e-dev/mobile, @e2e-dev/web and agent-device are optional peers, so neither side's imports or types reach the other. - Docs: integrations/testmu-browsers page with a checked example (docs/examples/web/testmu-browsers.config.ts), nav, card, env, security, browser.mdx, README, AGENTS, skill row; credentials sourcing on both pages. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KoNxaN1YAAP9PwmHtMm1WX
8ca6a64 to
fe91e5f
Compare
|
Thanks, Aman. All four points are in
Two platform issues from my sanity run, not provider bugs, since both reproduce with plain Puppeteer/Playwright: Edge over CDP gets a |
amankansal-lt
left a comment
There was a problem hiding this comment.
Verified at fe91e5fe1:
- No browser-provider text claims
projectgroups sessions any more. /playwright-cdpis documented as rolling out, and/puppeteerstays the default.capabilitiesrefusesbrowserName,browserVersionand nestedLT:Options.- The package root is device-only again.
pnpm checkexits 0, and@e2e-dev/testmupasses 108/108.
The Edge-over-CDP hub 500 is a platform issue (it reproduces without the provider), and it's covered in Limits and the description. Thanks.
What and why
The upstream maintainer closed tester-army#765 (TestMu AI desktop browsers) and asked to consolidate the TestMu AI integration in tester-army#772, which covers devices only. This PR adds the browser side to
@e2e-dev/testmuso tester-army#772 carries both.testmuBrowsers(), exported from@e2e-dev/testmu/web, is aBrowserProviderfor@e2e-dev/web: TestMu AI hosted Chrome and Edge on Windows and macOS, one session per worker slot, or one per attempt withscope: 'attempt'.testmuCredentials()(LT_USERNAME/LT_ACCESS_KEY) and never appear in a log line.testmu()'s conventions:build(default the run id) andsessionName(defaulte2e-<run id>-<target>-<slot or attempt id>) name sessions as the device provider does, so a run's device and browser sessions land in one build.project(defaulte2e) is sent asLT:Options.project, astestmu()sends its own.geoLocationandtimezoneare top-level options, as ontestmu().undefined(sonullfails), and unknown keys are refused. These are the same rules cubic asked for on feat(testmu): add @e2e-dev/testmu device provider tester-army/e2e#772.browserName(Chrome/MicrosoftEdge),browserVersion,platform,route,hub,scope,capabilities(furtherLT:Options).idleTimeoutdefaults to 600 s.capabilitiescannot set what the provider sets (user,accessKey,build,name,project,platform,geoLocation,timezone,browserName,browserVersion, or a nestedLT:Options).route:/puppeteer(default) serves raw CDP on every machine./playwright-cdplabels sessions as Playwright but serves raw CDP only on machines with TestMu AI's newest backend, which is still rolling out, and fails to connect elsewhere.index.ts). The browser provider lives only at@e2e-dev/testmu/web, so a web-only project never loads agent-device or@e2e-dev/mobile, and the root's types never reference@e2e-dev/web.@e2e-dev/mobile,@e2e-dev/webandagent-deviceare now marked optional. Device users already install agent-device explicitly (no published release satisfies the range yet), so nothing changes for them. Without this, a web-onlynpm install @e2e-dev/testmuwould try to resolve the unpublished agent-device range.sequenceDiagram participant W as web engine participant P as testmuBrowsers() participant H as cdp.lambdatest.com W->>P: acquire(request) P-->>W: { id, cdpEndpoint } (caps + LT_* from request.env) W->>H: connectOverCDP(cdpEndpoint) Note over H: socket open = session starts W->>H: close Note over H: socket closed = session ends W->>P: release() (no-op)docs/integrations/testmu-browsers.mdx(options, scopes, routes, recordings, downloads, Limits), with its config sample checked asdocs/examples/web/testmu-browsers.config.ts(registered inscripts/check-docs-examples.ts, like the mobile example), plus the nav, integrations card, environment table, security page,browser.mdx, package README, AGENTS.md and theskills/e2esetup row. Both TestMu AI pages now say where to get the credentials (Account Settings → Password & Security → Username and Access Key).Verified
Ran it locally: yes
pnpm checkpasses (lint, dead code, typecheck, error codes, peer ranges, install scripts, docs).pnpm --filter @e2e-dev/testmu run test: 108/108, of which 35 are new for the browser provider. They cover the URL and capabilities, credentials fromrequest.envonly, everyINVALID_CONFIGcase (includingnullvalues and the reservedcapabilitieskeys), the 600 sidleTimeoutdefault,testmu()-style project/build/session naming, log lines without the key, the/webexport with a device-only root, and 24 worker leases fitting the engine's 16 KB hand-off.@e2e-dev/testmu(pnpm pack) and installed it browser-only into a scratch project one2e0.15.1: npm pulled neitheragent-devicenor@e2e-dev/mobile, and the import came from@e2e-dev/testmu/web./puppeteer(default)<run id>and sessione2e-<run id>-<target>-1/puppeteer,scope: 'attempt'/playwright-cdptimezone: 'UTC+05:30'Asia/Calcutta(+330 min)projectis sent inLT:Optionsthe waytestmu()sends it. The desktop sessions API doesn't return a project field, so the docs only say it is sent, not that the dashboard groups by it.500after about 4 minutes (Chrome connects in about 11 s), so Edge sessions hit e2e's 60 s connect limit.geoLocation: 'DE'exits in Portugal and'FR'in Spain. The option is applied (the default exit is Mumbai), but those exits sit in neighbouring countries.record(), astestmu()does for devices. The web engine supports it, but it needs the desktop sessions API, so it's left for a follow-up.workerscope about 24–30 workers per target fit the engine's 16 KB lease hand-off (documented under Limits).scope: 'attempt'has no such ceiling.LAUNCH_TIMEOUT. The web engine's CDP connect is fixed at 60 s, as the Limits section documents.🤖 Generated with Claude Code
https://claude.ai/code/session_01KoNxaN1YAAP9PwmHtMm1WX