| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
WebDriverPreCore.HTTP.SpecDefinition
Description
Deprecated: Deprecated in favour of WebDriverPreCore.HTTP.API. SpecDefinition module will be removed in a future release ~ 2027-02-01. See ChangeLog.md for upgrade instructions
Synopsis
- data HttpSpec a
- = Get {
- description :: Text
- path :: UrlPath
- parser :: HttpResponse -> Result a
- | Post {
- description :: Text
- path :: UrlPath
- body :: Value
- parser :: HttpResponse -> Result a
- | PostEmpty {
- description :: Text
- path :: UrlPath
- parser :: HttpResponse -> Result a
- | Delete {
- description :: Text
- path :: UrlPath
- parser :: HttpResponse -> Result a
- = Get {
- newSession :: FullCapabilities -> HttpSpec SessionResponse
- newSession' :: ToJSON a => a -> HttpSpec SessionResponse
- status :: HttpSpec Status
- deleteSession :: Session -> HttpSpec ()
- getTimeouts :: Session -> HttpSpec Timeouts
- setTimeouts :: Session -> Timeouts -> HttpSpec ()
- navigateTo :: Session -> URL -> HttpSpec ()
- getCurrentUrl :: Session -> HttpSpec URL
- back :: Session -> HttpSpec ()
- forward :: Session -> HttpSpec ()
- refresh :: Session -> HttpSpec ()
- getTitle :: Session -> HttpSpec Text
- getWindowHandle :: Session -> HttpSpec Handle
- newWindow :: Session -> HttpSpec WindowHandleSpec
- closeWindow :: Session -> HttpSpec [Handle]
- switchToWindow :: Session -> Handle -> HttpSpec ()
- switchToFrame :: Session -> FrameReference -> HttpSpec ()
- getPageSource :: Session -> HttpSpec Text
- executeScript :: Session -> Script -> HttpSpec Value
- executeScriptAsync :: Session -> Script -> HttpSpec Value
- addCookie :: Session -> Cookie -> HttpSpec ()
- getAllCookies :: Session -> HttpSpec [Cookie]
- getNamedCookie :: Session -> Text -> HttpSpec Cookie
- deleteCookie :: Session -> Text -> HttpSpec ()
- deleteAllCookies :: Session -> HttpSpec ()
- performActions :: Session -> Actions -> HttpSpec ()
- releaseActions :: Session -> HttpSpec ()
- dismissAlert :: Session -> HttpSpec ()
- acceptAlert :: Session -> HttpSpec ()
- getAlertText :: Session -> HttpSpec Text
- sendAlertText :: Session -> Text -> HttpSpec ()
- takeScreenshot :: Session -> HttpSpec Text
- printPage :: Session -> HttpSpec Text
- getWindowHandles :: Session -> HttpSpec [Handle]
- getWindowRect :: Session -> HttpSpec WindowRect
- setWindowRect :: Session -> WindowRect -> HttpSpec WindowRect
- maximizeWindow :: Session -> HttpSpec WindowRect
- minimizeWindow :: Session -> HttpSpec WindowRect
- fullscreenWindow :: Session -> HttpSpec WindowRect
- switchToParentFrame :: Session -> HttpSpec ()
- getActiveElement :: Session -> HttpSpec ElementId
- findElement :: Session -> Selector -> HttpSpec ElementId
- findElements :: Session -> Selector -> HttpSpec [ElementId]
- findElementFromElement :: Session -> ElementId -> Selector -> HttpSpec ElementId
- findElementsFromElement :: Session -> ElementId -> Selector -> HttpSpec [ElementId]
- isElementSelected :: Session -> ElementId -> HttpSpec Bool
- getElementAttribute :: Session -> ElementId -> Text -> HttpSpec Text
- getElementProperty :: Session -> ElementId -> Text -> HttpSpec Value
- getElementCssValue :: Session -> ElementId -> Text -> HttpSpec Text
- getElementShadowRoot :: Session -> ElementId -> HttpSpec ShadowRootElementId
- getElementText :: Session -> ElementId -> HttpSpec Text
- getElementTagName :: Session -> ElementId -> HttpSpec Text
- getElementRect :: Session -> ElementId -> HttpSpec WindowRect
- isElementEnabled :: Session -> ElementId -> HttpSpec Bool
- getElementComputedRole :: Session -> ElementId -> HttpSpec Text
- getElementComputedLabel :: Session -> ElementId -> HttpSpec Text
- elementClick :: Session -> ElementId -> HttpSpec ()
- elementClear :: Session -> ElementId -> HttpSpec ()
- elementSendKeys :: Session -> ElementId -> Text -> HttpSpec ()
- takeElementScreenshot :: Session -> ElementId -> HttpSpec Text
- findElementFromShadowRoot :: Session -> ShadowRootElementId -> Selector -> HttpSpec ElementId
- findElementsFromShadowRoot :: Session -> ShadowRootElementId -> Selector -> HttpSpec [ElementId]
The HttpSpec Type
The HttpSpec type is a specification for a WebDriver Http command.
Every endpoint function in this module returns a HttpSpec object.
Constructors
| Get | |
Fields
| |
| Post | |
Fields
| |
| PostEmpty | |
Fields
| |
| Delete | |
Fields
| |
The API
Root Methods
newSession :: FullCapabilities -> HttpSpec SessionResponse Source #
Return a spec to create a new session given FullCapabilities object.
newSession' can be used if FullCapabilities doesn't meet your requirements.
POST /session New Session
newSession' :: ToJSON a => a -> HttpSpec SessionResponse Source #
Return a spec to create a new session given an object of any type that implements ToJSON.
The FullCapabilities type and associated types should work for the vast majority use cases, but if the required capabilities are not covered by the types provided, newSession'.
can be used with a custom type instead. newSession' works with any type that implements ToJSON, (including an Aeson Value).
Obviously, any type used must produce a JSON object compatible with capabilities as defined W3C spec.
POST /session New Session
Session Methods
deleteSession :: Session -> HttpSpec () Source #
switchToFrame :: Session -> FrameReference -> HttpSpec () Source #
Return a spec to switch to a different frame given a Session and FrameReference.
POST /session/{session id}/frame Switch To FramedeleteAllCookies :: Session -> HttpSpec () Source #
releaseActions :: Session -> HttpSpec () Source #
dismissAlert :: Session -> HttpSpec () Source #
acceptAlert :: Session -> HttpSpec () Source #
Window Methods
setWindowRect :: Session -> WindowRect -> HttpSpec WindowRect Source #
Return a spec to set the window rect of the current window given a Session and WindowRect.
POST /session/{session id}/window/rect Set Window RectFrame Methods
switchToParentFrame :: Session -> HttpSpec () Source #
Element(s) Methods
Element Instance Methods
getElementRect :: Session -> ElementId -> HttpSpec WindowRect Source #