| Safe Haskell | Trustworthy |
|---|---|
| Language | Haskell2010 |
Test.Marionette.Commands
Synopsis
- newtype ValueObject a = ValueObject {
- value :: a
- acceptConnections :: (HasCallStack, Marionette m) => Bool -> m ()
- getAccessibilityPropertiesForAccessibilityNode :: (HasCallStack, Marionette m) => Text -> m AccessibilityProperties
- getAccessibilityPropertiesForElement :: (HasCallStack, Marionette m) => Element -> m AccessibilityProperties
- getContext :: (HasCallStack, Marionette m) => m Context
- getScreenOrientation :: (HasCallStack, Marionette m) => m Orientation
- getWindowType :: (HasCallStack, Marionette m) => m Text
- quit :: (HasCallStack, Marionette m) => m ()
- registerChromeHandler :: (HasCallStack, Marionette m) => Text -> [RegistryEntry] -> m Text
- setContext :: (HasCallStack, Marionette m) => Context -> m ()
- setScreenOrientation :: (HasCallStack, Marionette m) => Orientation -> m ()
- unregisterChromeHandler :: (HasCallStack, Marionette m) => Text -> m ()
- acceptAlert :: (HasCallStack, Marionette m) => m ()
- addCookie :: (HasCallStack, Marionette m) => Cookie -> m ()
- back :: (HasCallStack, Marionette m) => m ()
- closeChromeWindow :: (HasCallStack, Marionette m) => m ()
- closeWindow :: (HasCallStack, Marionette m) => m ()
- deleteAllCookies :: (HasCallStack, Marionette m) => m ()
- deleteCookie :: (HasCallStack, Marionette m) => Text -> m ()
- deleteSession :: (HasCallStack, Marionette m) => m ()
- dismissAlert :: (HasCallStack, Marionette m) => m ()
- elementClear :: (HasCallStack, Marionette m) => Element -> m ()
- elementClick :: (HasCallStack, Marionette m) => Element -> m ()
- elementSendKeys :: (HasCallStack, Marionette m) => Element -> Text -> m ()
- executeAsyncScript :: (HasCallStack, Marionette m, Foldable f, FromJSON a) => Text -> f Value -> m (Maybe a)
- executeScript :: (HasCallStack, Marionette m, Foldable f, FromJSON a) => Text -> f Value -> m a
- findElement :: (HasCallStack, Marionette m) => Selector -> m Element
- findElementFrom :: (HasCallStack, Marionette m) => Element -> Selector -> m Element
- findElementFromShadowRoot :: (HasCallStack, Marionette m) => Shadow -> Selector -> m Element
- findElements :: (HasCallStack, Marionette m) => Selector -> m [Element]
- findElementsFrom :: (HasCallStack, Marionette m) => Element -> Selector -> m [Element]
- findElementsFromShadowRoot :: (HasCallStack, Marionette m) => Shadow -> Selector -> m [Element]
- forward :: (HasCallStack, Marionette m) => m ()
- fullscreenWindow :: (HasCallStack, Marionette m) => m ()
- getActiveElement :: (HasCallStack, Marionette m) => m Element
- getAlertText :: (HasCallStack, Marionette m) => m Text
- getComputedLabel :: (HasCallStack, Marionette m) => Element -> m Text
- getComputedRole :: (HasCallStack, Marionette m) => Element -> m Text
- getCookies :: (HasCallStack, Marionette m) => m [Cookie]
- getCurrentURL :: (HasCallStack, Marionette m) => m Text
- getElementAttribute :: (HasCallStack, Marionette m) => Text -> Element -> m (Maybe Text)
- getElementCSSValue :: (HasCallStack, Marionette m) => Element -> Text -> m (Maybe Text)
- getElementProperty :: (HasCallStack, Marionette m) => Element -> Text -> m (Maybe Text)
- getElementRect :: (HasCallStack, Marionette m) => Element -> m Rect
- getElementTagName :: (HasCallStack, Marionette m) => Element -> m Text
- getElementText :: (HasCallStack, Marionette m) => Element -> m Text
- getPageSource :: (HasCallStack, Marionette m) => m Text
- getShadowRoot :: (HasCallStack, Marionette m) => Element -> m Shadow
- getTimeouts :: (HasCallStack, Marionette m) => m Timeouts
- getTitle :: (HasCallStack, Marionette m) => m Text
- getWindowHandle :: (HasCallStack, Marionette m) => m WindowHandle
- getWindowHandles :: (HasCallStack, Marionette m) => m [WindowHandle]
- getWindowRect :: (HasCallStack, Marionette m) => m Rect
- isElementDisplayed :: (HasCallStack, Marionette m) => Element -> m Bool
- isElementEnabled :: (HasCallStack, Marionette m) => Element -> m Bool
- isElementSelected :: (HasCallStack, Marionette m) => Element -> m Bool
- maximizeWindow :: (HasCallStack, Marionette m) => m ()
- minimizeWindow :: (HasCallStack, Marionette m) => m ()
- navigate :: (HasCallStack, Marionette m) => Text -> m ()
- newSession :: (HasCallStack, Marionette m) => m ()
- newWindow :: (HasCallStack, Marionette m) => m NewWindowResult
- newTab :: (HasCallStack, Marionette m) => m NewWindowResult
- performActions :: (HasCallStack, Marionette m) => m ()
- print :: (HasCallStack, Marionette m) => m ()
- refresh :: (HasCallStack, Marionette m) => m ()
- releaseActions :: (HasCallStack, Marionette m) => m ()
- sendAlertText :: (HasCallStack, Marionette m) => Text -> m ()
- setPermission :: (HasCallStack, Marionette m) => m ()
- setTimeouts :: (HasCallStack, Marionette m) => Timeouts -> m ()
- setWindowRect :: (HasCallStack, Marionette m) => Rect -> m ()
- switchToFrame :: (HasCallStack, Marionette m) => Frame -> m ()
- switchToParentFrame :: (HasCallStack, Marionette m) => m ()
- switchToWindow :: (HasCallStack, Marionette m) => WindowHandle -> m ()
- takeScreenshot :: (HasCallStack, Marionette m) => m ByteString
- addCredential :: (HasCallStack, Marionette m) => AuthenticatorId -> Credential -> m ()
- addVirtualAuthenticator :: (HasCallStack, Marionette m) => VirtualAuthenticator -> m AuthenticatorId
- getCredentials :: (HasCallStack, Marionette m) => AuthenticatorId -> m [Credential]
- removeAllCredentials :: (HasCallStack, Marionette m) => AuthenticatorId -> m ()
- removeCredential :: (HasCallStack, Marionette m) => AuthenticatorId -> CredentialId -> m ()
- removeVirtualAuthenticator :: (HasCallStack, Marionette m) => AuthenticatorId -> m ()
- setUserVerified :: (HasCallStack, Marionette m) => AuthenticatorId -> Bool -> m ()
Documentation
newtype ValueObject a Source #
Constructors
| ValueObject | |
Fields
| |
Instances
acceptConnections :: (HasCallStack, Marionette m) => Bool -> m () Source #
Enable or disable accepting new socket connections. This has no effect on existing connections.
getAccessibilityPropertiesForAccessibilityNode Source #
Arguments
| :: (HasCallStack, Marionette m) | |
| => Text | Node identifier |
| -> m AccessibilityProperties |
Look up accessibility properties of a node in the platform accessibility tree, rather than by a web element reference.
getAccessibilityPropertiesForElement :: (HasCallStack, Marionette m) => Element -> m AccessibilityProperties Source #
Look up the accessibility properties exposed to assistive technology (such as screen readers) for a given element.
getContext :: (HasCallStack, Marionette m) => m Context Source #
Return whether subsequent browsing-context-scoped commands (such as
navigate or findElement) target privileged browser chrome or ordinary
web content.
New sessions start in the Content context; use setContext to switch,
for example when driving browser UI rather than a web page.
getScreenOrientation :: (HasCallStack, Marionette m) => m Orientation Source #
Return the current orientation of the browser window.
getWindowType :: (HasCallStack, Marionette m) => m Text Source #
Return the chrome window's windowtype attribute, for example
navigator:browser for a normal browser window.
quit :: (HasCallStack, Marionette m) => m () Source #
Shut the browser down: Marionette first stops accepting new connections, then ends the current session, and finally causes the application itself to quit.
registerChromeHandler :: (HasCallStack, Marionette m) => Text -> [RegistryEntry] -> m Text Source #
Register a chrome protocol handler for a directory containing XHTML or
XUL files, allowing them to be loaded via the chrome:// protocol.
Return the identifier for the registered handler which can be unregistered
with unregisterChromeHandler.
setContext :: (HasCallStack, Marionette m) => Context -> m () Source #
Set the context of the subsequent commands. All subsequent requests to commands that in some way involve interaction with a browsing context will target the chosen context.
setScreenOrientation :: (HasCallStack, Marionette m) => Orientation -> m () Source #
Set the current browser orientation.
unregisterChromeHandler :: (HasCallStack, Marionette m) => Text -> m () Source #
Unregister a previously registered chrome protocol handler, given an
identifier returned by registerChromeHandler.
acceptAlert :: (HasCallStack, Marionette m) => m () Source #
Accept a currently displayed dialog modal, or throw if no modal is displayed.
addCookie :: (HasCallStack, Marionette m) => Cookie -> m () Source #
Add a single cookie to the cookie store associated with the active document's address.
back :: (HasCallStack, Marionette m) => m () Source #
Cause the browser to traverse one step backward in the joint history of the current browsing context.
closeChromeWindow :: (HasCallStack, Marionette m) => m () Source #
Close the currently selected chrome window. If it is the last window currently open, the chrome window is not closed, to prevent an application shutdown.
closeWindow :: (HasCallStack, Marionette m) => m () Source #
Close the currently selected tab or window. With multiple open tabs, only the selected tab is closed; if it is the last window currently open, the window is not closed, to prevent an application shutdown.
deleteAllCookies :: (HasCallStack, Marionette m) => m () Source #
Delete all cookies that are visible to a document.
deleteCookie :: (HasCallStack, Marionette m) => Text -> m () Source #
Delete a cookie by name.
deleteSession :: (HasCallStack, Marionette m) => m () Source #
Delete the current WebDriver session.
dismissAlert :: (HasCallStack, Marionette m) => m () Source #
Dismiss a currently displayed modal dialog, or throw if no modal is displayed.
elementClear :: (HasCallStack, Marionette m) => Element -> m () Source #
Clear the text of an element.
elementClick :: (HasCallStack, Marionette m) => Element -> m () Source #
Send a click event to an element.
elementSendKeys :: (HasCallStack, Marionette m) => Element -> Text -> m () Source #
Send key presses to an element after focusing on it.
executeAsyncScript :: (HasCallStack, Marionette m, Foldable f, FromJSON a) => Text -> f Value -> m (Maybe a) Source #
Execute a JavaScript function asynchronously in the context of the current browsing context, and return the value passed to the callback, which is always the last argument exposed to the script.
executeScript :: (HasCallStack, Marionette m, Foldable f, FromJSON a) => Text -> f Value -> m a Source #
Execute a JavaScript function synchronously in the context of the current browsing context, and return its return value.
findElement :: (HasCallStack, Marionette m) => Selector -> m Element Source #
Find an element using the given search strategy.
findElementFrom :: (HasCallStack, Marionette m) => Element -> Selector -> m Element Source #
Find an element using the given search strategy, relative to the given element.
findElementFromShadowRoot :: (HasCallStack, Marionette m) => Shadow -> Selector -> m Element Source #
Find an element within a shadow root using the given search strategy.
See https://w3c.github.io/webdriver/#find-element-from-shadow-root
findElements :: (HasCallStack, Marionette m) => Selector -> m [Element] Source #
Find elements using the given search strategy.
findElementsFrom :: (HasCallStack, Marionette m) => Element -> Selector -> m [Element] Source #
Find elements using the given search strategy, relative to the given element.
findElementsFromShadowRoot :: (HasCallStack, Marionette m) => Shadow -> Selector -> m [Element] Source #
Find elements within a shadow root using the given search strategy.
See https://w3c.github.io/webdriver/#find-elements-from-shadow-root
forward :: (HasCallStack, Marionette m) => m () Source #
Cause the browser to traverse one step forward in the joint history of the current browsing context.
fullscreenWindow :: (HasCallStack, Marionette m) => m () Source #
Set the window to full screen, as if the user had chosen View -> Enter Full Screen. Not supported on Android.
getActiveElement :: (HasCallStack, Marionette m) => m Element Source #
Return the active element in the document.
getAlertText :: (HasCallStack, Marionette m) => m Text Source #
Return the message shown in a currently displayed modal, or throw if no modal is displayed.
getComputedLabel :: (HasCallStack, Marionette m) => Element -> m Text Source #
Determine the accessibility label for an element.
getComputedRole :: (HasCallStack, Marionette m) => Element -> m Text Source #
Determine the accessibility role for an element.
getCookies :: (HasCallStack, Marionette m) => m [Cookie] Source #
Get all the cookies for the current domain. Equivalent to calling
document.cookie and parsing the result.
getCurrentURL :: (HasCallStack, Marionette m) => m Text Source #
Get a string representing the current URL, equivalent to
document.location.href. When in the chrome context, return the
canonical URL of the current resource.
getElementAttribute :: (HasCallStack, Marionette m) => Text -> Element -> m (Maybe Text) Source #
Get the value of the given attribute of an element.
getElementCSSValue :: (HasCallStack, Marionette m) => Element -> Text -> m (Maybe Text) Source #
Get the given CSS property of the computed style of an element.
getElementProperty :: (HasCallStack, Marionette m) => Element -> Text -> m (Maybe Text) Source #
Get the value of the given property of an element.
getElementRect :: (HasCallStack, Marionette m) => Element -> m Rect Source #
Get the dimensions and coordinates of an element.
getElementTagName :: (HasCallStack, Marionette m) => Element -> m Text Source #
Get the local tag name of an element.
getElementText :: (HasCallStack, Marionette m) => Element -> m Text Source #
Get the rendered text of an element, including the text of all its child elements.
getPageSource :: (HasCallStack, Marionette m) => m Text Source #
Get the page source of the content document, serialised as a string.
getShadowRoot :: (HasCallStack, Marionette m) => Element -> m Shadow Source #
Get the shadow root of an element.
See https://w3c.github.io/webdriver/#get-element-shadow-root
getTimeouts :: (HasCallStack, Marionette m) => m Timeouts Source #
Get the timeouts for page loading, searching, and scripts.
getTitle :: (HasCallStack, Marionette m) => m Text Source #
Get the current title of the window.
getWindowHandle :: (HasCallStack, Marionette m) => m WindowHandle Source #
Get the current window's handle: an opaque, server-assigned
identifier that can be used to switch back to this window later with
switchToWindow.
getWindowHandles :: (HasCallStack, Marionette m) => m [WindowHandle] Source #
Get the unordered list of window handles of every open top-level browsing context.
getWindowRect :: (HasCallStack, Marionette m) => m Rect Source #
Get the position and size of the browser window currently in focus.
The width and height refer to the window's outerWidth and
outerHeight, which include scroll bars, title bars, and so on.
isElementDisplayed :: (HasCallStack, Marionette m) => Element -> m Bool Source #
Check whether an element is displayed.
isElementEnabled :: (HasCallStack, Marionette m) => Element -> m Bool Source #
Check whether an element is enabled.
isElementSelected :: (HasCallStack, Marionette m) => Element -> m Bool Source #
Check whether an element is selected.
maximizeWindow :: (HasCallStack, Marionette m) => m () Source #
Maximise the window, as if the user had pressed the maximise button. Not supported on Android.
minimizeWindow :: (HasCallStack, Marionette m) => m () Source #
Minimise the window, as if the user had pressed the minimise button. Not supported on Android.
navigate :: (HasCallStack, Marionette m) => Text -> m () Source #
Navigate to the given URL, waiting for the document to load or the session's page load timeout to elapse before returning.
newSession :: (HasCallStack, Marionette m) => m () Source #
Create a new WebDriver session. Must be called before performing any other command.
newWindow :: (HasCallStack, Marionette m) => m NewWindowResult Source #
Open a new top-level browsing context of type window.
newTab :: (HasCallStack, Marionette m) => m NewWindowResult Source #
Open a new top-level browsing context of type tab.
performActions :: (HasCallStack, Marionette m) => m () Source #
Perform a series of grouped input actions at the specified points in time.
print :: (HasCallStack, Marionette m) => m () Source #
Print the current page, returning it as a base64-encoded PDF.
refresh :: (HasCallStack, Marionette m) => m () Source #
Reload the page in the current top-level browsing context.
releaseActions :: (HasCallStack, Marionette m) => m () Source #
Release all the keys and pointer buttons that are currently depressed.
sendAlertText :: (HasCallStack, Marionette m) => Text -> m () Source #
Send keys to the input field of a currently displayed modal, or throw if no modal is displayed, or the modal has no means for text input.
setPermission :: (HasCallStack, Marionette m) => m () Source #
Simulate user modification of a permission descriptor's permission state.
See https://www.w3.org/TR/permissions/#webdriver-command-set-permission
setTimeouts :: (HasCallStack, Marionette m) => Timeouts -> m () Source #
Set the timeouts for page loading, searching, and scripts.
setWindowRect :: (HasCallStack, Marionette m) => Rect -> m () Source #
Set the position and size of the window on the operating system's
window manager. The width and height refer to the window's
outerWidth and outerHeight, which include browser chrome and
OS-level window borders.
switchToFrame :: (HasCallStack, Marionette m) => Frame -> m () Source #
Switch to the given frame within the current window.
switchToParentFrame :: (HasCallStack, Marionette m) => m () Source #
Set the current browsing context for future commands to the parent of the current browsing context.
switchToWindow :: (HasCallStack, Marionette m) => WindowHandle -> m () Source #
Switch to the top-level browsing context identified by the given window handle.
takeScreenshot :: (HasCallStack, Marionette m) => m ByteString Source #
Take a screenshot of the current frame, returned as a lossless PNG image.
addCredential :: (HasCallStack, Marionette m) => AuthenticatorId -> Credential -> m () Source #
Add a credential to a virtual authenticator.
See https://www.w3.org/TR/webauthn-3/#sctn-automation-add-credential
addVirtualAuthenticator :: (HasCallStack, Marionette m) => VirtualAuthenticator -> m AuthenticatorId Source #
Add a virtual authenticator, returning its identifier.
See https://www.w3.org/TR/webauthn-3/#sctn-automation-add-virtual-authenticator
getCredentials :: (HasCallStack, Marionette m) => AuthenticatorId -> m [Credential] Source #
Get the credentials stored in a virtual authenticator.
See https://www.w3.org/TR/webauthn-3/#sctn-automation-get-credentials
removeAllCredentials :: (HasCallStack, Marionette m) => AuthenticatorId -> m () Source #
Remove all credentials from a virtual authenticator.
See https://www.w3.org/TR/webauthn-3/#sctn-automation-remove-all-credentials
removeCredential :: (HasCallStack, Marionette m) => AuthenticatorId -> CredentialId -> m () Source #
Remove a credential from a virtual authenticator.
See https://www.w3.org/TR/webauthn-3/#sctn-automation-remove-credential
removeVirtualAuthenticator :: (HasCallStack, Marionette m) => AuthenticatorId -> m () Source #
Remove a virtual authenticator.
See https://www.w3.org/TR/webauthn-3/#sctn-automation-remove-virtual-authenticator
setUserVerified :: (HasCallStack, Marionette m) => AuthenticatorId -> Bool -> m () Source #
Set the user-verified flag on a virtual authenticator.
See https://www.w3.org/TR/webauthn-3/#sctn-automation-set-user-verified