LiveView HTML extraction for snapshot testing.
Renders Phoenix.LiveViewTest.View and Phoenix.LiveViewTest.Element
structs to HTML for accessibility testing.
This module communicates with the LiveView test proxy to extract the current rendered HTML, including all nested LiveView components.
Usage
This module is used automatically when you call html_snapshot/2 with
a LiveView test view or element. You typically don't need to call it directly.
Configuration
Can be mocked via the :live_view_mod config key:
Application.put_env(:excessibility, :live_view_mod, MyMockLiveView)
Summary
Functions
Extracts assigns from a LiveView test view.
Renders a LiveView test view or element to HTML.
Functions
Extracts assigns from a LiveView test view.
Returns {:ok, assigns} if successful, {:error, reason} otherwise.
Reads the assigns from the LiveView channel process state rather than
the test client proxy — the proxy has no handle_call/3 clause for
state introspection, so asking it would crash it and, through the test
process link, the calling test. Assigns metadata is best-effort, so any
failure here degrades to an error tuple instead of raising.
Renders a LiveView test view or element to HTML.
Parameters
Returns
The rendered HTML as a Floki-parsed tree.