Hound.Helpers.Session

Functions to switch sessions.

Summary

change_session_to(session_name)

When you need more than one browser session, use this function switch to another session. If the session doesn’t exist it a new one will be created for you. All further commands will then run in the session you switched to

change_to_default_session()

When running multiple browser sessions, calling this function will switch to the default browser session

in_browser_session(session_name, func)

Execute commands in a seperate browser session

Functions

change_session_to(session_name)

When you need more than one browser session, use this function switch to another session. If the session doesn’t exist it a new one will be created for you. All further commands will then run in the session you switched to.


# Pass any name to the session to refer to it later.
change_session_to("random-session")

The name can be an atom or a string. The default session created is called :default.

change_to_default_session()

When running multiple browser sessions, calling this function will switch to the default browser session.


change_to_default_session

# is the same as calling
change_session_to(:default)


in_browser_session(session_name, func)

Execute commands in a seperate browser session.


in_browser_session "another_user" do
  navigate_to "http://example.com"
  click({:id, "announcement"})
end