module Test.WebDriver.IO where

import Control.Concurrent (threadDelay)
import Control.Monad.IO.Class (liftIO, MonadIO)
import Test.WebDriver
import Test.WebDriver.Class (WebDriver)


sleepIO :: Double -> IO ()
sleepIO :: Double -> IO ()
sleepIO Double
seconds = Int -> IO ()
Control.Concurrent.threadDelay (Double -> Int
forall b. Integral b => Double -> b
forall a b. (RealFrac a, Integral b) => a -> b
round (Double
seconds Double -> Double -> Double
forall a. Num a => a -> a -> a
* Double
1e6))

sleepWD :: (MonadIO wd, WebDriver wd) => Double -> wd ()
sleepWD :: forall (wd :: * -> *).
(MonadIO wd, WebDriver wd) =>
Double -> wd ()
sleepWD = IO () -> wd ()
forall a. IO a -> wd a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> wd ()) -> (Double -> IO ()) -> Double -> wd ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Double -> IO ()
sleepIO

printWD :: Show s => s -> WD ()
printWD :: forall s. Show s => s -> WD ()
printWD = IO () -> WD ()
forall a. IO a -> WD a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> WD ()) -> (s -> IO ()) -> s -> WD ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. s -> IO ()
forall a. Show a => a -> IO ()
print