webdriver-w3c-0.0.3: Bindings to the WebDriver API
Copyright2018 Automattic Inc.
LicenseGPL-3
MaintainerNathan Bloomfield (nbloomf@gmail.com)
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Web.Api.WebDriver.Endpoints

Description

These bindings try to stick as closely to the spec as possible. We use the following conventions.

  • The Stealth suffix on a function indicates that it does not log request or response data (but it does log that a request/response occurred).
  • A prime (') on a POST function name indicates that it takes an additional function parameter that mutates the payload after it is converted to JSON, but before sending the request. This is a cheap way to future-proof the bindings and accommodate nonstandard request parameters.

The most recent version of the spec is available at https://w3c.github.io/webdriver/webdriver-spec.html.

Synopsis

Documentation

runIsolated :: (Monad eff, Monad (t eff), MonadTrans t) => Capabilities -> WebDriverTT t eff a -> WebDriverTT t eff a Source #

Run a WebDriver computation in an isolated browser session. Ensures that the session is closed on the remote end.

runIsolated_ :: (Monad eff, Monad (t eff), MonadTrans t) => Capabilities -> WebDriverTT t eff a -> WebDriverTT t eff () Source #

Sessions

New Session

newSession :: (Monad eff, Monad (t eff), MonadTrans t) => Capabilities -> WebDriverTT t eff SessionId Source #

See https://w3c.github.io/webdriver/webdriver-spec.html#new-session. For an extensible version allowing arbitrary changes to the JSON value representing the Capabilities parameter, see newSession`.

newSession' :: (Monad eff, Monad (t eff), MonadTrans t) => (Value -> Value) -> Capabilities -> WebDriverTT t eff SessionId Source #

See https://w3c.github.io/webdriver/webdriver-spec.html#new-session. This generalizes newSession` by taking an additional function Value -> Value that is applied to the Capabilities parameter after it is converted to JSON, but before it is passed to the HTTP call.

Delete Session

Status

Get Timeouts

Set Timeouts

Navigation

Navigate To

navigateTo :: (Monad eff, Monad (t eff), MonadTrans t) => Url -> WebDriverTT t eff () Source #

See https://w3c.github.io/webdriver/webdriver-spec.html#navigate-to. To access this enpoint without logging the request or the result, use navigateToStealth.

navigateToStealth :: (Monad eff, Monad (t eff), MonadTrans t) => Url -> WebDriverTT t eff () Source #

See https://w3c.github.io/webdriver/webdriver-spec.html#navigate-to. This function does not log the request or response; if you do want the interaction logged, use navigateTo.

Get Current URL

Go Back

Go Forward

Page Refresh

Get Title

Command Contexts

Get Window Handle

Close Window

Switch To Window

Get Window Handles

New Window

Switch To Frame

Switch To Parent Frame

Get Window Rect

Set Window Rect

Maximize Window

Minimize Window

Fullscreen Window

Element Retrieval

Find Element

Find Elements

Find Element From Element

Find Elements From Element

Get Active Element

Element State

Is Element Selected

Get Element Attribute

Get Element Property

Get Element CSS Value

Get Element Text

Get Element Tag Name

Get Element Rect

Is Element Enabled

Get Computed Role

Get Computed Label

Element Interaction

Element Click

Element Clear

Element Send Keys

Document Handling

Get Page Source

getPageSourceStealth :: (Monad eff, Monad (t eff), MonadTrans t) => WebDriverTT t eff Text Source #

See https://w3c.github.io/webdriver/webdriver-spec.html#get-page-source. Does not dump the page source into the logs. :)

Execute Script

Execute Async Script

Cookies

Get All Cookies

Get Named Cookie

Add Cookie

Delete Cookie

Delete All Cookies

Actions

Perform Actions

performActions :: (Monad eff, Monad (t eff), MonadTrans t) => [Action] -> WebDriverTT t eff () Source #

See https://w3c.github.io/webdriver/webdriver-spec.html#perform-actions. For a variant on this endpoint that does not log the request and response, see performActionsStealth.

performActionsStealth :: (Monad eff, Monad (t eff), MonadTrans t) => [Action] -> WebDriverTT t eff () Source #

See https://w3c.github.io/webdriver/webdriver-spec.html#perform-actions. This function is identical to performActions except that it does not log the request or response. Handy if the action includes secret info.

Release Actions

User Prompts

Dismiss Alert

Accept Alert

Get Alert Text

Send Alert Text

Screen Capture

Take Screenshot

Take Element Screenshot

Print

Print Page

_WEB_ELEMENT_ID :: IsString t => t Source #

Spec-defined "web element identifier" string constant. See https://w3c.github.io/webdriver/webdriver-spec.html#elements.

_WEB_WINDOW_ID :: IsString t => t Source #

Spec-defined "web window identifier" string constant. See https://w3c.github.io/webdriver/webdriver-spec.html#command-contexts.

_WEB_FRAME_ID :: IsString t => t Source #

Spec-defined "web frame identifier" string constant. See https://w3c.github.io/webdriver/webdriver-spec.html#command-contexts.