View Source Pages (Pages v0.5.3)

Entry point for interacting with pages.

Pages are built around Pages.Driver.t/0 structs. Drivers hold state about the current connection, implement @behavior Pages.Driver and must implement the String.Chars protocol to transform themselves into HTML.

available-drivers

Available drivers

Link to this section Summary

Functions

Simulates clicking on an element at selector with title title. Set the method param to :post to click on a link that has data-method=post.

Instantiates a new page.

Re-renders the page

Submits a form without specifying any attributes.

Fills in a form with attributes and submits it.

Fills in a form with attributes without submitting it.

Visits path.

Link to this section Types

@type attrs_t() :: Keyword.t() | map()
@type http_method() :: :get | :post
@type page_type_t() :: :live_view

Link to this section Functions

Link to this function

click(page, method \\ :get, title, selector)

View Source

Simulates clicking on an element at selector with title title. Set the method param to :post to click on a link that has data-method=post.

@spec new(Plug.Conn.t()) :: Pages.Driver.t()

Instantiates a new page.

@spec rerender(Pages.Driver.t()) :: Pages.Driver.t()

Re-renders the page

Link to this function

submit_form(page, selector)

View Source

Submits a form without specifying any attributes.

Link to this function

submit_form(page, selector, schema, attrs)

View Source
@spec submit_form(Pages.Driver.t(), HtmlQuery.Css.selector(), atom(), attrs_t()) ::
  Pages.Driver.t()

Fills in a form with attributes and submits it.

Link to this function

update_form(page, selector, schema, attrs)

View Source
@spec update_form(Pages.Driver.t(), HtmlQuery.Css.selector(), atom(), attrs_t()) ::
  Pages.Driver.t()

Fills in a form with attributes without submitting it.

@spec visit(Pages.Driver.t(), Path.t()) :: Pages.Driver.t()

Visits path.

Link to this function

with_child_component(page, child_id, fun)

View Source
@spec with_child_component(
  Pages.Driver.t(),
  child_id :: binary(),
  (Pages.Driver.t() -> term())
) ::
  Pages.Driver.t()