Repository navigation
Feature Request: Multi-Actor Test Support for Concurrent User Sessions #991
Copy link
Copy link
Open
Description
Preface
I am willing to build this. Wondering if the community is enticed or open about it.
Problem
When testing modern web applications with social/collaborative features, tests often require multiple authenticated users interacting with each other. For example:
- User A sends a message to User B
- User B checks their inbox and sees User A's message
- User B replies
- User A receives the reply notification
Currently, Tavern's stage-based execution model assumes a single authentication context per test. While you can technically swap headers between stages, this approach is awkward and doesn't scale well for complex multi-user scenarios.
Proposed Solution
Introduce an actors concept that allows defining multiple authenticated contexts:
actors:
user_a:
headers:
Authorization: "Bearer {user_a_token}"
user_b:
headers:
Authorization: "Bearer {user_b_token}"
stages:
- name: User A sends message
actor: user_a
request:
url: "{base_url}/messaging/send"
method: POST
json:
to: !actor user_b.id
body: "Hello"
response:
status_code: 200
- name: User B checks inbox
actor: user_b
request:
url: "{base_url}/messaging/inbox"
method: GET
response:
status_code: 200
json:
messages:
- from: !actor user_a.id
Key Benefits
- Clarity because each stage explicitly declares which actor performs the action
- Maintainability because actor credentials defined once, referenced everywhere
- Could later support parallel stage execution for true concurrency testing
Use Cases This Would Enable
- Messaging/chat applications
- Marketplace transactions (buyer/seller flows)
- Social features (follow/unfollow, likes, comments)
- Collaborative editing
- Permission/visibility testing
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity