| Copyright | 2018 Automattic Inc. |
|---|---|
| License | GPL-3 |
| Maintainer | Nathan Bloomfield (nbloomf@gmail.com) |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Test.Tasty.WebDriver.Config
Contents
Description
- data DriverName
- newtype RemoteEndPool = RemoteEndPool {}
- addRemoteEndForDriver :: DriverName -> RemoteEnd -> RemoteEndPool -> RemoteEndPool
- getRemoteEndForDriver :: DriverName -> RemoteEndPool -> (RemoteEndPool, Maybe (Maybe RemoteEnd))
- data RemoteEnd = RemoteEnd {}
- parseRemoteEnd :: String -> Either String RemoteEnd
- parseRemoteEndConfig :: String -> Either String RemoteEndPool
- parseRemoteEndOption :: String -> Either String RemoteEndPool
- parseOptionWithArgument :: String -> [String] -> Maybe (Maybe String)
Documentation
newtype RemoteEndPool Source #
Pool of remote end connections per driver.
Constructors
| RemoteEndPool | |
Fields | |
Instances
addRemoteEndForDriver :: DriverName -> RemoteEnd -> RemoteEndPool -> RemoteEndPool Source #
Push a remote end to the pool stack for a given driver.
getRemoteEndForDriver :: DriverName -> RemoteEndPool -> (RemoteEndPool, Maybe (Maybe RemoteEnd)) Source #
Attempt to pop a remote end from the pool stack for a given driver. Returns the new pool, whether or not a remote end was popped. Returns a `Just Just` if a remote end was found, a `Just Nothing` if the driver has an empty stack of remotes, and Nothing if the pool is undefined for the driver.
Representation of a remote end connection.
Constructors
| RemoteEnd | |
Fields
| |
Parsing
parseRemoteEnd :: String -> Either String RemoteEnd Source #
Parse a single remote end URI. Must include the scheme (http:/ or https:/) even though this is redundant.
parseRemoteEndConfig :: String -> Either String RemoteEndPool Source #
Parse a remote end config file. This file consists of 0 or more blocks of the form
DRIVER_NAME - REMOTE_END_URI - REMOTE_END_URI
where DRIVER_NAME is either geckodriver or chromedriver and each REMOTE_END_URI is the uri of a WebDriver remote end, including scheme. Blank lines are ignored.
parseRemoteEndOption :: String -> Either String RemoteEndPool Source #
Parse a remote end command line option. This option consists of 0 or more substrings of the form
DRIVER_NAME: REMOTE_END_URI REMOTE_END_URI ...
where DRIVER_NAME is either geckodriver or chromedriver and each REMOTE_END_URI is the uri of a WebDriver remote end, including scheme.
parseOptionWithArgument Source #
Arguments
| :: String | Option to parse for, including hyphen(s). |
| -> [String] | List of command line arguments. |
| -> Maybe (Maybe String) |
Helper function for parsing command line options with a required argument. Assumes long-form option names starting with a hyphen. Note the return type; Just Nothing indicates that the option was not present, while Nothing indicates that the option was present but its required argument was not.