webdriver-0.1: a Haskell client for the Selenium WebDriver protocol

Safe HaskellSafe-Infered

Test.WebDriver.Commands.Wait

Contents

Synopsis

Expected conditions

data ExpectFailed Source

An exception representing a failure of an expected condition.

expect :: Bool -> WD ()Source

An expected condition. This function allows you to express assertions in your explicit wait. This function raises ExpectFailed if the given boolean is False, and otherwise does nothing.

unexpected :: WD aSource

Raises ExpectFailed.

Convenience functions

expectAny :: (a -> WD Bool) -> [a] -> WD ()Source

expectAll :: (a -> WD Bool) -> [a] -> WD ()Source

(<||>) :: Monad m => m Bool -> m Bool -> m BoolSource

Lifted boolean or

(<&&>) :: Monad m => m Bool -> m Bool -> m BoolSource

Lifted boolean and

Wait on expected conditions

waitUntil :: Double -> WD a -> WD aSource

Wait until either the given action succeeds or the timeout is reached. The action will be retried every .25 seconds until no ExpectFailed or NoSuchElement exceptions occur. The timeout value is expressed in seconds.

waitUntil' :: Int -> Double -> WD a -> WD aSource

Similar to waitUntil but allows you to also specify the poll frequency of the WD action. The frequency is expressed as an integer in microseconds.

waitWhile :: Double -> WD a -> WD ()Source

Like waitWhile, but retries the action until it fails or until the timeout is exceeded.

waitWhile' :: Int -> Double -> WD a -> WD ()Source

Like waitWhile', but retries the action until it either fails or until the timeout is exceeded.