Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class (Monad m, Applicative m) => WDSessionState m where
- getSession :: m WDSession
- putSession :: WDSession -> m ()
- type WDSessionStateIO s = (WDSessionState s, MonadBase IO s)
- type WDSessionStateControl s = (WDSessionState s, MonadBaseControl IO s)
- modifySession :: WDSessionState s => (WDSession -> WDSession) -> s ()
- withSession :: WDSessionStateControl m => WDSession -> m a -> m a
- data WDSession = WDSession {}
- mostRecentHistory :: WDSession -> Maybe SessionHistory
- mostRecentHTTPRequest :: WDSession -> Maybe Request
- newtype SessionId = SessionId Text
- data SessionHistory = SessionHistory {}
- type SessionHistoryConfig = SessionHistory -> [SessionHistory] -> [SessionHistory]
- noHistory :: SessionHistoryConfig
- unlimitedHistory :: SessionHistoryConfig
- onlyMostRecentHistory :: SessionHistoryConfig
- withRequestHeaders :: WDSessionStateControl m => RequestHeaders -> m a -> m a
- withAuthHeaders :: WDSessionStateControl m => m a -> m a
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.
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
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.
modifySession :: WDSessionState s => (WDSession -> WDSession) -> s () Source #
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
The local state of a WebDriver session. This structure is passed
implicitly through all WD
computations
WDSession | |
|
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.
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.
data SessionHistory Source #
Instances
Show SessionHistory Source # | |
Defined in Test.WebDriver.Session.History showsPrec :: Int -> SessionHistory -> ShowS # show :: SessionHistory -> String # showList :: [SessionHistory] -> ShowS # |
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.
unlimitedHistory :: SessionHistoryConfig Source #
Keep unlimited history
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.