The "visit" pattern is described here:
https://github.com/appfolio/ae_page_objects#adding-a-path
https://github.com/appfolio/ae_page_objects#navigation
An example:
class LoginPage < AePageObjects::Document
path :new_session
end
# navigates to /session/new
login_page = LoginPage.visit
Some pages can be visited by multiple paths. For example:
Capybara.current_session.visit("/autologin/access?token=#{token}")
login_page = AePageObjects.browser.current_window.change_to(LoginPage)
It would be convenient to allow for this scenario while keeping the path specification on the page. Perhaps something like:
class LoginPage < AePageObjects::Document
path :new_session
path :access_autologin
end
# navigates to /session/new
login_page = LoginPage.visit
# navigates to "/autologin/access?token=#{token}"
login_page = LoginPage.visit(token: token, via: :access_autologin)
The second use of visit specifies which path to use via the :via option. All other arguments are forwarded to the configured router.
The "visit" pattern is described here:
https://github.com/appfolio/ae_page_objects#adding-a-path
https://github.com/appfolio/ae_page_objects#navigation
An example:
Some pages can be visited by multiple paths. For example:
It would be convenient to allow for this scenario while keeping the
pathspecification on the page. Perhaps something like:The second use of
visitspecifies which path to use via the:viaoption. All other arguments are forwarded to the configured router.