| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Test.WebDriver.Commands.Internal
Description
Internal functions used to implement the functions exported by Test.WebDriver.Commands. These may be useful for implementing non-standard webdriver commands.
Synopsis
- doCommand :: (WebDriver wd, HasCallStack, ToJSON a, FromJSON b) => Method -> Text -> a -> wd b
- doSessCommand :: (HasCallStack, WebDriver wd, ToJSON a, FromJSON b) => Method -> Text -> a -> wd b
- newtype SessionId = SessionId Text
- doElemCommand :: (HasCallStack, WebDriver wd, ToJSON a, FromJSON b) => Method -> Element -> Text -> a -> wd b
- newtype Element = Element Text
- doWinCommand :: (HasCallStack, WebDriver wd, ToJSON a, FromJSON b) => Method -> WindowHandle -> Text -> a -> wd b
- newtype WindowHandle = WindowHandle Text
- currentWindow :: WindowHandle
- newtype NoSessionId = NoSessionId String
Low-level webdriver functions
Arguments
| :: (WebDriver wd, HasCallStack, ToJSON a, FromJSON b) | |
| => Method | HTTP request method |
| -> Text | URL of request |
| -> a | JSON parameters passed in the body of the request. Note that, as a special case, anything that converts to Data.Aeson.Null will result in an empty request body. |
| -> wd b | The JSON result of the HTTP request. |
Commands with :sessionId URL parameter
doSessCommand :: (HasCallStack, WebDriver wd, ToJSON a, FromJSON b) => Method -> Text -> a -> wd b Source #
This a convenient wrapper around doCommand that automatically prepends
the session URL parameter to the wire command URL. For example, passing
a URL of "refresh" will expand to "session:sessionIdrefresh", where
:sessionId is a URL parameter as described in
https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol
An opaque identifier for a WebDriver session. These handles are produced by the server on session creation, and act to identify a session in progress.
Instances
| FromJSON SessionId Source # | |
| ToJSON SessionId Source # | |
Defined in Test.WebDriver.Session | |
| Read SessionId Source # | |
| Show SessionId Source # | |
| Eq SessionId Source # | |
| Ord SessionId Source # | |
Commands with element :id URL parameters
doElemCommand :: (HasCallStack, WebDriver wd, ToJSON a, FromJSON b) => Method -> Element -> Text -> a -> wd b Source #
A wrapper around doSessCommand to create element URLs.
For example, passing a URL of "/active" will expand to
"session:sessionIdelement:id/active", where :sessionId and :id are URL
parameters as described in the wire protocol.
An opaque identifier for a web page element.
Commands with :windowHandle URL parameters
doWinCommand :: (HasCallStack, WebDriver wd, ToJSON a, FromJSON b) => Method -> WindowHandle -> Text -> a -> wd b Source #
A wrapper around doSessCommand to create window handle URLS.
For example, passing a URL of "/size" will expand to
"session:sessionIdwindow:windowHandle/", where :sessionId and
:windowHandle are URL parameters as described in the wire protocol
newtype WindowHandle Source #
An opaque identifier for a browser window
Constructors
| WindowHandle Text |
Instances
currentWindow :: WindowHandle Source #
A special WindowHandle that always refers to the currently focused window.
This is also used by the Default instance.
Exceptions
newtype NoSessionId Source #
A command requiring a session ID was attempted when no session ID was available.
Constructors
| NoSessionId String |
Instances
| Exception NoSessionId Source # | |
Defined in Test.WebDriver.Commands.Internal Methods toException :: NoSessionId -> SomeException # fromException :: SomeException -> Maybe NoSessionId # displayException :: NoSessionId -> String # | |
| Show NoSessionId Source # | |
Defined in Test.WebDriver.Commands.Internal Methods showsPrec :: Int -> NoSessionId -> ShowS # show :: NoSessionId -> String # showList :: [NoSessionId] -> ShowS # | |
| Eq NoSessionId Source # | |
Defined in Test.WebDriver.Commands.Internal | |