| Safe Haskell | None |
|---|
Test.WebDriver.Monad
- 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
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
Instances
| Monad WD | |
| Functor WD | |
| Applicative WD | |
| MonadCatchIO WD | |
| MonadIO WD | |
| WebDriver WD | |
| SessionState WD | |
| MonadBase IO WD | |
| MonadBaseControl IO WD |
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.