Skip to content

Instantly share code, notes, and snippets.

@diervo
Created January 23, 2021 02:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diervo/931d9f68a08922efb3341c6faff3caea to your computer and use it in GitHub Desktop.
Save diervo/931d9f68a08922efb3341c6faff3caea to your computer and use it in GitHub Desktop.
micromark parsing
## Supported Basic Actions
[Basic elements](#basic-element) support these public methods.
- `click` and `waitForClickable` are applicable only to elements with `"type": "clickable"` and `"type": "editable"`.
- `setText`, `clear`, and `clearAndType` are only applicable to elements with `"type": "editable"`.
- The remaining actions are applicable to any basic element type.
| Action | Summary |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `blur` | Applies a blur action to the element. |
| `clear` | If this element is a text entry element, the method clears the value. Otherwise throws exception. |
| `clearAndType` | Combines `clear` and `setText`: clears an element's value and replaces it with a provided string. |
| `click` | Apply click to the element. |
| `getAttribute` | Returns the string value of a given attribute. |
| `getClass` | Shortcut for `getAttribute("class")`. |
| `getText` | Returns a string with the `innerText` of an element. |
| `getTitle` | Shortcut for `getAttribute("title")`. |
| `getValue` | Shortcut for `getAttribute("value")`. |
| `isEnabled` | Returns `true` if the element is enabled. |
| `isFocused` | Returns `true` if the element has focus at the moment. |
| `isPresent` | Returns `true` if the element is found in the DOM. |
| `isVisible` | Returns `true` if the element is visible. |
| `moveTo` | Moves the mouse to the middle of the element AKA mouseover. |
| `scrollToCenter` | Scrolls the current element to the center of the screen by executing JavaScript `arguments[0].scrollIntoView({block:'center'})` |
| `scrollToTop` | Scroll to the element by executing JavaScript `return arguments[0].scrollIntoView(true);` |
| `setText` | Simulate typing text inside an element, which may set its value. |
| `waitForAbsence` | Polling wait action: waits for an element to be absent (not-attached to the DOM) within a timeout. Throws an exception after the timeout. |
| `waitForInvisible` | Polling wait action - waits for the element to become not displayed within the timeout. Expects element to be present while checking its visibility. |
| `waitForPresence` | Polling wait action - waits for the element to be present (attached to the DOM) within the timeout. |
| `waitForVisible` | Polling wait action - waits for the element to be visible within a timeout. Throw an error if element isn’t present |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment