Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype WD a = WD (StateT WDSession IO a)
- runWD :: WDSession -> WD a -> IO a
- runSession :: WebDriverConfig conf => conf -> WD a -> IO a
- finallyClose :: WebDriver wd => wd a -> wd a
- closeOnException :: WebDriver wd => wd a -> wd a
- getSessionHistory :: WDSessionState wd => wd [SessionHistory]
- dumpSessionHistory :: WDSessionStateControl wd => wd a -> wd a
Documentation
A state monad for WebDriver commands.
Instances
MonadFix WD Source # | |
Defined in Test.WebDriver.Monad | |
MonadIO WD Source # | |
Defined in Test.WebDriver.Monad | |
Applicative WD Source # | |
Functor WD Source # | |
Monad WD Source # | |
MonadCatch WD Source # | |
MonadMask WD Source # | |
MonadThrow WD Source # | |
Defined in Test.WebDriver.Monad | |
WebDriver WD Source # | |
Defined in Test.WebDriver.Monad | |
WDSessionState WD Source # | |
Defined in Test.WebDriver.Monad getSession :: WD WDSession Source # putSession :: WDSession -> WD () Source # | |
MonadBaseControl IO WD Source # | |
MonadBase IO WD Source # | |
Defined in Test.WebDriver.Monad | |
type StM WD a Source # | |
runSession :: WebDriverConfig conf => conf -> WD a -> IO a Source #
Executes a WD
computation within the IO
monad, automatically creating a new session beforehand.
NOTE: session is not automatically closed when complete. If you want this behavior, use finallyClose
.
Example:
runSessionThenClose action = runSession myConfig . finallyClose $ action
finallyClose :: WebDriver wd => wd a -> wd a Source #
A finalizer ensuring that the session is always closed at the end of
the given WD
action, regardless of any exceptions.
closeOnException :: WebDriver wd => wd a -> wd a Source #
Exception handler that closes the session when an asynchronous exception is thrown, but otherwise leaves the session open if the action was successful.
getSessionHistory :: WDSessionState wd => wd [SessionHistory] Source #
Gets the command history for the current session.
dumpSessionHistory :: WDSessionStateControl wd => wd a -> wd a Source #
Prints a history of API requests to stdout after computing the given action.