Wallaby.Element (wallaby v0.28.0) View Source
Defines an Element Struct and interactions with Elements.
Typically these functions are used in conjunction with a find
:
page
|> find(Query.css(".some-element"), fn(element) -> Element.click(element) end)
These functions can be used to create new actions specific to your application:
def create_todo(todo_field, todo_text) do
todo_field
|> Element.click()
|> Element.fill_in(with: todo_text)
|> Element.send_keys([:enter])
end
Retrying
Unlike Browser
the actions in Element
do not retry if the element becomes stale. Instead an exception will be raised.
Link to this section Summary
Functions
Gets the value of the element's attribute.
Clears any value set in the element.
Clicks the element.
Fills in the element with the specified value.
Hovers on the element.
Returns a tuple {x, y}
with the coordinates of the left-top corner of given element.
Returns a boolean based on whether or not the element is selected.
Sends keys to the element.
Sets the value of the element.
Returns a tuple {width, height}
with the size of the given element.
Taps the element.
Gets the element's text value.
Touches and holds the element on its top-left corner plus an optional offset.
Scroll on the screen from the given element by the given offset using touch events.
Matches the Element's value with the provided value.
Returns a boolean based on whether or not the element is visible.
Link to this section Types
Link to this section Functions
Specs
Gets the value of the element's attribute.
Specs
Clears any value set in the element.
Clicks the element.
Specs
Fills in the element with the specified value.
Specs
Hovers on the element.
Specs
Returns a tuple {x, y}
with the coordinates of the left-top corner of given element.
Specs
Returns a boolean based on whether or not the element is selected.
Note
This only really makes sense for options, checkboxes, and radio buttons. Everything else will simply return false because they have no notion of "selected".
Specs
send_keys(t(), keys_to_send()) :: t()
Sends keys to the element.
Specs
Sets the value of the element.
Specs
Returns a tuple {width, height}
with the size of the given element.
Specs
Taps the element.
Specs
Gets the element's text value.
If the element is not visible, the return value will be ""
.
Specs
Touches and holds the element on its top-left corner plus an optional offset.
Specs
Scroll on the screen from the given element by the given offset using touch events.
Specs
Matches the Element's value with the provided value.
Specs
Returns a boolean based on whether or not the element is visible.