feat: add MultiActorSession for coordinated multi-user browser testing#2
Merged
feat: add MultiActorSession for coordinated multi-user browser testing#2
Conversation
Enable multi-user browser tests where different roles (admin, partner, user) interact with the same application with isolated auth state. Each actor gets its own BrowserContext (separate cookies/localStorage) while sharing the same Browser instance. Consumers orchestrate with standard async/await for sequential flows and Promise.all() for parallel. - MultiActorSession.create() — builds isolated contexts per actor - Actor.run() — delegates to AgentRunner, accumulates results - session.parallel() — concurrent execution with named result Map - session.close() — idempotent cleanup with AggregateError on failures - Partial creation failure cleanup (setup hook throws → all contexts closed) - Config merging: shared agentConfig + per-actor overrides - onTurn callback prefixed with actor name for unified logging - Raw page/context/driver access for hybrid scripted+agent flows
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.
Summary
MultiActorSessionandActorclasses for coordinated multi-user browser testingBrowserContext(separate cookies, localStorage, auth state) while sharing the sameBrowserinstanceasync/awaitfor sequential flows andPromise.all()/session.parallel()for concurrent executionUsage
Test plan
npx tsc --noEmit— zero type errorsnpx vitest run tests/multi-actor.test.ts— 22/22 passnpx vitest run— 79/79 pass (zero regressions)npx tsc— dist output includesmulti-actor.{js,d.ts}🤖 Generated with Claude Code