-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Wrapper around the webdriver package that automatically manages Selenium -- -- Please see the README on GitHub at -- https://github.com/gtollini/webdriver-wrapper#readme @package webdriver-wrapper @version 0.2.0.1 module Test.WebDriverWrapper.Constants -- | Where chromedriver initially gets unziped to chromeDriverArchiveDirectory :: IO FilePath -- | Intermediary path for the compressed version of chromedriver. Inside -- downloadPath. chromeDriverArchivePath :: IO FilePath -- | Index for chromeDriverVersionsUrl, which provides a list of -- urls where each platform is represented by an entry. If the platform -- is not identified, linux64's index is used. chromeDriverArchIndex :: Int -- | API to get chromedriver's download url. chromeDriverVersionsUrl :: String -- | Path for chromedriver. Inside downloadPath. chromeDriverPath :: IO FilePath -- | Path for geckodriver. Inside downloadPath. geckoDriverPath :: IO FilePath -- | haskell-webdriver-wrapper directory, created at -- XdgData. defaultPath :: IO FilePath -- | Url to download Selenium from. defaultSeleniumJarUrl :: String -- | Platform this code is running at. The options are: -- -- -- -- If the platform is not identified, linux64 is used. desiredPlatform :: String -- | Url to download geckodriver from. Always the latest version provided -- by geckoDriverVersionSource. getGeckoDriverDownloadUrl :: String -> String -- | API to get geckodriver's latest version. geckoDriverVersionSource :: String -- | Directory named after desiredPlatform, created at the -- defaultPath. downloadPath :: IO FilePath -- | Intermediary path for the compressed version of geckodriver. Inside -- downloadPath. geckoArchivePath :: IO FilePath -- | Archive format for geckodriver's download. .zip for Windows, -- .tar.gz for everyone else. fileFormat :: String -- | Path for selenium.jar. Inside downloadPath. seleniumPath :: IO FilePath -- | Path for Selenium's log file. Inside defaultPath. seleniumLogPath :: IO FilePath module Test.WebDriverWrapper.Helpers -- | Downloads from url at output filepath. download :: String -> FilePath -> IO () -- | Decompresses geckodriver's download, which comes in .zip for -- Windows or .tar.gz for everyone else. Takes in the archive's -- filepath and the output filepath. decompressGecko :: FilePath -> FilePath -> IO () -- | Decompresses a Zip file. Takes in the archive's filepath and the -- output filepath. decompressZip :: FilePath -> FilePath -> IO () -- | Evaluates each IO individually and returns the first one that doesn't -- throw an error. Throws an error if none succeed. evalUntillSuccess :: [IO String] -> IO String module Test.WebDriverWrapper.GeckoDriver -- | Checks if geckodriver is in the downloadPath. If not, -- download it. getGeckoDriverIfNeeded :: IO () module Test.WebDriverWrapper.ChromeDriver -- | Checks if chromedriver is in the downloadPath. If not, -- download it. getChromeDriverIfNeeded :: Maybe FilePath -> IO () instance Data.Aeson.Types.FromJSON.FromJSON Test.WebDriverWrapper.ChromeDriver.ChromeDriverVersion instance Data.Aeson.Types.ToJSON.ToJSON Test.WebDriverWrapper.ChromeDriver.ChromeDriverVersion instance GHC.Generics.Generic Test.WebDriverWrapper.ChromeDriver.ChromeDriverVersion instance GHC.Show.Show Test.WebDriverWrapper.ChromeDriver.ChromeDriverVersion instance Data.Aeson.Types.FromJSON.FromJSON Test.WebDriverWrapper.ChromeDriver.ChromeDriverMain instance Data.Aeson.Types.ToJSON.ToJSON Test.WebDriverWrapper.ChromeDriver.ChromeDriverMain instance GHC.Generics.Generic Test.WebDriverWrapper.ChromeDriver.ChromeDriverMain instance GHC.Show.Show Test.WebDriverWrapper.ChromeDriver.ChromeDriverMain module Test.WebDriverWrapper.Selenium -- | Starts Selenium and waits for its ok message ( "Selenium Server is up -- and running" ) to show up at the log file. Takes in a Browser -- (since it needs to use the correct webdriver). Returns the handles for -- the Selenium process. startSelenium :: Browser -> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) -- | Checks if selenium is in the downloadPath. If not, -- download it. getSeleniumIfNeeded :: IO () -- | The wrapped functions (wrappedRunSession and -- wrappedRunWD) will download Selenium and Firefox's webdriver -- (geckodriver) if they're not already on the downloadPath, then -- start Selenium before running the webdriver equivalent function -- (runSession and runWD). They kill the Selenium process -- at the end of their execution. module Test.WebDriverWrapper -- | Same as runSession, but starts Selenium before execution and -- kills Selenium after execution. Will download Selenium or the -- browser's webdriver (geckodriver or chromedriver) if any is missing. wrappedRunSession :: WDConfig -> WD a -> IO a -- | Runs a function in between starting and killing Selenium. Takes in the -- arguments and the function, in that order. Will download Selenium and -- the Browser's webdriver (geckodriver or chromedriver) if any is -- missing. wrapWebDriverFunction :: Browser -> a -> (a -> IO b) -> IO b -- | Same as runWD, but starts Selenium before execution and kills -- Selenium after execution. Will download Selenium or Firefox's -- webdriver (geckodriver) if any is missing. wrappedFirefoxRunWD :: WDSession -> WD a -> IO a -- | Same as runWD, but starts Selenium before execution and kills -- Selenium after execution. Will download Selenium or Chrome's webdriver -- (chromedriver) if any is missing. wrappedChromeRunWD :: WDSession -> WD a -> IO a