# `Foundry.TestScenario.LiveViewHook`

Phoenix LiveView on_mount hook that registers the LiveView channel PID
with its associated test process PID during test execution.

Reads the test PID from the Phoenix session if present (set by test helpers).
The PID is then used by AshTracer to forward action events back to the test.
Also records the page mount as an entry event in the scenario trace.

Add to router via:
  live_session :default, on_mount: [Foundry.TestScenario.LiveViewHook]

# `on_mount`

---

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