capybara 3.21.0 → 3.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -0
  3. data/History.md +14 -0
  4. data/README.md +13 -8
  5. data/lib/capybara.rb +38 -32
  6. data/lib/capybara/driver/node.rb +2 -2
  7. data/lib/capybara/minitest.rb +14 -1
  8. data/lib/capybara/minitest/spec.rb +20 -7
  9. data/lib/capybara/node/finders.rb +41 -47
  10. data/lib/capybara/node/matchers.rb +161 -72
  11. data/lib/capybara/queries/ancestor_query.rb +9 -7
  12. data/lib/capybara/queries/sibling_query.rb +11 -4
  13. data/lib/capybara/result.rb +2 -0
  14. data/lib/capybara/rspec/matchers.rb +16 -1
  15. data/lib/capybara/rspec/matchers/have_ancestor.rb +30 -0
  16. data/lib/capybara/rspec/matchers/have_sibling.rb +30 -0
  17. data/lib/capybara/selector.rb +153 -171
  18. data/lib/capybara/selector/definition/checkbox.rb +8 -5
  19. data/lib/capybara/selector/definition/radio_button.rb +8 -5
  20. data/lib/capybara/selector/filter_set.rb +4 -2
  21. data/lib/capybara/selenium/driver_specializations/chrome_driver.rb +35 -1
  22. data/lib/capybara/session.rb +74 -71
  23. data/lib/capybara/session/config.rb +1 -1
  24. data/lib/capybara/spec/session/check_spec.rb +6 -0
  25. data/lib/capybara/spec/session/choose_spec.rb +6 -0
  26. data/lib/capybara/spec/session/has_ancestor_spec.rb +44 -0
  27. data/lib/capybara/spec/session/has_sibling_spec.rb +50 -0
  28. data/lib/capybara/spec/session/select_spec.rb +5 -5
  29. data/lib/capybara/spec/views/form.erb +1 -1
  30. data/lib/capybara/version.rb +1 -1
  31. data/lib/capybara/window.rb +10 -10
  32. data/spec/minitest_spec.rb +11 -1
  33. data/spec/minitest_spec_spec.rb +11 -1
  34. data/spec/regexp_dissassembler_spec.rb +1 -1
  35. metadata +7 -2
@@ -3,12 +3,20 @@
3
3
  module Capybara
4
4
  module Queries
5
5
  class AncestorQuery < Capybara::Queries::SelectorQuery
6
+ def initialize(*args)
7
+ super
8
+ @count_options = {}
9
+ COUNT_KEYS.each do |key|
10
+ @count_options[key] = @options.delete(key) if @options.key?(key)
11
+ end
12
+ end
13
+
6
14
  # @api private
7
15
  def resolve_for(node, exact = nil)
8
16
  @child_node = node
9
17
  node.synchronize do
10
18
  match_results = super(node.session.current_scope, exact)
11
- node.all(:xpath, XPath.ancestor) { |el| match_results.include?(el) }
19
+ node.all(:xpath, XPath.ancestor, **@count_options) { |el| match_results.include?(el) }
12
20
  end
13
21
  end
14
22
 
@@ -18,12 +26,6 @@ module Capybara
18
26
  desc += " that is an ancestor of #{child_query.description}" if child_query
19
27
  desc
20
28
  end
21
-
22
- private
23
-
24
- def valid_keys
25
- super - COUNT_KEYS
26
- end
27
29
  end
28
30
  end
29
31
  end
@@ -2,15 +2,22 @@
2
2
 
3
3
  module Capybara
4
4
  module Queries
5
- class SiblingQuery < MatchQuery
5
+ class SiblingQuery < SelectorQuery
6
+ def initialize(*args)
7
+ super
8
+ @count_options = {}
9
+ COUNT_KEYS.each do |key|
10
+ @count_options[key] = @options.delete(key) if @options.key?(key)
11
+ end
12
+ end
13
+
6
14
  # @api private
7
15
  def resolve_for(node, exact = nil)
8
16
  @sibling_node = node
9
17
  node.synchronize do
10
18
  match_results = super(node.session.current_scope, exact)
11
- node.all(:xpath, XPath.preceding_sibling + XPath.following_sibling) do |el|
12
- match_results.include?(el)
13
- end
19
+ xpath = XPath.preceding_sibling + XPath.following_sibling
20
+ node.all(:xpath, xpath, **@count_options) { |el| match_results.include?(el) }
14
21
  end
15
22
  end
16
23
 
@@ -76,6 +76,8 @@ module Capybara
76
76
  end
77
77
 
78
78
  def compare_count
79
+ return 0 unless @query
80
+
79
81
  count, min, max, between = @query.options.values_at(:count, :minimum, :maximum, :between)
80
82
 
81
83
  # Only check filters for as many elements as necessary to determine result
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'capybara/rspec/matchers/have_selector'
4
+ require 'capybara/rspec/matchers/have_ancestor'
5
+ require 'capybara/rspec/matchers/have_sibling'
4
6
  require 'capybara/rspec/matchers/match_selector'
5
7
  require 'capybara/rspec/matchers/have_current_path'
6
8
  require 'capybara/rspec/matchers/match_style'
@@ -138,7 +140,8 @@ module Capybara
138
140
  end
139
141
 
140
142
  %w[selector css xpath text title current_path link button
141
- field checked_field unchecked_field select table].each do |matcher_type|
143
+ field checked_field unchecked_field select table
144
+ sibling ancestor].each do |matcher_type|
142
145
  define_method "have_no_#{matcher_type}" do |*args, &optional_filter_block|
143
146
  Matchers::NegatedMatcher.new(send("have_#{matcher_type}", *args, &optional_filter_block))
144
147
  end
@@ -151,6 +154,18 @@ module Capybara
151
154
  end
152
155
  end
153
156
 
157
+ # RSpec matcher for whether sibling element(s) matching a given selector exist
158
+ # See {Capybara::Node::Matcher#assert_sibling}
159
+ def have_sibling(*args, &optional_filter_block)
160
+ Matchers::HaveSibling.new(*args, &optional_filter_block)
161
+ end
162
+
163
+ # RSpec matcher for whether ancestor element(s) matching a given selector exist
164
+ # See {Capybara::Node::Matcher#assert_ancestor}
165
+ def have_ancestor(*args, &optional_filter_block)
166
+ Matchers::HaveAncestor.new(*args, &optional_filter_block)
167
+ end
168
+
154
169
  ##
155
170
  # Wait for window to become closed.
156
171
  # @example
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'capybara/rspec/matchers/base'
4
+ require 'capybara/rspec/matchers/count_sugar'
5
+
6
+ module Capybara
7
+ module RSpecMatchers
8
+ module Matchers
9
+ class HaveAncestor < WrappedElementMatcher
10
+ include CountSugar
11
+
12
+ def element_matches?(el)
13
+ el.assert_ancestor(*@args, &@filter_block)
14
+ end
15
+
16
+ def element_does_not_match?(el)
17
+ el.assert_no_ancestor(*@args, &@filter_block)
18
+ end
19
+
20
+ def description
21
+ "have ancestor #{query.description}"
22
+ end
23
+
24
+ def query
25
+ @query ||= Capybara::Queries::AncestorQuery.new(*session_query_args, &@filter_block)
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'capybara/rspec/matchers/base'
4
+ require 'capybara/rspec/matchers/count_sugar'
5
+
6
+ module Capybara
7
+ module RSpecMatchers
8
+ module Matchers
9
+ class HaveSibling < WrappedElementMatcher
10
+ include CountSugar
11
+
12
+ def element_matches?(el)
13
+ el.assert_sibling(*@args, &@filter_block)
14
+ end
15
+
16
+ def element_does_not_match?(el)
17
+ el.assert_no_sibling(*@args, &@filter_block)
18
+ end
19
+
20
+ def description
21
+ "have sibling #{query.description}"
22
+ end
23
+
24
+ def query
25
+ @query ||= Capybara::Queries::SiblingQuery.new(*session_query_args, &@filter_block)
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -4,179 +4,161 @@ require 'capybara/selector/xpath_extensions'
4
4
  require 'capybara/selector/selector'
5
5
  require 'capybara/selector/definition'
6
6
 
7
- # rubocop:disable Style/AsciiComments
8
- #
9
- # ## Built-in Selectors
10
- #
11
- # * **:xpath** - Select elements by XPath expression
12
- # * Locator: An XPath expression
13
- #
14
- # * **:css** - Select elements by CSS selector
15
- # * Locator: A CSS selector
16
- #
17
- # * **:id** - Select element by id
18
- # * Locator: (String, Regexp, XPath::Expression) The id of the element to match
19
- #
20
- # * **:field** - Select field elements (input [not of type submit, image, or hidden], textarea, select)
21
- # * Locator: Matches against the id, Capybara.test_id attribute, name, or placeholder
22
- # * Filters:
23
- # * :id (String, Regexp, XPath::Expression) — Matches the id attribute
24
- # * :name (String) Matches the name attribute
25
- # * :placeholder (String) Matches the placeholder attribute
26
- # * :type (String) — Matches the type attribute of the field or element type for 'textarea' and 'select'
27
- # * :readonly (Boolean)
28
- # * :with (String) — Matches the current value of the field
29
- # * :class (String, Array<String>, Regexp, XPath::Expression) — Matches the class(es) provided
30
- # * :checked (Boolean) — Match checked fields?
31
- # * :unchecked (Boolean) — Match unchecked fields?
32
- # * :disabled (Boolean) — Match disabled field?
33
- # * :multiple (Boolean) — Match fields that accept multiple values
34
- # * :style (String, Regexp, Hash)
35
- #
36
- # * **:fieldset** - Select fieldset elements
37
- # * Locator: Matches id or contents of wrapped legend
38
- # * Filters:
39
- # * :id (String, Regexp, XPath::Expression) — Matches id attribute
40
- # * :legend (String) — Matches contents of wrapped legend
41
- # * :class (String, Array<String>, Regexp, XPath::Expression) — Matches the class(es) provided
42
- # * :style (String, Regexp, Hash)
43
- #
44
- # * **:link** - Find links ( <a> elements with an href attribute )
45
- # * Locator: Matches the id or title attributes, or the string content of the link, or the alt attribute of a contained img element
46
- # * Filters:
47
- # * :id (String, Regexp, XPath::Expression) — Matches the id attribute
48
- # * :title (String) — Matches the title attribute
49
- # * :alt (String) — Matches the alt attribute of a contained img element
50
- # * :class (String, Array<String>, Regexp, XPath::Expression) — Matches the class(es) provided
51
- # * :href (String, Regexp, nil, false) — Matches the normalized href of the link, if nil will find <a> elements with no href attribute, if false ignores href
52
- # * :style (String, Regexp, Hash)
53
- #
54
- # * **:button** - Find buttons ( input [of type submit, reset, image, button] or button elements )
55
- # * Locator: Matches the id, Capybara.test_id attribute, name, 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
56
- # * Filters:
57
- # * :id (String, Regexp, XPath::Expression) — Matches the id attribute
7
+ #
8
+ # All Selectors below support the listed selector specific filters in addition to the following system-wide filters
9
+ # * :id (String, Regexp, XPath::Expression) - Matches the id attribute
10
+ # * :class (String, Array<String>, Regexp, XPath::Expression) - Matches the class(es) provided
11
+ # * :style (String, Regexp, Hash<String,String>) - Match on elements style
12
+ #
13
+ # ### Built-in Selectors
14
+ #
15
+ # * **:xpath** - Select elements by XPath expression
16
+ # * Locator: An XPath expression
17
+ #
18
+ # * **:css** - Select elements by CSS selector
19
+ # * Locator: A CSS selector
20
+ #
21
+ # * **:id** - Select element by id
22
+ # * Locator: (String, Regexp, XPath::Expression) The id of the element to match
23
+ #
24
+ # * **:field** - Select field elements (input [not of type submit, image, or hidden], textarea, select)
25
+ # * Locator: Matches against the id, {Capybara.configure test_id} attribute, name, or placeholder
26
+ # * Filters:
58
27
  # * :name (String) - Matches the name attribute
59
- # * :title (String) Matches the title attribute
60
- # * :class (String, Array<String>, Regexp, XPath::Expression) Matches the class(es) provided
61
- # * :value (String) Matches the value of an input button
62
- # * :type
63
- # * :style (String, Regexp, Hash)
64
- #
65
- # * **:link_or_button** - Find links or buttons
66
- # * Locator: See :link and :button selectors
67
- #
68
- # * **:fillable_field** - Find text fillable fields ( textarea, input [not of type submit, image, radio, checkbox, hidden, file] )
69
- # * Locator: Matches against the id, Capybara.test_id attribute, name, or placeholder
70
- # * Filters:
71
- # * :id (String, Regexp, XPath::Expression) Matches the id attribute
72
- # * :name (String) Matches the name attribute
73
- # * :placeholder (String) — Matches the placeholder attribute
74
- # * :with (String) Matches the current value of the field
75
- # * :type (String) Matches the type attribute of the field or element type for 'textarea'
76
- # * :class (String, Array<String>, Regexp, XPath::Expression) Matches the class(es) provided
77
- # * :disabled (Boolean) — Match disabled field?
78
- # * :multiple (Boolean) Match fields that accept multiple values
79
- # * :style (String, Regexp, Hash)
80
- #
81
- # * **:radio_button** - Find radio buttons
82
- # * Locator: Match id, Capybara.test_id attribute, name, or associated label text
83
- # * Filters:
84
- # * :id (String, Regexp, XPath::Expression) — Matches the id attribute
85
- # * :name (String) Matches the name attribute
86
- # * :class (String, Array<String>, Regexp, XPath::Expression) Matches the class(es) provided
87
- # * :checked (Boolean) Match checked fields?
88
- # * :unchecked (Boolean) Match unchecked fields?
89
- # * :disabled (Boolean) Match disabled field?
90
- # * :option (String) — Match the value
91
- # * :style (String, Regexp, Hash)
92
- #
93
- # * **:checkbox** - Find checkboxes
94
- # * Locator: Match id, Capybara.test_id attribute, name, or associated label text
95
- # * Filters:
96
- # * *:id (String, Regexp, XPath::Expression) Matches the id attribute
97
- # * *:name (String) Matches the name attribute
98
- # * *:class (String, Array<String>, Regexp, XPath::Expression) — Matches the class(es) provided
99
- # * *:checked (Boolean) Match checked fields?
100
- # * *:unchecked (Boolean) Match unchecked fields?
101
- # * *:disabled (Boolean) Match disabled field?
102
- # * *:option (String) Match the value
103
- # * :style (String, Regexp, Hash)
104
- #
105
- # * **:select** - Find select elements
106
- # * Locator: Match id, Capybara.test_id attribute, name, placeholder, or associated label text
107
- # * Filters:
108
- # * :id (String, Regexp, XPath::Expression) — Matches the id attribute
109
- # * :name (String) Matches the name attribute
110
- # * :placeholder (String) Matches the placeholder attribute
111
- # * :class (String, Array<String>, Regexp, XPath::Expression) Matches the class(es) provided
112
- # * :disabled (Boolean) Match disabled field?
113
- # * :multiple (Boolean) Match fields that accept multiple values
114
- # * :options (Array<String>) Exact match options
115
- # * :with_options (Array<String>) — Partial match options
116
- # * :selected (String, Array<String>) — Match the selection(s)
117
- # * :with_selected (String, Array<String>) Partial match the selection(s)
118
- # * :style (String, Regexp, Hash)
119
- #
120
- # * **:option** - Find option elements
121
- # * Locator: Match text of option
122
- # * Filters:
123
- # * :disabled (Boolean) Match disabled option
124
- # * :selected (Boolean) Match selected option
125
- #
126
- # * **:datalist_input**
127
- # * Locator:
128
- # * Filters:
129
- # * :disabled
130
- # * :name
131
- # * :placeholder
132
- #
133
- # * **:datalist_option**
134
- # * Locator:
135
- #
136
- # * **:file_field** - Find file input elements
137
- # * Locator: Match id, Capybara.test_id attribute, name, or associated label text
138
- # * Filters:
139
- # * :id (String, Regexp, XPath::Expression) — Matches the id attribute
140
- # * :name (String) — Matches the name attribute
141
- # * :class (String, Array<String>, Regexp, XPath::Expression) Matches the class(es) provided
142
- # * :disabled (Boolean) Match disabled field?
143
- # * :multiple (Boolean) — Match field that accepts multiple values
144
- # * :style (String, Regexp, Hash)
145
- #
146
- # * **:label** - Find label elements
147
- # * Locator: Match id or text contents
148
- # * Filters:
149
- # * :for (Element, String, Regexp) The element or id of the element associated with the label
150
- #
151
- # * **:table** - Find table elements
152
- # * Locator: id or caption text of table
153
- # * Filters:
154
- # * :id (String, Regexp, XPath::Expression) Match id attribute of table
155
- # * :caption (String) — Match text of associated caption
156
- # * :class ((String, Array<String>, Regexp, XPath::Expression) Matches the class(es) provided
157
- # * :style (String, Regexp, Hash)
158
- # * :with_rows (Array<Array<String>>, Array<Hash<String, String>>) - Partial match <td> data - visibility of <td> elements is not considered
159
- # * :rows (Array<Array<String>>) — Match all <td>s - visibility of <td> elements is not considered
160
- # * :with_cols (Array<Array<String>>, Array<Hash<String, String>>) - Partial match <td> data - visibility of <td> elements is not considered
161
- # * :cols (Array<Array<String>>) — Match all <td>s - visibility of <td> elements is not considered
162
- #
163
- # * **:table_row** - Find table row
164
- # * Locator: Array<String>, Hash<String,String> table row <td> contents - visibility of <td> elements is not considered
165
- #
166
- # * **:frame** - Find frame/iframe elements
167
- # * Locator: Match id or name
168
- # * Filters:
169
- # * :id (String, Regexp, XPath::Expression) — Match id attribute
170
- # * :name (String) Match name attribute
171
- # * :class (String, Array<String>, Regexp, XPath::Expression) Matches the class(es) provided
172
- # * :style (String, Regexp, Hash)
173
- #
174
- # * **:element**
175
- # * Locator: Type of element ('div', 'a', etc) - if not specified defaults to '*'
176
- # * Filters: Matches on any element attribute
177
- class Capybara::Selector; end
28
+ # * :placeholder (String) - Matches the placeholder attribute
29
+ # * :type (String) - Matches the type attribute of the field or element type for 'textarea' and 'select'
30
+ # * :readonly (Boolean) - Match on the element being readonly
31
+ # * :with (String, Regexp) - Matches the current value of the field
32
+ # * :checked (Boolean) - Match checked fields?
33
+ # * :unchecked (Boolean) - Match unchecked fields?
34
+ # * :disabled (Boolean, :all) - Match disabled field? (Default: false)
35
+ # * :multiple (Boolean) - Match fields that accept multiple values
36
+ #
37
+ # * **:fieldset** - Select fieldset elements
38
+ # * Locator: Matches id, {Capybara.configure test_id}, or contents of wrapped legend
39
+ # * Filters:
40
+ # * :legend (String) - Matches contents of wrapped legend
41
+ # * :disabled (Boolean) - Match disabled fieldset?
42
+ #
43
+ # * **:link** - Find links (`<a>` elements with an href attribute)
44
+ # * 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.
45
+ # By default this selector requires a link to have an href attribute.
46
+ # * Filters:
47
+ # * :title (String) - Matches the title attribute
48
+ # * :alt (String) - Matches the alt attribute of a contained img element
49
+ # * :href (String, Regexp, nil, false) - Matches the normalized href of the link, if nil will find `<a>` elements with no href attribute, if false ignores href presence
50
+ #
51
+ # * **:button** - Find buttons ( input [of type submit, reset, image, button] or button elements )
52
+ # * Locator: Matches the id, {Capybara.configure test_id} attribute, name, 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
53
+ # * Filters:
54
+ # * :name (String) - Matches the name attribute
55
+ # * :title (String) - Matches the title attribute
56
+ # * :value (String) - Matches the value of an input button
57
+ # * :type (String) - Matches the type attribute
58
+ # * :disabled (Boolean, :all) - Match disabled buttons (Default: false)
59
+ #
60
+ # * **:link_or_button** - Find links or buttons
61
+ # * Locator: See :link and :button selectors
62
+ # * Filters:
63
+ # * :disabled (Boolean, :all) - Match disabled buttons? (Default: false)
64
+ #
65
+ # * **:fillable_field** - Find text fillable fields ( textarea, input [not of type submit, image, radio, checkbox, hidden, file] )
66
+ # * Locator: Matches against the id, {Capybara.configure test_id} attribute, name, or placeholder
67
+ # * Filters:
68
+ # * :name (String) - Matches the name attribute
69
+ # * :placeholder (String) - Matches the placeholder attribute
70
+ # * :with (String, Regexp) - Matches the current value of the field
71
+ # * :type (String) - Matches the type attribute of the field or element type for 'textarea'
72
+ # * :disabled (Boolean, :all) - Match disabled field? (Default: false)
73
+ # * :multiple (Boolean) - Match fields that accept multiple values
74
+ #
75
+ # * **:radio_button** - Find radio buttons
76
+ # * Locator: Match id, {Capybara.configure test_id} attribute, name, or associated label text
77
+ # * Filters:
78
+ # * :name (String) - Matches the name attribute
79
+ # * :checked (Boolean) - Match checked fields?
80
+ # * :unchecked (Boolean) - Match unchecked fields?
81
+ # * :disabled (Boolean, :all) - Match disabled field? (Default: false)
82
+ # * :option (String, Regexp) - Match the current value
83
+ # * :with - Alias of :option
84
+ #
85
+ # * **:checkbox** - Find checkboxes
86
+ # * Locator: Match id, {Capybara.configure test_id} attribute, name, or associated label text
87
+ # * Filters:
88
+ # * :name (String) - Matches the name attribute
89
+ # * :checked (Boolean) - Match checked fields?
90
+ # * :unchecked (Boolean) - Match unchecked fields?
91
+ # * :disabled (Boolean, :all) - Match disabled field? (Default: false)
92
+ # * :option (String, Regexp) - Match the current value
93
+ # * :with - Alias of :option
94
+ #
95
+ # * **:select** - Find select elements
96
+ # * Locator: Match id, {Capybara.configure test_id} attribute, name, placeholder, or associated label text
97
+ # * Filters:
98
+ # * :name (String) - Matches the name attribute
99
+ # * :placeholder (String) - Matches the placeholder attribute
100
+ # * :disabled (Boolean, :all) - Match disabled field? (Default: false)
101
+ # * :multiple (Boolean) - Match fields that accept multiple values
102
+ # * :options (Array<String>) - Exact match options
103
+ # * :with_options (Array<String>) - Partial match options
104
+ # * :selected (String, Array<String>) - Match the selection(s)
105
+ # * :with_selected (String, Array<String>) - Partial match the selection(s)
106
+ #
107
+ # * **:option** - Find option elements
108
+ # * Locator: Match text of option
109
+ # * Filters:
110
+ # * :disabled (Boolean) - Match disabled option
111
+ # * :selected (Boolean) - Match selected option
112
+ #
113
+ # * **:datalist_input** - Find input field with datalist completion
114
+ # * Locator: Matches against the id, {Capybara.configure test_id} attribute, name, or placeholder
115
+ # * Filters:
116
+ # * :name (String) - Matches the name attribute
117
+ # * :placeholder (String) - Matches the placeholder attribute
118
+ # * :disabled (Boolean, :all) - Match disabled field? (Default: false)
119
+ # * :options (Array<String>) - Exact match options
120
+ # * :with_options (Array<String>) - Partial match options
121
+ #
122
+ # * **:datalist_option** - Find datalist option
123
+ # * Locator: Match text or value of option
124
+ # * Filters:
125
+ # * :disabled (Boolean) - Match disabled option
126
+ #
127
+ # * **:file_field** - Find file input elements
128
+ # * Locator: Match id, {Capybara.configure test_id} attribute, name, or associated label text
129
+ # * Filters:
130
+ # * :name (String) - Matches the name attribute
131
+ # * :disabled (Boolean, :all) - Match disabled field? (Default: false)
132
+ # * :multiple (Boolean) - Match field that accepts multiple values
133
+ #
134
+ # * **:label** - Find label elements
135
+ # * Locator: Match id, {Capybara.configure test_id}, or text contents
136
+ # * Filters:
137
+ # * :for (Element, String, Regexp) - The element or id of the element associated with the label
138
+ #
139
+ # * **:table** - Find table elements
140
+ # * Locator: id, {Capybara.configure test_id}, or caption text of table
141
+ # * Filters:
142
+ # * :caption (String) - Match text of associated caption
143
+ # * :with_rows (Array<Array<String>>, Array<Hash<String, String>>) - Partial match `<td>` data - visibility of `<td>` elements is not considered
144
+ # * :rows (Array<Array<String>>) - Match all `<td>`s - visibility of `<td>` elements is not considered
145
+ # * :with_cols (Array<Array<String>>, Array<Hash<String, String>>) - Partial match `<td>` data - visibility of `<td>` elements is not considered
146
+ # * :cols (Array<Array<String>>) - Match all `<td>`s - visibility of `<td>` elements is not considered
147
+ #
148
+ # * **:table_row** - Find table row
149
+ # * Locator: Array<String>, Hash<String,String> table row `<td>` contents - visibility of `<td>` elements is not considered
150
+ #
151
+ # * **:frame** - Find frame/iframe elements
152
+ # * Locator: Match id or name
153
+ # * Filters:
154
+ # * :name (String) - Match name attribute
155
+ #
156
+ # * **:element**
157
+ # * Locator: Type of element ('div', 'a', etc) - if not specified defaults to '*'
158
+ # * Filters:
159
+ # * :&lt;any> (String, Regexp) - Match on any specified element attribute
178
160
  #
179
- # rubocop:enable Style/AsciiComments
161
+ class Capybara::Selector; end
180
162
 
181
163
  Capybara::Selector::FilterSet.add(:_field) do
182
164
  node_filter(:checked, :boolean) { |node, value| !(value ^ node.checked?) }