Safe Haskell | None |
---|---|
Language | Haskell2010 |
- 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.
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.