sandwich-webdriver-0.1.0.4: Sandwich integration with Selenium WebDriver
Safe HaskellNone
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

chromeDriverToUse :: WdOptions -> ChromeDriverToUse Source #

Which chromedriver executable 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

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

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

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

Autodetect chromedriver to use based on the Chrome version and download it to the toolsRoot

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

Autodetect geckodriver to use based on the Gecko version and download it to the toolsRoot

UseGeckoDriverAt FilePath

Use the geckodriver at the given path

Miscellaneous constructors

data WhenToSave Source #

Constructors

Always 
OnException 
Never 

Instances

Instances details
Eq WhenToSave Source # 
Instance details

Defined in Test.Sandwich.WebDriver.Internal.Types

Show 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) => 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 :: Capabilities Source #

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

headlessChromeCapabilities :: Capabilities Source #

Default capabilities for headless Chrome.

firefoxCapabilities :: Capabilities Source #

Default capabilities for regular Firefox.

headlessFirefoxCapabilities :: Capabilities Source #

Default capabilities for headless Firefox.