Skip to content

Add coordinated multi-actor browser scenarios #1899

Closed

Description

@chubes4

Problem

WP Codebox recipes can provision multiple fixture users and persisted user sessions, but browser execution is serial and each browser command owns a single Playwright context/page. This prevents deterministic testing of concurrent authenticated workflows such as overlapping edits and saves.

Downstream workloads currently have to invent application-specific orchestration, which loses reusable scheduling, replay, and artifact guarantees. Gutenberg PR WordPress/gutenberg#79020 is the immediate motivating case.

Proposed contract

Add a generic browser-scenario primitive that:

  • declares named actors bound explicitly to recipe user sessions
  • keeps an isolated browser context/page per actor
  • executes a seeded, deterministic schedule
  • supports named barriers for coordinated progress
  • supports bounded request gates for delay, release, retry, and out-of-order response schedules
  • records actor actions, barrier transitions, request timing/order, seed, and replay inputs
  • emits per-actor screenshots, traces, console/network evidence, and final scenario state
  • tears down all contexts and gates deterministically on success or failure

Acceptance criteria

  1. A recipe can run at least two authenticated actors against one WordPress runtime.
  2. A deterministic test proves both actors can pause at a barrier and resume in the declared order.
  3. A deterministic test proves one actor request can be held and released after another actor action.
  4. Failure and timeout paths identify the actor/barrier/gate and still persist replayable artifacts.
  5. Existing single-browser recipe behavior remains unchanged.
  6. The public schema, runtime types, validation, examples, and focused tests describe the contract without Gutenberg-specific concepts.

Downstream proof

Use the primitive to model concurrent note authors, stale saves, retries, and convergence for WordPress/gutenberg#79020.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions