Safe Haskell | None |
---|---|
Language | Haskell2010 |
Test.WebDriver.Capabilities
Description
This module contains the types for working with WebDriver Capabilities. Capabilities are used to configure and communicate the features supported by a session.
Some settings, like _capabilitiesTimeouts
, are browser-agnostic. But the
Capabilities
object is also where browser-specific settings can be added,
under _capabilitiesGoogChromeOptions
, _capabilitiesMozFirefoxOptions
, etc.
This module provides lenses for all of the fields it defines, to make it easier to manipulate nested values.
Synopsis
- data Capabilities = Capabilities {
- _capabilitiesBrowserName :: Maybe String
- _capabilitiesBrowserVersion :: Maybe String
- _capabilitiesPlatformName :: Maybe Platform
- _capabilitiesAcceptInsecureCerts :: Maybe Bool
- _capabilitiesPageLoadStrategy :: Maybe String
- _capabilitiesProxy :: Maybe Proxy
- _capabilitiesSetWindowRect :: Maybe Bool
- _capabilitiesTimeouts :: Maybe Timeouts
- _capabilitiesUnhandledPromptBehavior :: Maybe UserPromptHandler
- _capabilitiesGoogChromeOptions :: Maybe ChromeOptions
- _capabilitiesMozFirefoxOptions :: Maybe FirefoxOptions
- _capabilitiesWebSocketUrl :: Maybe Bool
- defaultCaps :: Capabilities
- capabilitiesBrowserName :: Lens' Capabilities (Maybe String)
- capabilitiesBrowserVersion :: Lens' Capabilities (Maybe String)
- capabilitiesPlatformName :: Lens' Capabilities (Maybe Platform)
- capabilitiesAcceptInsecureCerts :: Lens' Capabilities (Maybe Bool)
- capabilitiesPageLoadStrategy :: Lens' Capabilities (Maybe String)
- capabilitiesProxy :: Lens' Capabilities (Maybe Proxy)
- capabilitiesSetWindowRect :: Lens' Capabilities (Maybe Bool)
- capabilitiesTimeouts :: Lens' Capabilities (Maybe Timeouts)
- capabilitiesUnhandledPromptBehavior :: Lens' Capabilities (Maybe UserPromptHandler)
- capabilitiesGoogChromeOptions :: Lens' Capabilities (Maybe ChromeOptions)
- capabilitiesMozFirefoxOptions :: Lens' Capabilities (Maybe FirefoxOptions)
- capabilitiesWebSocketUrl :: Lens' Capabilities (Maybe Bool)
- data Timeouts = Timeouts {}
- data UserPromptHandler
- data Platform
- data ChromeOptions = ChromeOptions {
- _chromeOptionsArgs :: Maybe [String]
- _chromeOptionsBinary :: Maybe FilePath
- _chromeOptionsExtensions :: Maybe [ChromeExtension]
- _chromeOptionsLocalState :: Maybe Object
- _chromeOptionsPrefs :: Maybe Object
- _chromeOptionsDetach :: Maybe Bool
- _chromeOptionsDebuggerAddress :: Maybe String
- _chromeOptionsExcludeSwitches :: Maybe [String]
- _chromeOptionsMinidumpPath :: Maybe FilePath
- _chromeOptionsMobileEmulation :: Maybe ChromeMobileEmulation
- _chromeOptionsPerfLoggingPrefs :: Maybe Object
- _chromeOptionsWindowTypes :: Maybe [String]
- defaultChromeOptions :: ChromeOptions
- chromeOptionsWindowTypes :: Lens' ChromeOptions (Maybe [String])
- chromeOptionsPrefs :: Lens' ChromeOptions (Maybe Object)
- chromeOptionsPerfLoggingPrefs :: Lens' ChromeOptions (Maybe Object)
- chromeOptionsMobileEmulation :: Lens' ChromeOptions (Maybe ChromeMobileEmulation)
- chromeOptionsMinidumpPath :: Lens' ChromeOptions (Maybe FilePath)
- chromeOptionsLocalState :: Lens' ChromeOptions (Maybe Object)
- chromeOptionsExtensions :: Lens' ChromeOptions (Maybe [ChromeExtension])
- chromeOptionsExcludeSwitches :: Lens' ChromeOptions (Maybe [String])
- chromeOptionsDetach :: Lens' ChromeOptions (Maybe Bool)
- chromeOptionsDebuggerAddress :: Lens' ChromeOptions (Maybe String)
- chromeOptionsBinary :: Lens' ChromeOptions (Maybe FilePath)
- chromeOptionsArgs :: Lens' ChromeOptions (Maybe [String])
- data ChromeClientHints = ChromeClientHints {
- _chromeClientHintsPlatform :: String
- _chromeClientHintsMobile :: Bool
- _chromeClientHintsBrands :: Maybe [BrandAndVersion]
- _chromeClientHintsFullVersionList :: Maybe [BrandAndVersion]
- _chromeClientHintsPlatformVersion :: Maybe String
- _chromeClientHintsModel :: Maybe String
- _chromeClientHintsArchitecture :: Maybe String
- _chromeClientHintsBitness :: Maybe String
- _chromeClientHintsWow64 :: Maybe Bool
- mkChromeClientHints :: String -> Bool -> ChromeClientHints
- chromeClientHintsWow64 :: Lens' ChromeClientHints (Maybe Bool)
- chromeClientHintsPlatformVersion :: Lens' ChromeClientHints (Maybe String)
- chromeClientHintsPlatform :: Lens' ChromeClientHints String
- chromeClientHintsModel :: Lens' ChromeClientHints (Maybe String)
- chromeClientHintsMobile :: Lens' ChromeClientHints Bool
- chromeClientHintsFullVersionList :: Lens' ChromeClientHints (Maybe [BrandAndVersion])
- chromeClientHintsBrands :: Lens' ChromeClientHints (Maybe [BrandAndVersion])
- chromeClientHintsBitness :: Lens' ChromeClientHints (Maybe String)
- chromeClientHintsArchitecture :: Lens' ChromeClientHints (Maybe String)
- data BrandAndVersion = BrandAndVersion {}
- data ChromeDeviceMetrics = ChromeDeviceMetrics {}
- chromeDeviceMetricsWidth :: Lens' ChromeDeviceMetrics (Maybe Int)
- chromeDeviceMetricsTouch :: Lens' ChromeDeviceMetrics (Maybe Bool)
- chromeDeviceMetricsPixelRatio :: Lens' ChromeDeviceMetrics (Maybe Double)
- chromeDeviceMetricsMobile :: Lens' ChromeDeviceMetrics (Maybe Bool)
- chromeDeviceMetricsHeight :: Lens' ChromeDeviceMetrics (Maybe Int)
- data ChromeExtension
- loadExtension :: MonadIO m => FilePath -> m ChromeExtension
- loadRawExtension :: ByteString -> ChromeExtension
- data ChromeMobileEmulation
- chromeMobileEmulationUserAgent :: Traversal' ChromeMobileEmulation (Maybe String)
- chromeMobileEmulationDeviceName :: Traversal' ChromeMobileEmulation String
- chromeMobileEmulationDeviceMetrics :: Traversal' ChromeMobileEmulation (Maybe ChromeDeviceMetrics)
- chromeMobileEmulationClientHints :: Traversal' ChromeMobileEmulation (Maybe ChromeClientHints)
- data FirefoxOptions = FirefoxOptions {}
- emptyFirefoxOptions :: FirefoxOptions
- defaultFirefoxOptions :: FirefoxOptions
- firefoxOptionsProfile :: Lens' FirefoxOptions (Maybe (Profile Firefox))
- firefoxOptionsPrefs :: Lens' FirefoxOptions (Maybe Object)
- firefoxOptionsLog :: Lens' FirefoxOptions (Maybe FirefoxLogLevel)
- firefoxOptionsBinary :: Lens' FirefoxOptions (Maybe String)
- firefoxOptionsArgs :: Lens' FirefoxOptions (Maybe [String])
- data FirefoxLogLevel = FirefoxLogLevel {}
- data FirefoxLogLevelType
Capabilities
data Capabilities Source #
A structure describing the capabilities of a session. This record serves dual roles.
It's used to specify the desired capabilities for a session before it's created. In this usage, fields that are set to Nothing indicate that we have no preference for that capability.
When received from the server , it's used to describe the actual capabilities given to us by the WebDriver server. Here a value of Nothing indicates that the server doesn't support the capability. Thus, for Maybe Bool fields, both Nothing and Just False indicate a lack of support for the desired capability.
Constructors
Capabilities | |
Fields
|
Instances
FromJSON Capabilities Source # | |
Defined in Test.WebDriver.Capabilities | |
ToJSON Capabilities Source # | |
Defined in Test.WebDriver.Capabilities Methods toJSON :: Capabilities -> Value # toEncoding :: Capabilities -> Encoding # toJSONList :: [Capabilities] -> Value # toEncodingList :: [Capabilities] -> Encoding # omitField :: Capabilities -> Bool # | |
Show Capabilities Source # | |
Defined in Test.WebDriver.Capabilities Methods showsPrec :: Int -> Capabilities -> ShowS # show :: Capabilities -> String # showList :: [Capabilities] -> ShowS # | |
Eq Capabilities Source # | |
Defined in Test.WebDriver.Capabilities |
defaultCaps :: Capabilities Source #
Default capabilities.
Lenses
capabilitiesProxy :: Lens' Capabilities (Maybe Proxy) Source #
Types
Constructors
Timeouts | |
Fields |
data UserPromptHandler Source #
Constructors
UserPromptHandlerDismiss | |
UserPromptHandlerAccept | |
UserPromptHandlerDismissAndNotify | |
UserPromptHandlerAcceptAndNotify | |
UserPromptHandlerIgnore |
Instances
FromJSON UserPromptHandler Source # | |
Defined in Test.WebDriver.Capabilities.UserPromptHandler Methods parseJSON :: Value -> Parser UserPromptHandler # parseJSONList :: Value -> Parser [UserPromptHandler] # | |
ToJSON UserPromptHandler Source # | |
Defined in Test.WebDriver.Capabilities.UserPromptHandler Methods toJSON :: UserPromptHandler -> Value # toEncoding :: UserPromptHandler -> Encoding # toJSONList :: [UserPromptHandler] -> Value # toEncodingList :: [UserPromptHandler] -> Encoding # omitField :: UserPromptHandler -> Bool # | |
Show UserPromptHandler Source # | |
Defined in Test.WebDriver.Capabilities.UserPromptHandler Methods showsPrec :: Int -> UserPromptHandler -> ShowS # show :: UserPromptHandler -> String # showList :: [UserPromptHandler] -> ShowS # | |
Eq UserPromptHandler Source # | |
Defined in Test.WebDriver.Capabilities.UserPromptHandler Methods (==) :: UserPromptHandler -> UserPromptHandler -> Bool # (/=) :: UserPromptHandler -> UserPromptHandler -> Bool # |
Represents the platformName option of the primary capabilities
Chrome
data ChromeOptions Source #
Constructors
ChromeOptions | |
Fields
|
Instances
FromJSON ChromeOptions Source # | |
Defined in Test.WebDriver.Capabilities.ChromeOptions Methods parseJSON :: Value -> Parser ChromeOptions # parseJSONList :: Value -> Parser [ChromeOptions] # | |
ToJSON ChromeOptions Source # | |
Defined in Test.WebDriver.Capabilities.ChromeOptions Methods toJSON :: ChromeOptions -> Value # toEncoding :: ChromeOptions -> Encoding # toJSONList :: [ChromeOptions] -> Value # toEncodingList :: [ChromeOptions] -> Encoding # omitField :: ChromeOptions -> Bool # | |
Show ChromeOptions Source # | |
Defined in Test.WebDriver.Capabilities.ChromeOptions Methods showsPrec :: Int -> ChromeOptions -> ShowS # show :: ChromeOptions -> String # showList :: [ChromeOptions] -> ShowS # | |
Eq ChromeOptions Source # | |
Defined in Test.WebDriver.Capabilities.ChromeOptions Methods (==) :: ChromeOptions -> ChromeOptions -> Bool # (/=) :: ChromeOptions -> ChromeOptions -> Bool # |
Lenses
Client hints
data ChromeClientHints Source #
Constructors
ChromeClientHints | |
Fields
|
Instances
FromJSON ChromeClientHints Source # | |
Defined in Test.WebDriver.Capabilities.ChromeOptions Methods parseJSON :: Value -> Parser ChromeClientHints # parseJSONList :: Value -> Parser [ChromeClientHints] # | |
ToJSON ChromeClientHints Source # | |
Defined in Test.WebDriver.Capabilities.ChromeOptions Methods toJSON :: ChromeClientHints -> Value # toEncoding :: ChromeClientHints -> Encoding # toJSONList :: [ChromeClientHints] -> Value # toEncodingList :: [ChromeClientHints] -> Encoding # omitField :: ChromeClientHints -> Bool # | |
Show ChromeClientHints Source # | |
Defined in Test.WebDriver.Capabilities.ChromeOptions Methods showsPrec :: Int -> ChromeClientHints -> ShowS # show :: ChromeClientHints -> String # showList :: [ChromeClientHints] -> ShowS # | |
Eq ChromeClientHints Source # | |
Defined in Test.WebDriver.Capabilities.ChromeOptions Methods (==) :: ChromeClientHints -> ChromeClientHints -> Bool # (/=) :: ChromeClientHints -> ChromeClientHints -> Bool # |
mkChromeClientHints :: String -> Bool -> ChromeClientHints Source #
data BrandAndVersion Source #
Constructors
BrandAndVersion | |
Fields |
Instances
FromJSON BrandAndVersion Source # | |
Defined in Test.WebDriver.Capabilities.ChromeOptions Methods parseJSON :: Value -> Parser BrandAndVersion # parseJSONList :: Value -> Parser [BrandAndVersion] # | |
ToJSON BrandAndVersion Source # | |
Defined in Test.WebDriver.Capabilities.ChromeOptions Methods toJSON :: BrandAndVersion -> Value # toEncoding :: BrandAndVersion -> Encoding # toJSONList :: [BrandAndVersion] -> Value # toEncodingList :: [BrandAndVersion] -> Encoding # omitField :: BrandAndVersion -> Bool # | |
Show BrandAndVersion Source # | |
Defined in Test.WebDriver.Capabilities.ChromeOptions Methods showsPrec :: Int -> BrandAndVersion -> ShowS # show :: BrandAndVersion -> String # showList :: [BrandAndVersion] -> ShowS # | |
Eq BrandAndVersion Source # | |
Defined in Test.WebDriver.Capabilities.ChromeOptions Methods (==) :: BrandAndVersion -> BrandAndVersion -> Bool # (/=) :: BrandAndVersion -> BrandAndVersion -> Bool # |
Device metrics
data ChromeDeviceMetrics Source #
Constructors
ChromeDeviceMetrics | |
Fields
|
Instances
FromJSON ChromeDeviceMetrics Source # | |
Defined in Test.WebDriver.Capabilities.ChromeOptions Methods parseJSON :: Value -> Parser ChromeDeviceMetrics # parseJSONList :: Value -> Parser [ChromeDeviceMetrics] # | |
ToJSON ChromeDeviceMetrics Source # | |
Defined in Test.WebDriver.Capabilities.ChromeOptions Methods toJSON :: ChromeDeviceMetrics -> Value # toEncoding :: ChromeDeviceMetrics -> Encoding # toJSONList :: [ChromeDeviceMetrics] -> Value # toEncodingList :: [ChromeDeviceMetrics] -> Encoding # omitField :: ChromeDeviceMetrics -> Bool # | |
Show ChromeDeviceMetrics Source # | |
Defined in Test.WebDriver.Capabilities.ChromeOptions Methods showsPrec :: Int -> ChromeDeviceMetrics -> ShowS # show :: ChromeDeviceMetrics -> String # showList :: [ChromeDeviceMetrics] -> ShowS # | |
Eq ChromeDeviceMetrics Source # | |
Defined in Test.WebDriver.Capabilities.ChromeOptions Methods (==) :: ChromeDeviceMetrics -> ChromeDeviceMetrics -> Bool # (/=) :: ChromeDeviceMetrics -> ChromeDeviceMetrics -> Bool # |
Extensions
data ChromeExtension Source #
A packed Google Chrome extension (.crx), as base64-encoded Text
.
Instances
loadExtension :: MonadIO m => FilePath -> m ChromeExtension Source #
Load a .crx file as a ChromeExtension
.
loadRawExtension :: ByteString -> ChromeExtension Source #
Load raw .crx data as a ChromeExtension
.
Mobile emulation
data ChromeMobileEmulation Source #
Constructors
ChromeMobileEmulationSpecificDevice | Specify a known device. To enable device emulation with a specific device, the "mobileEmulation" dictionary must contain a "deviceName." Use a valid device name from the DevTools Emulated Devices settings as the value for "deviceName." |
Fields | |
ChromeMobileEmulationIndividualAttributes | Specify individual device attributes. |
Fields
|
Instances
chromeMobileEmulationDeviceMetrics :: Traversal' ChromeMobileEmulation (Maybe ChromeDeviceMetrics) Source #
chromeMobileEmulationClientHints :: Traversal' ChromeMobileEmulation (Maybe ChromeClientHints) Source #
Firefox
data FirefoxOptions Source #
Constructors
FirefoxOptions | |
Fields
|
Instances
FromJSON FirefoxOptions Source # | |
Defined in Test.WebDriver.Capabilities.FirefoxOptions Methods parseJSON :: Value -> Parser FirefoxOptions # parseJSONList :: Value -> Parser [FirefoxOptions] # | |
ToJSON FirefoxOptions Source # | |
Defined in Test.WebDriver.Capabilities.FirefoxOptions Methods toJSON :: FirefoxOptions -> Value # toEncoding :: FirefoxOptions -> Encoding # toJSONList :: [FirefoxOptions] -> Value # toEncodingList :: [FirefoxOptions] -> Encoding # omitField :: FirefoxOptions -> Bool # | |
Show FirefoxOptions Source # | |
Defined in Test.WebDriver.Capabilities.FirefoxOptions Methods showsPrec :: Int -> FirefoxOptions -> ShowS # show :: FirefoxOptions -> String # showList :: [FirefoxOptions] -> ShowS # | |
Eq FirefoxOptions Source # | |
Defined in Test.WebDriver.Capabilities.FirefoxOptions Methods (==) :: FirefoxOptions -> FirefoxOptions -> Bool # (/=) :: FirefoxOptions -> FirefoxOptions -> Bool # |
Lenses
Log level
data FirefoxLogLevel Source #
Constructors
FirefoxLogLevel | |
Fields |
Instances
FromJSON FirefoxLogLevel Source # | |
Defined in Test.WebDriver.Capabilities.FirefoxOptions Methods parseJSON :: Value -> Parser FirefoxLogLevel # parseJSONList :: Value -> Parser [FirefoxLogLevel] # | |
ToJSON FirefoxLogLevel Source # | |
Defined in Test.WebDriver.Capabilities.FirefoxOptions Methods toJSON :: FirefoxLogLevel -> Value # toEncoding :: FirefoxLogLevel -> Encoding # toJSONList :: [FirefoxLogLevel] -> Value # toEncodingList :: [FirefoxLogLevel] -> Encoding # omitField :: FirefoxLogLevel -> Bool # | |
Show FirefoxLogLevel Source # | |
Defined in Test.WebDriver.Capabilities.FirefoxOptions Methods showsPrec :: Int -> FirefoxLogLevel -> ShowS # show :: FirefoxLogLevel -> String # showList :: [FirefoxLogLevel] -> ShowS # | |
Eq FirefoxLogLevel Source # | |
Defined in Test.WebDriver.Capabilities.FirefoxOptions Methods (==) :: FirefoxLogLevel -> FirefoxLogLevel -> Bool # (/=) :: FirefoxLogLevel -> FirefoxLogLevel -> Bool # |
data FirefoxLogLevelType Source #
Constructors
FirefoxLogLevelTypeTrace | |
FirefoxLogLevelTypeDebug | |
FirefoxLogLevelTypeConfig | |
FirefoxLogLevelTypeInfo | |
FirefoxLogLevelTypeWarn | |
FirefoxLogLevelTypeError | |
FirefoxLogLevelTypeFatal |
Instances
FromJSON FirefoxLogLevelType Source # | |
Defined in Test.WebDriver.Capabilities.FirefoxOptions Methods parseJSON :: Value -> Parser FirefoxLogLevelType # parseJSONList :: Value -> Parser [FirefoxLogLevelType] # | |
ToJSON FirefoxLogLevelType Source # | |
Defined in Test.WebDriver.Capabilities.FirefoxOptions Methods toJSON :: FirefoxLogLevelType -> Value # toEncoding :: FirefoxLogLevelType -> Encoding # toJSONList :: [FirefoxLogLevelType] -> Value # toEncodingList :: [FirefoxLogLevelType] -> Encoding # omitField :: FirefoxLogLevelType -> Bool # | |
Show FirefoxLogLevelType Source # | |
Defined in Test.WebDriver.Capabilities.FirefoxOptions Methods showsPrec :: Int -> FirefoxLogLevelType -> ShowS # show :: FirefoxLogLevelType -> String # showList :: [FirefoxLogLevelType] -> ShowS # | |
Eq FirefoxLogLevelType Source # | |
Defined in Test.WebDriver.Capabilities.FirefoxOptions Methods (==) :: FirefoxLogLevelType -> FirefoxLogLevelType -> Bool # (/=) :: FirefoxLogLevelType -> FirefoxLogLevelType -> Bool # |