capybara 3.31.0 → 3.32.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd31d35629d475d7fdaba1d6e415599d995a08f27b28fa619a3a4449b61b91d8
4
- data.tar.gz: 27c812629e2d99e8f4c62fa7961df9b499c5346b1c61092faf487f592356033d
3
+ metadata.gz: 0f60918220b590a4a64f3bb1a42b7e8c5dac86dddcec48d46c0f92c1ac6c491f
4
+ data.tar.gz: aab5f09c11d94dc1becdb514d753011cdfad7f2a43f0e59b074ff6e69aa49847
5
5
  SHA512:
6
- metadata.gz: 946e3f2de0137ddaa6e3a2febba2c87244997737c54a10024133de110ca41b8aeddcb66e0437bef5d826e9fe21d4c42701674c3864bd578d24c30c7b1f90e2a9
7
- data.tar.gz: f9409de3e2e0ea44e0bb6b6f77cce7e0e8f5a4d95c43fb62af2eb63d11e755d6a8c00b9b9b4d2bbe2729538d0d1038e92468e0a7994d1578b50e05b5227b87f4
6
+ metadata.gz: 7adcf8fbe5fe95d42c3c7fe513f62236cf93dd0f95bbccb20d31c1022a5e87bd64514d2fd6f57a263d31b96945a2e1c7a300d6b16db018651b929abd137e8290
7
+ data.tar.gz: d28874576cd8613f16b1d455785e4e6fba9cb387b8580ba0bdc0c46f13255661f07e47a51f5d7f2c28afa6691a4c330e094ff9625a89bb4f6f5d9532a3123063
data/History.md CHANGED
@@ -1,3 +1,17 @@
1
+ # Version 3.32.0
2
+ Relesae date: 2020-03-29
3
+
4
+ ### Added
5
+
6
+ * Support `delay` setting on click with Selenium
7
+ * Implement rapid set for values longer thn 30 characters in text fields with Selenium
8
+
9
+ ### Fixed
10
+
11
+ * Result#[] and negative max on ranges (Issue #2302/2303) [Jeremy Evans]
12
+ * RackTest form submission rewrites query string when using GET method
13
+ * Ruby 2.7 deprecation warnings in RSpec matcher proxies
14
+
1
15
  # Version 3.31.0
2
16
  Release date: 2020-01-26
3
17
 
data/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jnicklas/capybara?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
8
8
  [![SemVer](https://api.dependabot.com/badges/compatibility_score?dependency-name=capybara&package-manager=bundler&version-scheme=semver)](https://dependabot.com/compatibility-score.html?dependency-name=capybara&package-manager=bundler&version-scheme=semver)
9
9
 
10
- **Note** You are viewing the README for the 3.31.x stable branch of Capybara.
10
+ **Note** You are viewing the README for the 3.32.x version of Capybara.
11
11
 
12
12
  Capybara helps you test web applications by simulating how a real user would
13
13
  interact with your app. It is agnostic about the driver running your tests and
@@ -6,41 +6,47 @@ require 'capybara/dsl'
6
6
  module Capybara
7
7
  module Minitest
8
8
  module Assertions
9
- ## Assert text exists
9
+ ##
10
+ # Assert text exists
10
11
  #
12
+ # @!method assert_content
11
13
  # @!method assert_text
12
- # @see Capybara::Node::Matchers#assert_text
14
+ # See {Capybara::Node::Matchers#assert_text}
13
15
 
14
- ## Assert text does not exist
16
+ ##
17
+ # Assert text does not exist
15
18
  #
19
+ # @!method refute_content
20
+ # @!method assert_no_content
21
+ # @!method refute_text
16
22
  # @!method assert_no_text
17
- # @see Capybara::Node::Matchers#assert_no_text
23
+ # See {Capybara::Node::Matchers#assert_no_text}
18
24
 
19
25
  ##
20
26
  # Assertion that page title does match
21
27
  #
22
28
  # @!method assert_title
23
- # @see Capybara::Node::DocumentMatchers#assert_title
29
+ # See {Capybara::Node::DocumentMatchers#assert_title}
24
30
 
25
31
  ##
26
32
  # Assertion that page title does not match
27
33
  #
28
34
  # @!method refute_title
29
35
  # @!method assert_no_title
30
- # @see Capybara::Node::DocumentMatchers#assert_no_title
36
+ # See {Capybara::Node::DocumentMatchers#assert_no_title}
31
37
 
32
38
  ##
33
39
  # Assertion that current path matches
34
40
  #
35
41
  # @!method assert_current_path
36
- # @see Capybara::SessionMatchers#assert_current_path
42
+ # See {Capybara::SessionMatchers#assert_current_path}
37
43
 
38
44
  ##
39
45
  # Assertion that current page does not match
40
46
  #
41
47
  # @!method refute_current_path
42
48
  # @!method assert_no_current_path
43
- # @see Capybara::SessionMatchers#assert_no_current_path
49
+ # See {Capybara::SessionMatchers#assert_no_current_path}
44
50
 
45
51
  %w[text no_text title no_title current_path no_current_path].each do |assertion_name|
46
52
  class_eval <<-ASSERTION, __FILE__, __LINE__ + 1
@@ -62,40 +68,81 @@ module Capybara
62
68
  alias_method :assert_content, :assert_text
63
69
  alias_method :assert_no_content, :refute_text
64
70
 
65
- ## Assert selector exists on page
71
+ ##
72
+ # Assert selector exists on page
66
73
  #
67
74
  # @!method assert_selector
68
- # @see Capybara::Node::Matchers#assert_selector
75
+ # See {Capybara::Node::Matchers#assert_selector}
69
76
 
70
- ## Assert selector does not exist on page
77
+ ##
78
+ # Assert selector does not exist on page
71
79
  #
80
+ # @!method refute_selector
72
81
  # @!method assert_no_selector
73
- # @see Capybara::Node::Matchers#assert_no_selector
82
+ # See {Capybara::Node::Matchers#assert_no_selector}
74
83
 
75
- ## Assert element matches selector
84
+ ##
85
+ # Assert element matches selector
76
86
  #
77
87
  # @!method assert_matches_selector
78
- # @see Capybara::Node::Matchers#assert_matches_selector
88
+ # See {Capybara::Node::Matchers#assert_matches_selector}
89
+
90
+ ##
91
+ # Assert element does not match selector
92
+ #
93
+ # @!method refute_matches_selector
94
+ # @!method assert_not_matches_selector
95
+ # See {Capybara::Node::Matchers#assert_not_matches_selector}
79
96
 
80
- ## Assert element does not match selector
97
+ ##
98
+ # Assert all of the provided selectors exist on page
81
99
  #
82
- # @!method assert_xpath
83
- # @see Capybara::Node::Matchers#assert_not_matches_selector
100
+ # @!method assert_all_of_selectors
101
+ # See {Capybara::Node::Matchers#assert_all_of_selectors}
102
+
103
+ ##
104
+ # Assert none of the provided selectors exist on page
105
+ #
106
+ # @!method assert_none_of_selectors
107
+ # See {Capybara::Node::Matchers#assert_none_of_selectors}
108
+
109
+ ##
110
+ # Assert any of the provided selectors exist on page
111
+ #
112
+ # @!method assert_any_of_selectors
113
+ # See {Capybara::Node::Matchers#assert_any_of_selectors}
84
114
 
85
- ## Assert element has the provided CSS styles
115
+ ##
116
+ # Assert element has the provided CSS styles
86
117
  #
87
118
  # @!method assert_matches_style
88
- # @see Capybara::Node::Matchers#assert_matches_style
119
+ # See {Capybara::Node::Matchers#assert_matches_style}
89
120
 
90
- ## Assert element has a matching sibling
121
+ ##
122
+ # Assert element has a matching sibling
91
123
  #
92
124
  # @!method assert_sibling
93
- # @see Capybara::Node::Matchers#assert_sibling
125
+ # See {Capybara::Node::Matchers#assert_sibling}
94
126
 
95
- ## Assert element has a matching ancestor
127
+ ##
128
+ # Assert element does not have a matching sibling
129
+ #
130
+ # @!method refute_sibling
131
+ # @!method assert_no_sibling
132
+ # See {Capybara::Node::Matchers#assert_no_sibling}
133
+
134
+ ##
135
+ # Assert element has a matching ancestor
96
136
  #
97
137
  # @!method assert_ancestor
98
- # @see Capybara::Node::Matchers#assert_ancestor
138
+ # See {Capybara::Node::Matchers#assert_ancestor}
139
+
140
+ ##
141
+ # Assert element does not have a matching ancestor
142
+ #
143
+ # @!method refute_ancestor
144
+ # @!method assert_no_ancestor
145
+ # See {Capybara::Node::Matchers#assert_no_ancestor}
99
146
 
100
147
  %w[selector no_selector matches_style
101
148
  all_of_selectors none_of_selectors any_of_selectors
@@ -118,6 +165,123 @@ module Capybara
118
165
  alias_method :refute_ancestor, :assert_no_ancestor
119
166
  alias_method :refute_sibling, :assert_no_sibling
120
167
 
168
+ ##
169
+ # Assert that provided xpath exists
170
+ #
171
+ # @!method assert_xpath
172
+ # See {Capybara::Node::Matchers#has_xpath?}
173
+
174
+ ##
175
+ # Assert that provide xpath does not exist
176
+ #
177
+ # @!method refute_xpath
178
+ # @!method assert_no_xpath
179
+ # See {Capybara::Node::Matchers#has_no_xpath?}
180
+
181
+ ##
182
+ # Assert that provided css exists
183
+ #
184
+ # @!method assert_css
185
+ # See {Capybara::Node::Matchers#has_css?}
186
+
187
+ ##
188
+ # Assert that provided css does not exist
189
+ #
190
+ # @!method refute_css
191
+ # @!method assert_no_css
192
+ # See {Capybara::Node::Matchers#has_no_css?}
193
+
194
+ ##
195
+ # Assert that provided link exists
196
+ #
197
+ # @!method assert_link
198
+ # See {Capybara::Node::Matchers#has_link?}
199
+
200
+ ##
201
+ # Assert that provided link does not exist
202
+ #
203
+ # @!method assert_no_link
204
+ # @!method refute_link
205
+ # See {Capybara::Node::Matchers#has_no_link?}
206
+
207
+ ##
208
+ # Assert that provided button exists
209
+ #
210
+ # @!method assert_button
211
+ # See {Capybara::Node::Matchers#has_button?}
212
+
213
+ ##
214
+ # Assert that provided button does not exist
215
+ #
216
+ # @!method refute_button
217
+ # @!method assert_no_button
218
+ # See {Capybara::Node::Matchers#has_no_button?}
219
+
220
+ ##
221
+ # Assert that provided field exists
222
+ #
223
+ # @!method assert_field
224
+ # See {Capybara::Node::Matchers#has_field?}
225
+
226
+ ##
227
+ # Assert that provided field does not exist
228
+ #
229
+ # @!method refute_field
230
+ # @!method assert_no_field
231
+ # See {Capybara::Node::Matchers#has_no_field?}
232
+
233
+ ##
234
+ # Assert that provided checked field exists
235
+ #
236
+ # @!method assert_checked_field
237
+ # See {Capybara::Node::Matchers#has_checked_field?}
238
+
239
+ ##
240
+ # Assert that provided checked_field does not exist
241
+ #
242
+ # @!method assert_no_checked_field
243
+ # @!method refute_checked_field
244
+ # See {Capybara::Node::Matchers#has_no_checked_field?}
245
+
246
+ ##
247
+ # Assert that provided unchecked field exists
248
+ #
249
+ # @!method assert_unchecked_field
250
+ # See {Capybara::Node::Matchers#has_unchecked_field?}
251
+
252
+ ##
253
+ # Assert that provided unchecked field does not exist
254
+ #
255
+ # @!method assert_no_unchecked_field
256
+ # @!method refute_unchecked_field
257
+ # See {Capybara::Node::Matchers#has_no_unchecked_field?}
258
+
259
+ ##
260
+ # Assert that provided select exists
261
+ #
262
+ # @!method assert_select
263
+ # See {Capybara::Node::Matchers#has_select?}
264
+
265
+ ##
266
+ # Assert that provided select does not exist
267
+ #
268
+ # @!method refute_select
269
+ # @!method assert_no_select
270
+ # See {Capybara::Node::Matchers#has_no_select?}
271
+
272
+ ##
273
+ # Assert that provided table exists
274
+ #
275
+ # @!method assert_table
276
+ # See {Capybara::Node::Matchers#has_table?}
277
+
278
+ ##
279
+ # Assert that provided table does not exist
280
+ #
281
+ # @!method refute_table
282
+ # @!method assert_no_table
283
+ # See {Capybara::Node::Matchers#has_no_table?}
284
+
121
285
  %w[xpath css link button field select table].each do |selector_type|
122
286
  define_method "assert_#{selector_type}" do |*args, &optional_filter_block|
123
287
  subject, args = determine_subject(args)
@@ -158,6 +322,32 @@ module Capybara
158
322
  alias_method "refute_#{field_type}_field", "assert_no_#{field_type}_field"
159
323
  end
160
324
 
325
+ ##
326
+ # Assert that element matches xpath
327
+ #
328
+ # @!method assert_matches_xpath
329
+ # See {Capybara::Node::Matchers#matches_xpath?}
330
+
331
+ ##
332
+ # Assert that element does not match xpath
333
+ #
334
+ # @!method refute_matches_xpath
335
+ # @!method assert_not_matches_xpath
336
+ # See {Capybara::Node::Matchers#not_matches_xpath?}
337
+
338
+ ##
339
+ # Assert that element matches css
340
+ #
341
+ # @!method assert_matches_css
342
+ # See {Capybara::Node::Matchers#matches_css?}
343
+
344
+ ##
345
+ # Assert that element matches css
346
+ #
347
+ # @!method refute_matches_css
348
+ # @!method assert_not_matches_css
349
+ # See {Capybara::Node::Matchers#not_matches_css?}
350
+
161
351
  %w[xpath css].each do |selector_type|
162
352
  define_method "assert_matches_#{selector_type}" do |*args, &optional_filter_block|
163
353
  subject, args = determine_subject(args)
@@ -173,121 +363,6 @@ module Capybara
173
363
  alias_method "refute_matches_#{selector_type}", "assert_not_matches_#{selector_type}"
174
364
  end
175
365
 
176
- ##
177
- # Assertion that there is xpath
178
- #
179
- # @!method assert_xpath
180
- # @see Capybara::Node::Matchers#has_xpath?
181
-
182
- ##
183
- # Assertion that there is no xpath
184
- #
185
- # @!method refute_xpath
186
- # @!method assert_no_xpath
187
- # @see Capybara::Node::Matchers#has_no_xpath?
188
-
189
- ##
190
- # Assertion that there is css
191
- #
192
- # @!method assert_css
193
- # @see Capybara::Node::Matchers#has_css?
194
-
195
- ##
196
- # Assertion that there is no css
197
- #
198
- # @!method refute_css
199
- # @!method assert_no_css
200
- # @see Capybara::Node::Matchers#has_no_css?
201
-
202
- ##
203
- # Assertion that there is link
204
- #
205
- # @!method assert_link
206
- # @see Capybara::Node::Matchers#has_link?
207
-
208
- ##
209
- # Assertion that there is no link
210
- #
211
- # @!method assert_no_link
212
- # @!method refute_link
213
- # @see Capybara::Node::Matchers#has_no_link?
214
-
215
- ##
216
- # Assertion that there is button
217
- #
218
- # @!method assert_button
219
- # @see Capybara::Node::Matchers#has_button?
220
-
221
- ##
222
- # Assertion that there is no button
223
- #
224
- # @!method refute_button
225
- # @!method assert_no_button
226
- # @see Capybara::Node::Matchers#has_no_button?
227
-
228
- ##
229
- # Assertion that there is field
230
- #
231
- # @!method assert_field
232
- # @see Capybara::Node::Matchers#has_field?
233
-
234
- ##
235
- # Assertion that there is no field
236
- #
237
- # @!method refute_field
238
- # @!method assert_no_field
239
- # @see Capybara::Node::Matchers#has_no_field?
240
-
241
- ##
242
- # Assertion that there is checked_field
243
- #
244
- # @!method assert_checked_field
245
- # @see Capybara::Node::Matchers#has_checked_field?
246
-
247
- ##
248
- # Assertion that there is no checked_field
249
- #
250
- # @!method assert_no_checked_field
251
- # @!method refute_checked_field
252
-
253
- ##
254
- # Assertion that there is unchecked_field
255
- #
256
- # @!method assert_unchecked_field
257
- # @see Capybara::Node::Matchers#has_unchecked_field?
258
-
259
- ##
260
- # Assertion that there is no unchecked_field
261
- #
262
- # @!method assert_no_unchecked_field
263
- # @!method refute_unchecked_field
264
-
265
- ##
266
- # Assertion that there is select
267
- #
268
- # @!method assert_select
269
- # @see Capybara::Node::Matchers#has_select?
270
-
271
- ##
272
- # Assertion that there is no select
273
- #
274
- # @!method refute_select
275
- # @!method assert_no_select
276
- # @see Capybara::Node::Matchers#has_no_select?
277
-
278
- ##
279
- # Assertion that there is table
280
- #
281
- # @!method assert_table
282
- # @see Capybara::Node::Matchers#has_table?
283
-
284
- ##
285
- # Assertion that there is no table
286
- #
287
- # @!method refute_table
288
- # @!method assert_no_table
289
- # @see Capybara::Node::Matchers#has_no_table?
290
-
291
366
  private
292
367
 
293
368
  def determine_subject(args)