Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- introduceWebDriver :: BaseMonadContext m context => WdOptions -> SpecFree (LabelValue "webdriver" WebDriver :> context) m () -> SpecFree context m ()
- introduceWebDriverOptions :: forall a context m. (BaseMonadContext m context, HasCommandLineOptions context a) => WdOptions -> SpecFree (LabelValue "webdriver" WebDriver :> context) m () -> SpecFree context m ()
- addCommandLineOptionsToWdOptions :: CommandLineOptions a -> WdOptions -> WdOptions
- withSession :: forall m context a. WebDriverMonad m context => Session -> ExampleT (ContextWithSession context) m a -> ExampleT context m a
- withSession1 :: WebDriverMonad m context => ExampleT (ContextWithSession context) m a -> ExampleT context m a
- withSession2 :: WebDriverMonad m context => ExampleT (ContextWithSession context) m a -> ExampleT context m a
- getSessions :: (WebDriverMonad m context, MonadReader context m, HasLabel context "webdriver" WebDriver) => m [Session]
- closeCurrentSession :: (HasCallStack, MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m, MonadReader context m, HasLabel context "webdriver" WebDriver, HasLabel context "webdriverSession" WebDriverSession) => m ()
- closeSession :: (HasCallStack, MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => Session -> WebDriver -> m ()
- closeAllSessions :: (HasCallStack, MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => WebDriver -> m ()
- closeAllSessionsExcept :: (HasCallStack, MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => [Session] -> WebDriver -> m ()
- type Session = String
- allocateWebDriver :: (HasBaseContext context, BaseMonad m) => WdOptions -> ExampleT context m WebDriver
- allocateWebDriver' :: FilePath -> WdOptions -> IO WebDriver
- cleanupWebDriver :: (HasBaseContext context, BaseMonad m) => WebDriver -> ExampleT context m ()
- cleanupWebDriver' :: WebDriver -> IO ()
- module Test.Sandwich.WebDriver.Class
- module Test.Sandwich.WebDriver.Config
- module Test.Sandwich.WebDriver.Types
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
.
addCommandLineOptionsToWdOptions :: CommandLineOptions a -> WdOptions -> WdOptions Source #
Merge the options from the CommandLineOptions
into some 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
closeAllSessions :: (HasCallStack, MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => WebDriver -> m () Source #
Close all sessions
closeAllSessionsExcept :: (HasCallStack, MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => [Session] -> WebDriver -> m () Source #
Close all sessions except those listed
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.