diff --git a/lib/capybara/selector/selector.rb b/lib/capybara/selector/selector.rb index 8b14c67f..efc703c3 100644 --- a/lib/capybara/selector/selector.rb +++ b/lib/capybara/selector/selector.rb @@ -19,18 +19,18 @@ module Capybara # * Locator: A CSS selector # # * **:id** - Select element by id - # * Locator: (String, Regexp) The id of the element to match () + # * 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.test_id attribute, name, or placeholder # * Filters: - # * :id (String) — Matches the id attribute + # * :id (String, Regexp, XPath::Expression) — Matches the id attribute # * :name (String) — Matches the name attribute # * :placeholder (String) — Matches the placeholder attribute # * :type (String) — Matches the type attribute of the field or element type for 'textarea' and 'select' # * :readonly (Boolean) # * :with (String) — Matches the current value of the field - # * :class (String, Array) — Matches the class(es) provided + # * :class (String, Array, Regexp, XPath::Expression) — Matches the class(es) provided # * :checked (Boolean) — Match checked fields? # * :unchecked (Boolean) — Match unchecked fields? # * :disabled (Boolean) — Match disabled field? @@ -39,25 +39,25 @@ module Capybara # * **:fieldset** - Select fieldset elements # * Locator: Matches id or contents of wrapped legend # * Filters: - # * :id (String) — Matches id attribute + # * :id (String, Regexp, XPath::Expression) — Matches id attribute # * :legend (String) — Matches contents of wrapped legend - # * :class (String, Array) — Matches the class(es) provided + # * :class (String, Array, Regexp, XPath::Expression) — Matches the class(es) provided # # * **:link** - Find links ( elements with an href attribute ) # * Locator: Matches the id or title attributes, or the string content of the link, or the alt attribute of a contained img element # * Filters: - # * :id (String) — Matches the id attribute + # * :id (String, Regexp, XPath::Expression) — Matches the id attribute # * :title (String) — Matches the title attribute # * :alt (String) — Matches the alt attribute of a contained img element - # * :class (String) — Matches the class(es) provided + # * :class (String, Array, Regexp, XPath::Expression) — Matches the class(es) provided # * :href (String, Regexp, nil) — Matches the normalized href of the link, if nil will find elements with no href attribute # # * **:button** - Find buttons ( input [of type submit, reset, image, button] or button elements ) # * Locator: Matches the id, Capybara.test_id attribute, value, or title attributes, string content of a button, or the alt attribute of an image type button or of a descendant image of a button # * Filters: - # * :id (String) — Matches the id attribute + # * :id (String, Regexp, XPath::Expression) — Matches the id attribute # * :title (String) — Matches the title attribute - # * :class (String) — Matches the class(es) provided + # * :class (String, Array, Regexp, XPath::Expression) — Matches the class(es) provided # * :value (String) — Matches the value of an input button # * :type # @@ -67,21 +67,21 @@ module Capybara # * **:fillable_field** - Find text fillable fields ( textarea, input [not of type submit, image, radio, checkbox, hidden, file] ) # * Locator: Matches against the id, Capybara.test_id attribute, name, or placeholder # * Filters: - # * :id (String) — Matches the id attribute + # * :id (String, Regexp, XPath::Expression) — Matches the id attribute # * :name (String) — Matches the name attribute # * :placeholder (String) — Matches the placeholder attribute # * :with (String) — Matches the current value of the field # * :type (String) — Matches the type attribute of the field or element type for 'textarea' - # * :class (String, Array) — Matches the class(es) provided + # * :class (String, Array, Regexp, XPath::Expression) — Matches the class(es) provided # * :disabled (Boolean) — Match disabled field? # * :multiple (Boolean) — Match fields that accept multiple values # # * **:radio_button** - Find radio buttons # * Locator: Match id, Capybara.test_id attribute, name, or associated label text # * Filters: - # * :id (String) — Matches the id attribute + # * :id (String, Regexp, XPath::Expression) — Matches the id attribute # * :name (String) — Matches the name attribute - # * :class (String, Array) — Matches the class(es) provided + # * :class (String, Array, Regexp, XPath::Expression) — Matches the class(es) provided # * :checked (Boolean) — Match checked fields? # * :unchecked (Boolean) — Match unchecked fields? # * :disabled (Boolean) — Match disabled field? @@ -90,9 +90,9 @@ module Capybara # * **:checkbox** - Find checkboxes # * Locator: Match id, Capybara.test_id attribute, name, or associated label text # * Filters: - # * *:id (String) — Matches the id attribute + # * *:id (String, Regexp, XPath::Expression) — Matches the id attribute # * *:name (String) — Matches the name attribute - # * *:class (String, Array) — Matches the class(es) provided + # * *:class (String, Array, Regexp, XPath::Expression) — Matches the class(es) provided # * *:checked (Boolean) — Match checked fields? # * *:unchecked (Boolean) — Match unchecked fields? # * *:disabled (Boolean) — Match disabled field? @@ -101,10 +101,10 @@ module Capybara # * **:select** - Find select elements # * Locator: Match id, Capybara.test_id attribute, name, placeholder, or associated label text # * Filters: - # * :id (String) — Matches the id attribute + # * :id (String, Regexp, XPath::Expression) — Matches the id attribute # * :name (String) — Matches the name attribute # * :placeholder (String) — Matches the placeholder attribute - # * :class (String, Array) — Matches the class(es) provided + # * :class (String, Array, Regexp, XPath::Expression) — Matches the class(es) provided # * :disabled (Boolean) — Match disabled field? # * :multiple (Boolean) — Match fields that accept multiple values # * :options (Array) — Exact match options @@ -131,9 +131,9 @@ module Capybara # * **:file_field** - Find file input elements # * Locator: Match id, Capybara.test_id attribute, name, or associated label text # * Filters: - # * :id (String) — Matches the id attribute + # * :id (String, Regexp, XPath::Expression) — Matches the id attribute # * :name (String) — Matches the name attribute - # * :class (String, Array) — Matches the class(es) provided + # * :class (String, Array, Regexp, XPath::Expression) — Matches the class(es) provided # * :disabled (Boolean) — Match disabled field? # * :multiple (Boolean) — Match field that accepts multiple values # @@ -145,16 +145,16 @@ module Capybara # * **:table** - Find table elements # * Locator: id or caption text of table # * Filters: - # * :id (String) — Match id attribute of table + # * :id (String, Regexp, XPath::Expression) — Match id attribute of table # * :caption (String) — Match text of associated caption - # * :class (String, Array) — Matches the class(es) provided + # * :class ((String, Array, Regexp, XPath::Expression) — Matches the class(es) provided # # * **:frame** - Find frame/iframe elements # * Locator: Match id or name # * Filters: - # * :id (String) — Match id attribute + # * :id (String, Regexp, XPath::Expression) — Match id attribute # * :name (String) — Match name attribute - # * :class (String, Array) — Matches the class(es) provided + # * :class (String, Array, Regexp, XPath::Expression) — Matches the class(es) provided # # * **:element** # * Locator: Type of element ('div', 'a', etc) - if not specified defaults to '*'