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 -> rendererWindowed 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'sinit/1callback
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)
Summary
Functions
Returns a specification to start this module under a supervisor.