wallaby v0.17.0 Wallaby.Element
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.
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
Returns a boolean based on whether or not the element is selected
Sends keys to the element
Sets the value of the element
Returns the text from the element
Matches the Element’s value with the provided value
Returns a boolean based on whether or not the element is visible
Types
Functions
Fills in the element with the specified value.
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”.
Sends keys to the element.
Returns a boolean based on whether or not the element is visible.