wallaby v0.9.0 Wallaby.DSL.Actions
Provides the action DSL.
Actions are used to interact with form elements. They follow the same conventions as Wallaby.Node.Query. Form elements can be found based on their id, name, or label text:
<label for="first_name">
First Name
</label>
<input id="user_first_name" type="text" name="first_name">
fill_in(page, "First Name", with: "Grace")
fill_in(page, "first_name", with: "Grace")
fill_in(page, "user_first_name", with: "Grace")
Note that the id selector does not need the #
. This makes it easier to use
with the ids generated by phoenix form helpers.
There are several helpers for different interacting with different form elements.
fill_in(page, "First Name", with: "Chris")
choose(page, "Radio Button 1")
check(page, "Checkbox")
uncheck(page, "Checkbox")
select(page, "My Awesome Select", option: "Option 1")
click_on(page, "Some Button")
Actions return their parent node so that they can be chained together:
page
|> find(".signup-form")
|> fill_in("Name", with: "Grace Hopper")
|> fill_in("Email", with: "grace@hopper.com")
|> click_on("Submit")
Summary
Functions
Checks a checkbox based on id, label text, or name
Chooses a radio button based on id, label text, or name
Clicks the matching button. Buttons can be found based on id, name, or button text
Clicks the matching link. Links can be found based on id, name, or link text
Clicks on the matching button. Alias for click_button
Fills in a “fillable” node with text. Input nodes are looked up by id, label text, or name
Selects an option from a select box. The select box can be found by id, label text, or name. The option can be found by its text
Unchecks a checkbox based on id, label text, or name
Types
Functions
Checks a checkbox based on id, label text, or name.
Chooses a radio button based on id, label text, or name.
Clicks the matching button. Buttons can be found based on id, name, or button text.
Clicks the matching link. Links can be found based on id, name, or link text.
Clicks on the matching button. Alias for click_button
.
Fills in a “fillable” node with text. Input nodes are looked up by id, label text, or name.
Selects an option from a select box. The select box can be found by id, label text, or name. The option can be found by its text.