webdriver-0.9.0.1: a Haskell client for the Selenium WebDriver protocol

Safe HaskellNone
LanguageHaskell2010

Test.WebDriver.Session

Contents

Synopsis

WDSessionState class

class (Monad m, Applicative m) => WDSessionState m where Source #

A class for monads that carry a WebDriver session with them. The MonadBaseControl superclass is used for exception handling through the lifted-base package.

Methods

getSession :: m WDSession Source #

Retrieves the current session state of the monad

putSession :: WDSession -> m () Source #

Sets a new session state for the monad

Instances
WDSessionState WD Source # 
Instance details

Defined in Test.WebDriver.Monad

WDSessionState m => WDSessionState (MaybeT m) Source # 
Instance details

Defined in Test.WebDriver.Session

WDSessionState m => WDSessionState (ListT m) Source # 
Instance details

Defined in Test.WebDriver.Session

WDSessionState m => WDSessionState (ExceptT r m) Source # 
Instance details

Defined in Test.WebDriver.Session

(Monoid w, WDSessionState m) => WDSessionState (WriterT w m) Source # 
Instance details

Defined in Test.WebDriver.Session

WDSessionState m => WDSessionState (StateT s m) Source # 
Instance details

Defined in Test.WebDriver.Session

(Error e, WDSessionState m) => WDSessionState (ErrorT e m) Source # 
Instance details

Defined in Test.WebDriver.Session

WDSessionState m => WDSessionState (IdentityT m) Source # 
Instance details

Defined in Test.WebDriver.Session

WDSessionState m => WDSessionState (StateT s m) Source # 
Instance details

Defined in Test.WebDriver.Session

(Monoid w, WDSessionState m) => WDSessionState (WriterT w m) Source # 
Instance details

Defined in Test.WebDriver.Session

WDSessionState m => WDSessionState (ReaderT r m) Source # 
Instance details

Defined in Test.WebDriver.Session

(Monoid w, WDSessionState wd) => WDSessionState (RWST r w s wd) Source # 
Instance details

Defined in Test.WebDriver.Session

Methods

getSession :: RWST r w s wd WDSession Source #

putSession :: WDSession -> RWST r w s wd () Source #

(Monoid w, WDSessionState m) => WDSessionState (RWST r w s m) Source # 
Instance details

Defined in Test.WebDriver.Session

Methods

getSession :: RWST r w s m WDSession Source #

putSession :: WDSession -> RWST r w s m () Source #

type WDSessionStateIO s = (WDSessionState s, MonadBase IO s) Source #

Constraint synonym for the common pairing of WDSessionState and MonadBase IO.

type WDSessionStateControl s = (WDSessionState s, MonadBaseControl IO s) Source #

Constraint synonym for another common pairing of WDSessionState and MonadBaseControl IO. This is commonly used in library types to indicate use of lifted exception handling.

withSession :: WDSessionStateControl m => WDSession -> m a -> m a Source #

Locally sets a session state for use within the given action. The state of any outside action is unaffected by this function. This function is useful if you need to work with multiple sessions simultaneously.

WebDriver sessions

data WDSession Source #

The local state of a WebDriver session. This structure is passed implicitly through all WD computations

Constructors

WDSession 

Fields

mostRecentHistory :: WDSession -> Maybe SessionHistory Source #

The most recent SessionHistory entry recorded by this session, if any.

mostRecentHTTPRequest :: WDSession -> Maybe Request Source #

The most recent HTTP request issued by this session, if any.

newtype SessionId Source #

An opaque identifier for a WebDriver session. These handles are produced by the server on session creation, and act to identify a session in progress.

Constructors

SessionId Text 

SessionHistoryConfig options

type SessionHistoryConfig = SessionHistory -> [SessionHistory] -> [SessionHistory] Source #

A function used by wdHistoryConfig to append new entries to session history.

noHistory :: SessionHistoryConfig Source #

No session history is saved.

onlyMostRecentHistory :: SessionHistoryConfig Source #

Saves only the most recent history

Using custom HTTP request headers

withRequestHeaders :: WDSessionStateControl m => RequestHeaders -> m a -> m a Source #

Set a temporary list of custom RequestHeaders to use within the given action. All previous custom headers are temporarily removed, and then restored at the end.

withAuthHeaders :: WDSessionStateControl m => m a -> m a Source #

Makes all webdriver HTTP requests in the given action use the session's auth headers, typically configured by setting the wdAuthHeaders config. This is useful if you want to temporarily use the same auth headers you used for session creation with other HTTP requests.