sandwich-webdriver-0.2.1.0: Sandwich integration with Selenium WebDriver
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Sandwich.WebDriver.Config

Synopsis

Main options

defaultWdOptions :: FilePath -> WdOptions Source #

The default WdOptions object. You should start with this and modify it using the accessors.

runMode :: WdOptions -> RunMode Source #

How to handle opening the browser (in a popup window, headless, etc.).

seleniumToUse :: WdOptions -> SeleniumToUse Source #

Which Selenium server JAR file to use.

chromeBinaryPath :: WdOptions -> Maybe FilePath Source #

Which chrome binary to use.

chromeDriverToUse :: WdOptions -> ChromeDriverToUse Source #

Which chromedriver executable to use.

firefoxBinaryPath :: WdOptions -> Maybe FilePath Source #

Which firefox binary to use.

geckoDriverToUse :: WdOptions -> GeckoDriverToUse Source #

Which geckodriver executable to use.

capabilities :: WdOptions -> Capabilities Source #

The WebDriver capabilities to use.

httpManager :: WdOptions -> Maybe Manager Source #

HTTP manager for making requests to Selenium. If not provided, one will be created for each session.

httpRetryCount :: WdOptions -> Int Source #

Number of times to retry an HTTP request if it times out.

saveSeleniumMessageHistory :: WdOptions -> WhenToSave Source #

When to save a record of Selenium requests and responses.

Run mode constructors

data RunMode Source #

Headless and Xvfb modes are useful because they allow you to run tests in the background, without popping up browser windows. This is useful for development or for running on a CI server, and is also more reproducible since the screen resolution can be fixed. In addition, Xvfb mode allows videos to be recorded of tests.

Constructors

Normal

Normal Selenium behavior; will pop up a web browser.

RunHeadless HeadlessConfig

Run with a headless browser. Supports screenshots but videos will be black.

RunInXvfb XvfbConfig

Run inside Xvfb so that tests run in their own X11 display. xvfb-run script must be installed and on the PATH.

Xvfb mode

defaultXvfbConfig :: XvfbConfig Source #

Default Xvfb settings.

xvfbResolution :: XvfbConfig -> Maybe (Int, Int) Source #

Resolution for the virtual screen. Defaults to (1920, 1080)

xvfbStartFluxbox :: XvfbConfig -> Bool Source #

Whether to start fluxbox window manager to go with the Xvfb session. fluxbox must be on the path

Headless mode

defaultHeadlessConfig :: HeadlessConfig Source #

Default headless config.

headlessResolution :: HeadlessConfig -> Maybe (Int, Int) Source #

Resolution for the headless browser. Defaults to (1920, 1080)

Binary fetching options

data SeleniumToUse Source #

How to obtain the Selenium server JAR file.

Constructors

DownloadSeleniumFrom String

Download selenium from the given URL to the toolsRoot

DownloadSeleniumDefault

Download selenium from a default location to the toolsRoot

UseSeleniumAt FilePath

Use the JAR file at the given path

Instances

Instances details
Show SeleniumToUse Source # 
Instance details

Defined in Test.Sandwich.WebDriver.Internal.Types

data ChromeDriverToUse Source #

How to obtain the chromedriver binary.

Constructors

DownloadChromeDriverFrom String

Download chromedriver from the given URL to the toolsRoot

DownloadChromeDriverVersion ChromeDriverVersion

Download the given chromedriver version to the toolsRoot

DownloadChromeDriverAutodetect (Maybe FilePath)

Autodetect chromedriver to use based on the Chrome version and download it to the toolsRoot Pass the path to the Chrome binary, or else it will be found by looking for google-chrome on the PATH.

UseChromeDriverAt FilePath

Use the chromedriver at the given path

data GeckoDriverToUse Source #

How to obtain the geckodriver binary.

Constructors

DownloadGeckoDriverFrom String

Download geckodriver from the given URL to the toolsRoot

DownloadGeckoDriverVersion GeckoDriverVersion

Download the given geckodriver version to the toolsRoot

DownloadGeckoDriverAutodetect (Maybe FilePath)

Autodetect geckodriver to use based on the Gecko version and download it to the toolsRoot Pass the path to the Firefox binary, or else it will be found by looking for firefox on the PATH.

UseGeckoDriverAt FilePath

Use the geckodriver at the given path

Miscellaneous constructors

data WhenToSave Source #

Constructors

Always 
OnException 
Never 

Instances

Instances details
Show WhenToSave Source # 
Instance details

Defined in Test.Sandwich.WebDriver.Internal.Types

Eq WhenToSave Source # 
Instance details

Defined in Test.Sandwich.WebDriver.Internal.Types

Manually obtaining binaries

obtainSelenium :: (MonadIO m, MonadLogger m) => FilePath -> SeleniumToUse -> m (Either Text FilePath) Source #

Manually obtain a Selenium server JAR file, according to the SeleniumToUse policy, storing it under the provided FilePath if necessary and returning the exact path.

obtainChromeDriver :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadMask m) => FilePath -> ChromeDriverToUse -> m (Either Text FilePath) Source #

Manually obtain a chromedriver binary, according to the ChromeDriverToUse policy, storing it under the provided FilePath if necessary and returning the exact path.

obtainGeckoDriver :: (MonadIO m, MonadLogger m, MonadBaseControl IO m) => FilePath -> GeckoDriverToUse -> m (Either Text FilePath) Source #

Manually obtain a geckodriver binary, according to the GeckoDriverToUse policy, storing it under the provided FilePath if necessary and returning the exact path.

Browser capabilities

chromeCapabilities :: Maybe FilePath -> Capabilities Source #

Default capabilities for regular Chrome. Has the "browser" log level to ALL so that tests can collect browser logs.

headlessChromeCapabilities :: Maybe FilePath -> Capabilities Source #

Default capabilities for headless Chrome.

firefoxCapabilities :: Maybe FilePath -> Capabilities Source #

Default capabilities for regular Firefox.

headlessFirefoxCapabilities :: Maybe FilePath -> Capabilities Source #

Default capabilities for headless Firefox.