Packages

Phoenix test harness with one API across static, LiveView, and browser drivers

Current section

Files

Jump to
cerberus lib cerberus session.ex
Raw

lib/cerberus/session.ex

defprotocol Cerberus.Session do
@moduledoc "Runtime session access protocol used by Cerberus drivers."
@type observed :: %{optional(String.t() | atom()) => term()}
@type scope_value :: String.t() | observed() | nil
@type transition :: observed()
@type operation ::
:visit
| :click
| :fill_in
| :select
| :choose
| :check
| :uncheck
| :upload
| :submit
| :assert_has
| :refute_has
| :assert_path
| :refute_path
| :unwrap
@type result :: %{
op: operation(),
observed: observed() | nil,
transition: transition() | nil
}
@type last_result :: result() | nil
@type t :: struct()
@spec current_path(t()) :: String.t() | nil
def current_path(session)
@spec scope(t()) :: scope_value()
def scope(session)
@spec with_scope(t(), scope_value()) :: t()
def with_scope(session, scope)
@spec last_result(t()) :: last_result()
def last_result(session)
end