sandwich-webdriver-0.3.0.0: Sandwich integration with Selenium WebDriver
Safe HaskellNone
LanguageHaskell2010

Test.Sandwich.WebDriver.Config

Description

Configuration types for WebDriver servers, Xvfb mode, browser capabilities, etc.

Synopsis

Main options

defaultWdOptions :: 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.).

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.

Accessors for the WebDriver context

getWdOptions :: WebDriver -> WdOptions Source #

Get the WdOptions associated with the WebDriver.

getDisplayNumber :: WebDriver -> Maybe Int Source #

Get the X11 display number associated with the WebDriver. Only present if running in RunInXvfb mode.

getDownloadDirectory :: WebDriver -> FilePath Source #

Get the configured download directory for the WebDriver.

getWebDriverName :: WebDriver -> String Source #

Get the name of the WebDriver. This corresponds to the folder that will be created to hold the log files for the WebDriver.

getXvfbSession :: WebDriver -> Maybe XvfbSession Source #

Get the Xvfb session associated with the WebDriver, if present.

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

data HeadlessConfig Source #

Configuration for a headless browser.

defaultHeadlessConfig :: HeadlessConfig Source #

Default headless config.

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

Resolution for the headless browser, specified as (width, height). Defaults to (1920, 1080).

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.

Types

BrowserDependencies

type HasBrowserDependencies context = HasLabel context "browserDependencies" BrowserDependencies Source #

Xvfb

Miscellaneous

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

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. The Xvfb binary must be installed and on the PATH.