| Copyright | 2018 Automattic Inc. |
|---|---|
| License | GPL-3 |
| Maintainer | Nathan Bloomfield (nbloomf@gmail.com) |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Test.Tasty.WebDriver.Config
Contents
Description
Synopsis
- data DriverName
- newtype RemoteEndPool = RemoteEndPool {}
- addRemoteEndForDriver :: DriverName -> RemoteEnd -> RemoteEndPool -> RemoteEndPool
- getRemoteEndForDriver :: DriverName -> RemoteEndPool -> (RemoteEndPool, Maybe (Maybe RemoteEnd))
- data RemoteEnd = RemoteEnd {}
- parseRemoteEnd :: Text -> Either Text RemoteEnd
- parseRemoteEndConfig :: Text -> Either Text RemoteEndPool
- parseRemoteEndOption :: Text -> Either Text RemoteEndPool
- parseOptionWithArgument :: Text -> [Text] -> Maybe (Maybe Text)
Documentation
data DriverName Source #
Remote end name.
Constructors
| Geckodriver | |
| Chromedriver |
Instances
| Eq DriverName Source # | |
Defined in Test.Tasty.WebDriver.Config | |
| Ord DriverName Source # | |
Defined in Test.Tasty.WebDriver.Config Methods compare :: DriverName -> DriverName -> Ordering # (<) :: DriverName -> DriverName -> Bool # (<=) :: DriverName -> DriverName -> Bool # (>) :: DriverName -> DriverName -> Bool # (>=) :: DriverName -> DriverName -> Bool # max :: DriverName -> DriverName -> DriverName # min :: DriverName -> DriverName -> DriverName # | |
| Show DriverName Source # | |
Defined in Test.Tasty.WebDriver.Config Methods showsPrec :: Int -> DriverName -> ShowS # show :: DriverName -> String # showList :: [DriverName] -> ShowS # | |
newtype RemoteEndPool Source #
Pool of remote end connections per driver.
Constructors
| RemoteEndPool | |
Fields | |
Instances
| Eq RemoteEndPool Source # | |
Defined in Test.Tasty.WebDriver.Config Methods (==) :: RemoteEndPool -> RemoteEndPool -> Bool # (/=) :: RemoteEndPool -> RemoteEndPool -> Bool # | |
| Show RemoteEndPool Source # | |
Defined in Test.Tasty.WebDriver.Config Methods showsPrec :: Int -> RemoteEndPool -> ShowS # show :: RemoteEndPool -> String # showList :: [RemoteEndPool] -> ShowS # | |
| Semigroup RemoteEndPool Source # | |
Defined in Test.Tasty.WebDriver.Config Methods (<>) :: RemoteEndPool -> RemoteEndPool -> RemoteEndPool # sconcat :: NonEmpty RemoteEndPool -> RemoteEndPool # stimes :: Integral b => b -> RemoteEndPool -> RemoteEndPool # | |
| Monoid RemoteEndPool Source # | |
Defined in Test.Tasty.WebDriver.Config Methods mempty :: RemoteEndPool # mappend :: RemoteEndPool -> RemoteEndPool -> RemoteEndPool # mconcat :: [RemoteEndPool] -> RemoteEndPool # | |
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 :: Text -> Either Text RemoteEnd Source #
Parse a single remote end URI. Must include the scheme (http:/ or https:/) even though this is redundant.
parseRemoteEndConfig :: Text -> Either Text 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 :: Text -> Either Text 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
| :: Text | Option to parse for, including hyphen(s). |
| -> [Text] | List of command line arguments. |
| -> Maybe (Maybe Text) |
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.