# `Plushie.Test.Backend.Runtime`
[🔗](https://github.com/plushie-ui/plushie-elixir/blob/v0.7.2/lib/plushie/test/backend/runtime.ex#L1)

Test backend that starts a real Plushie app (Runtime + Bridge).

Starts the full Plushie supervisor tree connected to the shared
SessionPool via a PoolAdapter. All event processing goes through
the real Runtime, giving tests production-equivalent behavior.
Canvas widget state, event transformation, subscriptions, effects,
and scoped IDs all work identically to production.

## Architecture

    Test process
      |
      v
    Backend.Runtime (GenServer)
      |-- owns Plushie supervisor (Bridge + Runtime)
      |-- PoolAdapter connects Bridge <-> SessionPool
      |-- queries go to Runtime.get_model/get_tree
      |-- interactions go to Runtime.interact -> Bridge -> renderer

Windowed sessions wait after interactions, before the backend asks the
renderer for tree hashes. That keeps renderer-backed reads from racing the
last update without adding extra startup work to every session.

## Options

Passed through from `start/2`:

- `:pool` - the SessionPool server (default: `Plushie.TestPool`)
- `:format` - wire format (default: `:msgpack`)
- `:init_arg` - argument passed to the app's `init/1` callback

## Example

    {:ok, pid} = Plushie.Test.Backend.Runtime.start(MyApp, pool: Plushie.TestPool)
    :ok = Plushie.Test.Backend.Runtime.click(pid, "#save")
    model = Plushie.Test.Backend.Runtime.model(pid)
    assert model.saved?
    Plushie.Test.Backend.Runtime.stop(pid)

# `mode`

```elixir
@type mode() :: :mock | :headless | :windowed
```

Renderer mode used by the test backend.

# `t`

```elixir
@type t() :: %Plushie.Test.Backend.Runtime{
  app: module(),
  format: :json | :msgpack,
  mode: mode(),
  plushie_name: atom(),
  pool: GenServer.server(),
  runtime: pid(),
  session_id: String.t(),
  sup: pid()
}
```

# `advance_frame`

# `await_async`

# `canvas_move`

# `canvas_press`

# `canvas_release`

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `click`

# `find`

# `find!`

# `model`

# `move_to`

# `pane_focus_cycle`

# `paste`

# `press`

# `register_effect_stub`

# `release`

# `reset`

# `screenshot`

# `scroll`

# `select`

# `slide`

# `sort`

# `start`

# `stop`

# `submit`

# `toggle`

# `tree`

# `tree_hash`

# `type_key`

# `type_text`

# `unregister_effect_stub`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
