Skip to content

Commit

Permalink
More documentation updates/corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
twalpole committed May 31, 2019
1 parent 320ee96 commit 951e4ce
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
24 changes: 13 additions & 11 deletions lib/capybara/node/actions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def click_button(locator = nil, **options)
##
#
# Locate a text field or text area and fill it in with the given text.
# The field can be found via its name, id, {Capybara.configure test_id} attribute, or label text.
# The field can be found via its name, id, {Capybara.configure test_id} attribute, placeholder, or label text.
# If no locator is provided this will operate on self or a descendant.
#
# # will fill in a descendant fillable field with name, id, or label text matching 'Name'
Expand Down Expand Up @@ -98,8 +98,8 @@ def fill_in(locator = nil, with:, currently_with: nil, fill_options: {}, **find_
##
#
# Find a descendant radio button and mark it as checked. The radio button can be found
# via name, id or label text. If no locator is provided this will match against self or
# a descendant.
# via name, id, {Capybara.configure test_id} attribute or label text. If no locator is
# provided this will match against self or a descendant.
#
# # will choose a descendant radio button with a name, id, or label text matching 'Male'
# page.choose('Male')
Expand All @@ -125,8 +125,8 @@ def choose(locator = nil, **options)
##
#
# Find a descendant check box and mark it as checked. The check box can be found
# via name, id or label text. If no locator is provided this will match against
# self or a descendant.
# via name, id, {Capybara.configure test_id} attribute, or label text. If no locator
# is provided this will match against self or a descendant.
#
# # will check a descendant checkbox with a name, id, or label text matching 'German'
# page.check('German')
Expand All @@ -153,8 +153,8 @@ def check(locator = nil, **options)
##
#
# Find a descendant check box and uncheck it. The check box can be found
# via name, id or label text. If no locator is provided this will match against
# self or a descendant.
# via name, id, {Capybara.configure test_id} attribute, or label text. If
# no locator is provided this will match against self or a descendant.
#
# # will uncheck a descendant checkbox with a name, id, or label text matching 'German'
# page.uncheck('German')
Expand Down Expand Up @@ -185,7 +185,8 @@ def uncheck(locator = nil, **options)
# Otherwise it finds an option inside current scope and selects it.
# If the select box is a multiple select, {#select} can be called multiple times to select more than
# one option.
# The select box can be found via its name, id or label text. The option can be found by its text.
# The select box can be found via its name, id, {Capybara.configure test_id} attribute, or label text.
# The option can be found by its text.
#
# page.select 'March', from: 'Month'
#
Expand All @@ -212,7 +213,8 @@ def select(value = nil, from: nil, **options)
#
# Find a select box on the page and unselect a particular option from it. If the select
# box is a multiple select, {#unselect} can be called multiple times to unselect more than
# one option. The select box can be found via its name, id or label text.
# one option. The select box can be found via its name, id, {Capybara.configure test_id} attribute,
# or label text.
#
# page.unselect 'March', from: 'Month'
#
Expand All @@ -234,8 +236,8 @@ def unselect(value = nil, from: nil, **options)
##
#
# Find a descendant file field on the page and attach a file given its path. There are two ways to use
# {#attach_file}, in the first method the file field can be found via its name, id or label text.
# In the case of the file field being hidden for
# {#attach_file}, in the first method the file field can be found via its name, id,
# {Capybara.configure test_id} attribute, or label text. In the case of the file field being hidden for
# styling reasons the `make_visible` option can be used to temporarily change the CSS of
# the file field, attach the file, and then revert the CSS back to original. If no locator is
# passed this will match self or a descendant.
Expand Down
14 changes: 8 additions & 6 deletions lib/capybara/selector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
# * Locator: (String, Regexp, XPath::Expression) The id of the element to match
#
# * **:field** - Select field elements (input [not of type submit, image, or hidden], textarea, select)
# * Locator: Matches against the id, {Capybara.configure test_id} attribute, name, or placeholder
# * Locator: Matches against the id, {Capybara.configure test_id} attribute, name, placeholder, or
# associated label text
# * Filters:
# * :name (String) - Matches the name attribute
# * :placeholder (String) - Matches the placeholder attribute
Expand All @@ -41,8 +42,8 @@
# * :disabled (Boolean) - Match disabled fieldset?
#
# * **:link** - Find links (`<a>` elements with an href attribute)
# * Locator: Matches the id, {Capybara.configure test_id}, or title attributes, or the string content of the link, or the alt attribute of a contained img element.
# By default this selector requires a link to have an href attribute.
# * Locator: Matches the id, {Capybara.configure test_id}, or title attributes, or the string content of the link,
# or the alt attribute of a contained img element. By default this selector requires a link to have an href attribute.
# * Filters:
# * :title (String) - Matches the title attribute
# * :alt (String) - Matches the alt attribute of a contained img element
Expand All @@ -63,7 +64,7 @@
# * :disabled (Boolean, :all) - Match disabled buttons? (Default: false)
#
# * **:fillable_field** - Find text fillable fields ( textarea, input [not of type submit, image, radio, checkbox, hidden, file] )
# * Locator: Matches against the id, {Capybara.configure test_id} attribute, name, or placeholder
# * Locator: Matches against the id, {Capybara.configure test_id} attribute, name, placeholder, or associated label text
# * Filters:
# * :name (String) - Matches the name attribute
# * :placeholder (String) - Matches the placeholder attribute
Expand Down Expand Up @@ -111,7 +112,8 @@
# * :selected (Boolean) - Match selected option
#
# * **:datalist_input** - Find input field with datalist completion
# * Locator: Matches against the id, {Capybara.configure test_id} attribute, name, or placeholder
# * Locator: Matches against the id, {Capybara.configure test_id} attribute, name,
# placeholder, or associated label text
# * Filters:
# * :name (String) - Matches the name attribute
# * :placeholder (String) - Matches the placeholder attribute
Expand Down Expand Up @@ -149,7 +151,7 @@
# * Locator: Array<String>, Hash<String, String> table row `<td>` contents - visibility of `<td>` elements is not considered
#
# * **:frame** - Find frame/iframe elements
# * Locator: Match id or name
# * Locator: Match id, {Capybara.configure test_id} attribute, or name
# * Filters:
# * :name (String) - Match name attribute
#
Expand Down

0 comments on commit 951e4ce

Please sign in to comment.