page_object v0.4.0 PageObject.Actions.Visitable

A module wrapper for the visitable action macro

Summary

Macros

Defines a module function that can visit a url with dynamic segments in it. It supports query parameters as additional arguments

Macros

visitable(action_name, url)

Defines a module function that can visit a url with dynamic segments in it. It supports query parameters as additional arguments.

Also generates a method appending _url for asserting that the current_url matches the one derived for the visitable.

## Example

  defmodule DashboardPage do
    use PageObject

    visitable :visit, "http://localhost:4001/:account_id/dashboard"
  end

  # visit http://localhost:4001/1/dashboard
  DashboardPage.visit(account_id: 1)

  # visit http://localhost:4001/1/dashboard?filter="foo"
  DashboardPage.visit(account_id: 1, filter: "foo")

  # assert urls match
  assert current_url = DashboardPage.visit_url(account_id: 1, filter: "foo")