capybara 3.21.0 → 3.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.yardopts +1 -0
- data/History.md +14 -0
- data/README.md +13 -8
- data/lib/capybara.rb +38 -32
- data/lib/capybara/driver/node.rb +2 -2
- data/lib/capybara/minitest.rb +14 -1
- data/lib/capybara/minitest/spec.rb +20 -7
- data/lib/capybara/node/finders.rb +41 -47
- data/lib/capybara/node/matchers.rb +161 -72
- data/lib/capybara/queries/ancestor_query.rb +9 -7
- data/lib/capybara/queries/sibling_query.rb +11 -4
- data/lib/capybara/result.rb +2 -0
- data/lib/capybara/rspec/matchers.rb +16 -1
- data/lib/capybara/rspec/matchers/have_ancestor.rb +30 -0
- data/lib/capybara/rspec/matchers/have_sibling.rb +30 -0
- data/lib/capybara/selector.rb +153 -171
- data/lib/capybara/selector/definition/checkbox.rb +8 -5
- data/lib/capybara/selector/definition/radio_button.rb +8 -5
- data/lib/capybara/selector/filter_set.rb +4 -2
- data/lib/capybara/selenium/driver_specializations/chrome_driver.rb +35 -1
- data/lib/capybara/session.rb +74 -71
- data/lib/capybara/session/config.rb +1 -1
- data/lib/capybara/spec/session/check_spec.rb +6 -0
- data/lib/capybara/spec/session/choose_spec.rb +6 -0
- data/lib/capybara/spec/session/has_ancestor_spec.rb +44 -0
- data/lib/capybara/spec/session/has_sibling_spec.rb +50 -0
- data/lib/capybara/spec/session/select_spec.rb +5 -5
- data/lib/capybara/spec/views/form.erb +1 -1
- data/lib/capybara/version.rb +1 -1
- data/lib/capybara/window.rb +10 -10
- data/spec/minitest_spec.rb +11 -1
- data/spec/minitest_spec_spec.rb +11 -1
- data/spec/regexp_dissassembler_spec.rb +1 -1
- 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 <
|
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
|
-
|
12
|
-
|
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
|
|
data/lib/capybara/result.rb
CHANGED
@@ -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
|
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
|
data/lib/capybara/selector.rb
CHANGED
@@ -4,179 +4,161 @@ require 'capybara/selector/xpath_extensions'
|
|
4
4
|
require 'capybara/selector/selector'
|
5
5
|
require 'capybara/selector/definition'
|
6
6
|
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
# *
|
12
|
-
#
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
26
|
-
#
|
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
|
-
# * :
|
60
|
-
# * :
|
61
|
-
# * :
|
62
|
-
# * :
|
63
|
-
# * :
|
64
|
-
#
|
65
|
-
#
|
66
|
-
#
|
67
|
-
#
|
68
|
-
#
|
69
|
-
#
|
70
|
-
#
|
71
|
-
# * :
|
72
|
-
# * :
|
73
|
-
#
|
74
|
-
#
|
75
|
-
#
|
76
|
-
#
|
77
|
-
#
|
78
|
-
# * :
|
79
|
-
# * :
|
80
|
-
#
|
81
|
-
#
|
82
|
-
#
|
83
|
-
#
|
84
|
-
#
|
85
|
-
# * :name (String)
|
86
|
-
# * :
|
87
|
-
# * :
|
88
|
-
# * :
|
89
|
-
# * :disabled (Boolean)
|
90
|
-
#
|
91
|
-
#
|
92
|
-
#
|
93
|
-
# *
|
94
|
-
#
|
95
|
-
#
|
96
|
-
#
|
97
|
-
#
|
98
|
-
#
|
99
|
-
# *
|
100
|
-
# *
|
101
|
-
# *
|
102
|
-
# *
|
103
|
-
# * :
|
104
|
-
#
|
105
|
-
#
|
106
|
-
#
|
107
|
-
#
|
108
|
-
#
|
109
|
-
# * :name (String)
|
110
|
-
# * :
|
111
|
-
# * :
|
112
|
-
# * :disabled (Boolean)
|
113
|
-
# * :
|
114
|
-
# * :
|
115
|
-
#
|
116
|
-
#
|
117
|
-
#
|
118
|
-
#
|
119
|
-
#
|
120
|
-
#
|
121
|
-
#
|
122
|
-
#
|
123
|
-
# * :
|
124
|
-
# * :
|
125
|
-
#
|
126
|
-
#
|
127
|
-
#
|
128
|
-
#
|
129
|
-
# * :
|
130
|
-
# * :
|
131
|
-
# * :
|
132
|
-
#
|
133
|
-
#
|
134
|
-
#
|
135
|
-
#
|
136
|
-
#
|
137
|
-
#
|
138
|
-
#
|
139
|
-
#
|
140
|
-
#
|
141
|
-
# * :
|
142
|
-
# * :
|
143
|
-
#
|
144
|
-
#
|
145
|
-
#
|
146
|
-
# *
|
147
|
-
#
|
148
|
-
#
|
149
|
-
# * :
|
150
|
-
#
|
151
|
-
#
|
152
|
-
#
|
153
|
-
#
|
154
|
-
#
|
155
|
-
#
|
156
|
-
# * :
|
157
|
-
#
|
158
|
-
#
|
159
|
-
#
|
160
|
-
#
|
161
|
-
# * :
|
162
|
-
#
|
163
|
-
#
|
164
|
-
#
|
165
|
-
#
|
166
|
-
# *
|
167
|
-
#
|
168
|
-
#
|
169
|
-
#
|
170
|
-
#
|
171
|
-
#
|
172
|
-
#
|
173
|
-
#
|
174
|
-
#
|
175
|
-
#
|
176
|
-
#
|
177
|
-
|
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
|
+
# * :<any> (String, Regexp) - Match on any specified element attribute
|
178
160
|
#
|
179
|
-
|
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?) }
|