Safe Haskell | None |
---|
- newtype WD a = WD (StateT WDSession IO a)
- runWD :: WDSession -> WD a -> IO a
- runSession :: WDSession -> Capabilities -> WD a -> IO a
- withSession :: WDSession -> WD a -> WD a
- finallyClose :: WebDriver wd => wd a -> wd a
- closeOnException :: WebDriver wd => wd a -> wd a
- dumpSessionHistory :: (MonadIO wd, WebDriver wd) => wd a -> wd a
Documentation
A monadic interface to the WebDriver server. This monad is simply a
state monad transformer over IO
, threading session information between sequential webdriver commands
runSession :: WDSession -> Capabilities -> WD a -> IO aSource
Like runWD
, but automatically creates a session beforehand and closes it
afterwards. This is a very common use case.
withSession :: WDSession -> WD a -> WD aSource
finallyClose :: WebDriver wd => wd a -> wd aSource
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 aSource
A variant of finallyClose
that only closes the session when an
asynchronous exception is thrown, but otherwise leaves the session open
if the action was successful.
dumpSessionHistory :: (MonadIO wd, WebDriver wd) => wd a -> wd aSource
Can be called before closeOnException
to get more information on
stdout. about what was going wrong. (Note that the Show
instances in package HTTP are not very generous with the Response
and Request
type. You might want to write your own variant of
this function.)