sandwich-webdriver-0.1.0.6: Sandwich integration with Selenium WebDriver
Safe HaskellNone
LanguageHaskell2010

Test.Sandwich.WebDriver

Synopsis

Introducing a WebDriver server

introduceWebDriver :: BaseMonadContext m context => WdOptions -> SpecFree (LabelValue "webdriver" WebDriver :> context) m () -> SpecFree context m () Source #

This is the main introduce method for creating a WebDriver.

introduceWebDriverOptions :: forall a context m. (BaseMonadContext m context, HasCommandLineOptions context a) => WdOptions -> SpecFree (LabelValue "webdriver" WebDriver :> context) m () -> SpecFree context m () Source #

Same as introduceWebDriver, but merges command line options into the WdOptions.

Running an example in a given session

withSession :: forall m context a. WebDriverMonad m context => Session -> ExampleT (ContextWithSession context) m a -> ExampleT context m a Source #

Run a given example using a given Selenium session.

withSession1 :: WebDriverMonad m context => ExampleT (ContextWithSession context) m a -> ExampleT context m a Source #

Convenience function. withSession1 = withSession "session1"

withSession2 :: WebDriverMonad m context => ExampleT (ContextWithSession context) m a -> ExampleT context m a Source #

Convenience function. withSession2 = withSession "session2"

Managing sessions

getSessions :: (WebDriverMonad m context, MonadReader context m, HasLabel context "webdriver" WebDriver) => m [Session] Source #

Get all existing session names

closeCurrentSession :: (HasCallStack, MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m, MonadReader context m, HasLabel context "webdriver" WebDriver, HasLabel context "webdriverSession" WebDriverSession) => m () Source #

Close the current session

closeSession :: (HasCallStack, MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => Session -> WebDriver -> m () Source #

Close the given sessions

closeAllSessionsExcept :: (HasCallStack, MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => [Session] -> WebDriver -> m () Source #

Close all sessions except those listed

type Session = String Source #

Session is just a String name.

Lower-level allocation functions

allocateWebDriver :: (HasBaseContext context, BaseMonad m) => WdOptions -> ExampleT context m WebDriver Source #

Allocate a WebDriver using the given options.

allocateWebDriver' :: FilePath -> WdOptions -> IO WebDriver Source #

Allocate a WebDriver using the given options and putting logs under the given path.

cleanupWebDriver :: (HasBaseContext context, BaseMonad m) => WebDriver -> ExampleT context m () Source #

Clean up the given WebDriver.

cleanupWebDriver' :: WebDriver -> IO () Source #

Clean up the given WebDriver without logging.

Re-exports