capybara 2.13.0 → 2.18.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 +5 -5
- data/History.md +218 -18
- data/README.md +54 -23
- data/lib/capybara/config.rb +132 -0
- data/lib/capybara/cucumber.rb +1 -0
- data/lib/capybara/driver/base.rb +14 -0
- data/lib/capybara/dsl.rb +1 -3
- data/lib/capybara/helpers.rb +3 -3
- data/lib/capybara/minitest/spec.rb +14 -37
- data/lib/capybara/minitest.rb +95 -114
- data/lib/capybara/node/actions.rb +10 -10
- data/lib/capybara/node/base.rb +7 -2
- data/lib/capybara/node/element.rb +9 -3
- data/lib/capybara/node/finders.rb +92 -18
- data/lib/capybara/node/matchers.rb +21 -9
- data/lib/capybara/node/simple.rb +5 -0
- data/lib/capybara/queries/ancestor_query.rb +25 -0
- data/lib/capybara/queries/base_query.rb +12 -3
- data/lib/capybara/queries/current_path_query.rb +13 -9
- data/lib/capybara/queries/selector_query.rb +62 -23
- data/lib/capybara/queries/sibling_query.rb +25 -0
- data/lib/capybara/queries/text_query.rb +10 -5
- data/lib/capybara/queries/title_query.rb +1 -0
- data/lib/capybara/rack_test/browser.rb +13 -5
- data/lib/capybara/rack_test/driver.rb +6 -1
- data/lib/capybara/rack_test/form.rb +4 -3
- data/lib/capybara/rack_test/node.rb +1 -1
- data/lib/capybara/rspec/compound.rb +95 -0
- data/lib/capybara/rspec/matcher_proxies.rb +45 -0
- data/lib/capybara/rspec/matchers.rb +108 -7
- data/lib/capybara/rspec.rb +3 -1
- data/lib/capybara/selector/filter.rb +13 -41
- data/lib/capybara/selector/filter_set.rb +30 -4
- data/lib/capybara/selector/filters/base.rb +33 -0
- data/lib/capybara/selector/filters/expression_filter.rb +40 -0
- data/lib/capybara/selector/filters/node_filter.rb +27 -0
- data/lib/capybara/selector/selector.rb +36 -15
- data/lib/capybara/selector.rb +63 -42
- data/lib/capybara/selenium/driver.rb +177 -33
- data/lib/capybara/selenium/node.rb +106 -55
- data/lib/capybara/server.rb +6 -5
- data/lib/capybara/session/config.rb +114 -0
- data/lib/capybara/session/matchers.rb +15 -4
- data/lib/capybara/session.rb +178 -65
- data/lib/capybara/spec/fixtures/no_extension +1 -0
- data/lib/capybara/spec/public/test.js +18 -3
- data/lib/capybara/spec/session/accept_alert_spec.rb +9 -1
- data/lib/capybara/spec/session/accept_prompt_spec.rb +29 -1
- data/lib/capybara/spec/session/all_spec.rb +13 -1
- data/lib/capybara/spec/session/ancestor_spec.rb +85 -0
- data/lib/capybara/spec/session/assert_all_of_selectors_spec.rb +24 -8
- data/lib/capybara/spec/session/assert_selector.rb +1 -1
- data/lib/capybara/spec/session/assert_text.rb +8 -0
- data/lib/capybara/spec/session/assert_title.rb +22 -9
- data/lib/capybara/spec/session/attach_file_spec.rb +8 -1
- data/lib/capybara/spec/session/check_spec.rb +4 -4
- data/lib/capybara/spec/session/choose_spec.rb +2 -2
- data/lib/capybara/spec/session/click_button_spec.rb +1 -1
- data/lib/capybara/spec/session/click_link_or_button_spec.rb +3 -3
- data/lib/capybara/spec/session/click_link_spec.rb +1 -1
- data/lib/capybara/spec/session/current_url_spec.rb +3 -3
- data/lib/capybara/spec/session/dismiss_confirm_spec.rb +3 -3
- data/lib/capybara/spec/session/dismiss_prompt_spec.rb +1 -1
- data/lib/capybara/spec/session/evaluate_async_script_spec.rb +22 -0
- data/lib/capybara/spec/session/evaluate_script_spec.rb +1 -1
- data/lib/capybara/spec/session/fill_in_spec.rb +8 -2
- data/lib/capybara/spec/session/find_field_spec.rb +1 -0
- data/lib/capybara/spec/session/find_spec.rb +8 -6
- data/lib/capybara/spec/session/first_spec.rb +10 -5
- data/lib/capybara/spec/session/has_all_selectors_spec.rb +69 -0
- data/lib/capybara/spec/session/has_css_spec.rb +11 -0
- data/lib/capybara/spec/session/has_current_path_spec.rb +52 -7
- data/lib/capybara/spec/session/has_link_spec.rb +4 -4
- data/lib/capybara/spec/session/has_none_selectors_spec.rb +76 -0
- data/lib/capybara/spec/session/has_select_spec.rb +64 -6
- data/lib/capybara/spec/session/has_selector_spec.rb +1 -3
- data/lib/capybara/spec/session/has_text_spec.rb +5 -3
- data/lib/capybara/spec/session/has_title_spec.rb +4 -2
- data/lib/capybara/spec/session/has_xpath_spec.rb +5 -3
- data/lib/capybara/spec/session/node_spec.rb +50 -26
- data/lib/capybara/spec/session/refresh_spec.rb +28 -0
- data/lib/capybara/spec/session/reset_session_spec.rb +3 -3
- data/lib/capybara/spec/session/select_spec.rb +3 -2
- data/lib/capybara/spec/session/sibling_spec.rb +52 -0
- data/lib/capybara/spec/session/uncheck_spec.rb +2 -2
- data/lib/capybara/spec/session/unselect_spec.rb +2 -2
- data/lib/capybara/spec/session/visit_spec.rb +56 -1
- data/lib/capybara/spec/session/window/become_closed_spec.rb +11 -11
- data/lib/capybara/spec/session/window/switch_to_window_spec.rb +11 -9
- data/lib/capybara/spec/session/window/window_opened_by_spec.rb +4 -4
- data/lib/capybara/spec/session/window/within_window_spec.rb +27 -2
- data/lib/capybara/spec/spec_helper.rb +28 -4
- data/lib/capybara/spec/test_app.rb +3 -1
- data/lib/capybara/spec/views/form.erb +27 -1
- data/lib/capybara/spec/views/initial_alert.erb +10 -0
- data/lib/capybara/spec/views/with_fixed_header_footer.erb +17 -0
- data/lib/capybara/spec/views/with_hover.erb +5 -0
- data/lib/capybara/spec/views/with_html.erb +33 -2
- data/lib/capybara/spec/views/with_js.erb +12 -0
- data/lib/capybara/spec/views/with_windows.erb +4 -0
- data/lib/capybara/version.rb +1 -1
- data/lib/capybara/window.rb +1 -1
- data/lib/capybara.rb +102 -124
- data/spec/capybara_spec.rb +43 -21
- data/spec/dsl_spec.rb +1 -0
- data/spec/filter_set_spec.rb +28 -0
- data/spec/minitest_spec.rb +9 -1
- data/spec/minitest_spec_spec.rb +19 -5
- data/spec/per_session_config_spec.rb +67 -0
- data/spec/result_spec.rb +20 -0
- data/spec/rspec/shared_spec_matchers.rb +148 -44
- data/spec/rspec/views_spec.rb +4 -0
- data/spec/rspec_matchers_spec.rb +46 -0
- data/spec/rspec_spec.rb +77 -0
- data/spec/selector_spec.rb +2 -1
- data/spec/selenium_spec_chrome.rb +25 -17
- data/spec/selenium_spec_firefox.rb +2 -1
- data/spec/selenium_spec_marionette.rb +18 -5
- data/spec/session_spec.rb +44 -0
- data/spec/shared_selenium_session.rb +72 -8
- data/spec/spec_helper.rb +4 -0
- metadata +55 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: fb46b7bc5ae7408ca3870b781d015a84bd84abd0a9c7e3ea2bcdf3d8fff85ce8
|
4
|
+
data.tar.gz: 1865dc1efa384c3792161a134bc536c56dca3aa0670ca298ad9f3aa12b49830d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bc2cb739af408323d977b7ca829aa0862ef68ab7d1778c5ae67fb127a47a09258c1f5b53f9d7955bcfcd2892c869a136d7a5346b9115a9e55713ea47c95ebb3
|
7
|
+
data.tar.gz: e8d234ded45305e026b615c60e4eb8597e31fd67b7daefff51d13ab3d79868745e21668a6b45452366ac5a552b38e8c01dc669e73dbe45a9b38ecf8363b54e83
|
data/History.md
CHANGED
@@ -1,4 +1,159 @@
|
|
1
|
-
#Version 2.
|
1
|
+
#Version 2.18.0
|
2
|
+
Release date: 2018-02-12
|
3
|
+
|
4
|
+
### Fixed
|
5
|
+
|
6
|
+
* Firefox/geckodriver setting of contenteditable childs contents
|
7
|
+
* Ignore Selenium::WebDriver::Error::SessionNotCreatedError when quitting driver [Tim Connor]
|
8
|
+
|
9
|
+
### Removed
|
10
|
+
|
11
|
+
* Headless chrome modal JS injection that is no longer needed for Chrome 64+/chromedriver 2.35+
|
12
|
+
|
13
|
+
# Version 2.17.0
|
14
|
+
Release date: 2018-01-02
|
15
|
+
|
16
|
+
### Added
|
17
|
+
|
18
|
+
* `have_all_of_selectors`, `have_none_of_selectors` RSpec matchers for parity with minitest assertions [Thomas Walpole]
|
19
|
+
|
20
|
+
### Fixed
|
21
|
+
|
22
|
+
* Allow xpath 3.x gem [Thomas Walpole]
|
23
|
+
* Issue when drivers returned nil for `current_path` and a matcher was used with a Regexp [Thomas Walpole]
|
24
|
+
* Error message when visible element not found, but non-visible was [Andy Klimczak]
|
25
|
+
|
26
|
+
# Version 2.16.1
|
27
|
+
Release date: 2017-11-20
|
28
|
+
|
29
|
+
### Fixed
|
30
|
+
|
31
|
+
* Fix rack_test driver for rack_test 0.7.1/0.8.0 [Thomas Walpole]
|
32
|
+
* `accept_prompt` response text can contain quotes when using selenium with headless chrome [Thomas Walpole]
|
33
|
+
|
34
|
+
# Version 2.16.0
|
35
|
+
Release date: 2017-11-13
|
36
|
+
|
37
|
+
### Added
|
38
|
+
|
39
|
+
* Attempt to move element into view when selenium doesn't correctly do it - See PR #1917 [Thomas Walpole]
|
40
|
+
* `current_path` matchers will now autodetect path vs url based on string to be matched. Deprecates
|
41
|
+
`:only_path` in favor of `:ignore_query` option [Thomas Walpole]
|
42
|
+
* Session#evaluate_async_script [Thomas Walpole]
|
43
|
+
|
44
|
+
### Fixed
|
45
|
+
|
46
|
+
* Default prompt value when using headless Chrome works correctly [Thomas Walpole]
|
47
|
+
* Support new modal error returned by selenium-webdriver 3.7 for W3C drivers [Thomas Walpole]
|
48
|
+
* Calling `respond_to?` on the object passed to `Capybara.configure` block - Issue #1935
|
49
|
+
|
50
|
+
# Version 2.15.4
|
51
|
+
Release date: 2017-10-07
|
52
|
+
|
53
|
+
### Fixed
|
54
|
+
* Visiting an absolute URL shouldn't overwrite the port when no server or always_include_port=false - Issue #1921
|
55
|
+
|
56
|
+
# Version 2.15.3
|
57
|
+
Release date: 2017-10-03
|
58
|
+
|
59
|
+
### Fixed
|
60
|
+
* Visiting '/' when Capybara.app_host has a trailing '/' - Issue #1918 [Thomas Walpole]
|
61
|
+
|
62
|
+
# Version 2.15.2
|
63
|
+
Release date: 2017-10-02
|
64
|
+
|
65
|
+
### Fixed
|
66
|
+
|
67
|
+
* Include within scope description in element not found/ambiguous errors [Thomas Walpole]
|
68
|
+
* Raise error when no activation block is passed to modal methods if using headless chrome [Thomas Walpole]
|
69
|
+
* Don't retry element access when inspecting [Ivan Neverov]
|
70
|
+
* Don't override a specified port (even if it is default port) in visited url [Thomas Walpole]
|
71
|
+
|
72
|
+
# Version 2.15.1
|
73
|
+
|
74
|
+
Release date: 2017-08-04
|
75
|
+
|
76
|
+
### Fixed
|
77
|
+
|
78
|
+
* `attach_file` with no extension/MIME type when using the `:rack_test` driver [Thomas Walpole]
|
79
|
+
|
80
|
+
# Version 2.15.0
|
81
|
+
|
82
|
+
Release date: 2017-08-04
|
83
|
+
|
84
|
+
### Added
|
85
|
+
|
86
|
+
* `sibling` and `ancestor` finders added [Thomas Walpole]
|
87
|
+
* Added ability to pass options to registered servers when setting
|
88
|
+
* Added basic built-in driver registrations `:selenium_chrome` and `:selenium_chrome_headless` [Thomas Walpole]
|
89
|
+
* Add `and_then` to Capybara RSpec matchers which behaves like the previous `and` compounder. [Thomas Walpole]
|
90
|
+
* Compound RSpec expectations with Capybara matchers now run both matchers inside a retry loop rather
|
91
|
+
than waiting for one to pass/fail before checking the second. Will make `#or` more performant and confirm
|
92
|
+
both conditions are true "simultaneously" for `and`. [Thomas Walpole]
|
93
|
+
If you still want the
|
94
|
+
* Default filter values are now included in error descriptions [Thomas Walpole]
|
95
|
+
* Add `Session#refresh` [Thomas Walpole]
|
96
|
+
* Loosened restrictions on where `Session#within_window` can be called from [Thomas Walpole]
|
97
|
+
* Switched from `mime-types` dependency to `mini_mime` [Jason Frey]
|
98
|
+
|
99
|
+
# Version 2.14.4
|
100
|
+
|
101
|
+
Release date: 2017-06-27
|
102
|
+
|
103
|
+
### Fixed
|
104
|
+
|
105
|
+
* Fix retrieval of session_options for HaveSelector matcher descriptions - Issue #1883
|
106
|
+
|
107
|
+
# Version 2.14.3
|
108
|
+
|
109
|
+
Release date: 2017-06-15
|
110
|
+
|
111
|
+
### Fixed
|
112
|
+
|
113
|
+
* Minitest assertions now raise the correct error type - Issue #1879 [Thomas Walpole]
|
114
|
+
* Improve flexibility of detecting Chrome headless mode [Thomas Walpole]
|
115
|
+
|
116
|
+
# Version 2.14.2
|
117
|
+
|
118
|
+
Release date: 2017-06-09
|
119
|
+
|
120
|
+
### Fixed
|
121
|
+
|
122
|
+
* Workaround for system modals when using headless Chrome now works if the page changes
|
123
|
+
|
124
|
+
# Version 2.14.1
|
125
|
+
|
126
|
+
Release date: 2017-06-07
|
127
|
+
|
128
|
+
### Fixed
|
129
|
+
|
130
|
+
* Catch correct error when unexpected system modals are discovered in latest selenium [Thomas Walpole]
|
131
|
+
* Update default `puma` server registration to encourage it to run in single mode [Thomas Walpole]
|
132
|
+
* Suppress invalid element errors raised while lazily evaluating the results of `all` [Thomas Walpole]
|
133
|
+
* Added missing `with_selected` option to the :select selector to match `options`/`with_options` options - Issue #1865 [Bartosz Nowak]
|
134
|
+
* Workaround broken system modals when using selenium with headless Chrome
|
135
|
+
|
136
|
+
# Version 2.14.0
|
137
|
+
|
138
|
+
Release date: 2017-05-01
|
139
|
+
|
140
|
+
### Added
|
141
|
+
|
142
|
+
* "threadsafe" mode that allows per-session configuration
|
143
|
+
* `:type` filter added to the `:fillable_field` selector
|
144
|
+
* Proxy methods when using RSpec for `all`/`within` that call either the Capybara::DSL or RSpec matchers
|
145
|
+
depending on arguments passed
|
146
|
+
* Support for the new errors in selenium-webdriver 3.4
|
147
|
+
|
148
|
+
### Fixed
|
149
|
+
|
150
|
+
* Element#inspect doesn't raise an error on obsolete elements
|
151
|
+
* Setting a contenteditable element with Selenium and Chrome 59
|
152
|
+
* Workaround a hang while setting the window size when using geckodriver 0.16 and Firefox 53
|
153
|
+
* Clicking on url with a blank href goes to the current url when using the RackTest driver
|
154
|
+
|
155
|
+
# Version 2.13.0
|
156
|
+
|
2
157
|
Release date: 2017-03-16
|
3
158
|
|
4
159
|
### Added
|
@@ -7,16 +162,19 @@ Release date: 2017-03-16
|
|
7
162
|
* rack_test driver supports click on checkboxes and radio buttons to change their states [Thomas Walpole]
|
8
163
|
* Support RSpec equivalent assertions and expectations for MiniTest [Thomas Walpole]
|
9
164
|
|
10
|
-
###
|
165
|
+
### Fixed
|
166
|
+
|
11
167
|
* Editing of content editable children with selenium
|
12
168
|
|
13
|
-
#Version 2.12.1
|
169
|
+
# Version 2.12.1
|
170
|
+
|
14
171
|
Release date: 2017-02-16
|
15
172
|
|
16
173
|
### Fixed
|
17
174
|
* Disable lazy Capybara::Results evaluation for JRuby due to ongoing issues
|
18
175
|
|
19
|
-
#Version 2.12.0
|
176
|
+
# Version 2.12.0
|
177
|
+
|
20
178
|
Release date: 2017-01-22
|
21
179
|
|
22
180
|
### Added
|
@@ -35,6 +193,7 @@ Release date: 2017-01-22
|
|
35
193
|
* `within_element` as an alias of `within` due to RSpec collision
|
36
194
|
|
37
195
|
### Fixed
|
196
|
+
|
38
197
|
* Fields inside a disabled fieldset are now correctly considered disabled - Issue #1816 [Thomas Walpole]
|
39
198
|
* Lazy Capybara::Results evaluation enabled for JRuby 9.1.6.0+
|
40
199
|
* A driver returning nil for #current_url won't raise an exception when calling #current_path [Dylan Reichstadt]
|
@@ -42,10 +201,12 @@ Release date: 2017-01-22
|
|
42
201
|
* RackTest driver no longer modifies the text content of textarea elements in order to behave more like a real browser [Thomas Walpole]
|
43
202
|
* TextQuery (assert_text/have_text/etc) now ignores errors when trying to generate more helpful errors messages so the original error isn't hidden [Thomas Walpole]
|
44
203
|
|
45
|
-
#Version 2.11.0
|
204
|
+
# Version 2.11.0
|
205
|
+
|
46
206
|
Release date: 2016-12-05
|
47
207
|
|
48
208
|
### Added
|
209
|
+
|
49
210
|
* Options for clearing session/local storage on reset added to the Selenium driver
|
50
211
|
* Window size changes wait for the size to stabilize
|
51
212
|
* Defined return value for most actions
|
@@ -54,17 +215,21 @@ Release date: 2016-12-05
|
|
54
215
|
* Capybara::Result#each now returns an `Enumerator` when called without a block - Issue #1777 [Thomas Walpole]
|
55
216
|
|
56
217
|
### Fixed
|
218
|
+
|
57
219
|
* Selenium driver with Chrome should support multiple file upload [Thomas Walpole]
|
58
220
|
* Fix visible: :hidden with :text option behavior [Thomas Walpole]
|
59
221
|
|
60
|
-
#Version 2.10.2
|
222
|
+
# Version 2.10.2
|
223
|
+
|
61
224
|
Release date: 2016-11-30
|
62
225
|
|
63
226
|
### Fixed
|
227
|
+
|
64
228
|
* App exceptions with multiple parameter initializers now re-raised correctly - Issue #1785 [Michael Lutsiuk]
|
65
229
|
* Use Addressable::URI when parsing current_path since it's more lenient of technically invalid URLs - Issue #1801 [Marcos Duque, Thomas Walpole]
|
66
230
|
|
67
|
-
#Version 2.10.1
|
231
|
+
# Version 2.10.1
|
232
|
+
|
68
233
|
Release date: 2016-10-08
|
69
234
|
|
70
235
|
### Fixed
|
@@ -72,52 +237,64 @@ Release date: 2016-10-08
|
|
72
237
|
* Capybara::Result optimization disabled in JRuby due to issue with lazy enumerator evaluation [Thomas Walpole]
|
73
238
|
See: https://github.com/jruby/jruby/issues/4212
|
74
239
|
|
75
|
-
#Version 2.10.0
|
240
|
+
# Version 2.10.0
|
241
|
+
|
76
242
|
Release date: 2016-10-05
|
77
243
|
|
78
244
|
### Added
|
245
|
+
|
79
246
|
* Select `<button>` elements with descendant images with `alt` attributes matching the locator [Ian Lesperance]
|
80
247
|
* Locator string is optional in selector based matchers [Thomas Walpole]
|
81
248
|
* Selectors can specify their default visible setting [Thomas Walpole]
|
82
249
|
* Selector based finders and matchers can be passed a block to filter the results within the retry behavior [Thomas Walpole]
|
83
250
|
|
84
|
-
#Version 2.9.2
|
251
|
+
# Version 2.9.2
|
252
|
+
|
85
253
|
Release date: 2016-09-29
|
86
254
|
|
87
255
|
### Fixed
|
88
256
|
* :label built-in selector finds nested label/control by control id if the label has no 'for' attribute [Thomas Walpole]
|
89
257
|
* Warning issued if an unknown selector type is specified [Thomas Walpole]
|
90
258
|
|
91
|
-
#Version 2.9.1
|
259
|
+
# Version 2.9.1
|
260
|
+
|
92
261
|
Release date: 2016-09-23
|
93
262
|
|
94
263
|
### Fixed
|
264
|
+
|
95
265
|
* allow_label_click option did not work in some cases with Poltergeist - Issue #1762 [Thomas Walpole]
|
96
266
|
* matches_selector? should have access to all of a selectors options except the count options [Thomas Walpole]
|
97
267
|
|
98
|
-
#Version 2.9.0
|
268
|
+
# Version 2.9.0
|
269
|
+
|
99
270
|
Release date: 2016-09-19
|
100
271
|
|
101
272
|
### Fixed
|
273
|
+
|
102
274
|
* Issue with rack-test driver and obselete mime-types when using `#attach_file` - Issue #1756 [Thomas Walpole]
|
103
275
|
|
104
276
|
### Added
|
277
|
+
|
105
278
|
* `:class` option to many of the built-in selectors [Thomas Walpole]
|
106
279
|
* Removed need to specify value when creating `:boolean` filter type in custom selectors [Thomas Walpole]
|
107
280
|
* Filters can now be implemented through the XPath/CSS expressions in custom selectors [Thomas Walpole]
|
108
281
|
* `Element#matches_xpath?` and `Element#matches_css?` [Thomas Walpole]
|
109
282
|
|
110
|
-
#Version 2.8.1
|
283
|
+
# Version 2.8.1
|
284
|
+
|
111
285
|
Release date: 2016-08-25
|
112
286
|
|
113
|
-
###Fixed
|
287
|
+
### Fixed
|
288
|
+
|
114
289
|
* Fixed error message from have_text when text is not found but contains regex special characters [Ryunosuke Sato]
|
115
290
|
* Warn when :exact option is passed that has no effect [Thomas Walpole]
|
116
291
|
|
117
292
|
# Version 2.8.0
|
293
|
+
|
118
294
|
Release date: 2016-08-16
|
119
295
|
|
120
296
|
### Fixed
|
297
|
+
|
121
298
|
* Issue with modals present when closing the page using selenium - Issue #1696 [Jonas Nicklas, Thomas Walpole]
|
122
299
|
* Server errors raised in test code have the cause set to an explanatory exception
|
123
300
|
in rubies that support Exception#cause rather than a confusing ExpectationNotMet - Issue #1719 [Thomas Walpole]
|
@@ -125,6 +302,7 @@ Release date: 2016-08-16
|
|
125
302
|
* Fixed setting of unexpectedAlertError now that Selenium will be freezing the Capabilities::DEFAULTS [Thomas Walpole]
|
126
303
|
|
127
304
|
### Added
|
305
|
+
|
128
306
|
* 'check', 'uncheck', and 'choose' can now optionally click the associated label if the checkbox/radio button is not visible [Thomas Walpole]
|
129
307
|
* Raise error if Capybara.app_host/default_host are specified incorrectly [Thomas Walpole]
|
130
308
|
* Capybara::Selector::FilterSet allows for sharing filter definitions between selectors [Thomas Walpole]
|
@@ -136,19 +314,22 @@ Release date: 2016-08-16
|
|
136
314
|
* Support matching on aria-label attribute when finding fields/links/buttons - Issue #1528 [Thomas Walpole]
|
137
315
|
* Optimize Capybara::Result to only apply fields as necessary in common use-case of `.all[idx]` [Thomas Walpole]
|
138
316
|
|
139
|
-
#Version 2.7.1
|
317
|
+
# Version 2.7.1
|
318
|
+
|
140
319
|
Release date: 2016-05-01
|
141
320
|
|
142
321
|
### Fixed
|
322
|
+
|
143
323
|
* Issue where within_Frame would fail with Selenium if the frame is removed from within itself [Thomas Walpole]
|
144
324
|
* Reset sessions in reverse order so sessions with active servers are reset last - Issue #1692 [Jonas Nicklas, Thomas Walpole]
|
145
325
|
|
146
326
|
# Version 2.7.0
|
327
|
+
|
147
328
|
Release date: 2016-04-07
|
148
329
|
|
149
330
|
### Fixed
|
150
|
-
|
151
|
-
|
331
|
+
|
332
|
+
* Element#visible?/checked?/disabled?/selected? Now return boolean as expected when using the rack_test driver [Thomas Walpole]
|
152
333
|
* The rack_test driver now considers \<input type="hidden"> elements as non-visible [Thomas Walpole]
|
153
334
|
* A nil locator passed to the built-in html type selectors now behaves consistently, and finds elements of the expected types [Thomas Walpole]
|
154
335
|
* Capybara::Server now searches for available ports on the same interface it binds to [Aaron Stone]
|
@@ -156,6 +337,7 @@ Release date: 2016-04-07
|
|
156
337
|
* Warning output if unused parameters are passed to a selector query [Thomas Walpole]
|
157
338
|
|
158
339
|
### Added
|
340
|
+
|
159
341
|
* Capybara now waits for requests to Capybaras server to complete while restting the session [John Hawthorn, Thomas Walpole]
|
160
342
|
* Capybara.reuse_server option to allow disabling of sharing server instance between sessions [Thomas Walpole]
|
161
343
|
* :multiple filter added to relevant selectors [Thomas Walpole]
|
@@ -168,22 +350,28 @@ Release date: 2016-04-07
|
|
168
350
|
save_page/save_screenshot [Thomas Walpole]
|
169
351
|
* :label selector [Thomas Walpole]
|
170
352
|
|
171
|
-
#Version 2.6.2
|
353
|
+
# Version 2.6.2
|
354
|
+
|
172
355
|
Relase date: 2016-01-27
|
173
356
|
|
174
357
|
### Fixed
|
358
|
+
|
175
359
|
* support for more than just addressable 2.4.0 [Thomas Walpole]
|
176
360
|
|
177
361
|
# Version 2.6.1
|
362
|
+
|
178
363
|
Release date: 2016-01-27
|
179
364
|
|
180
365
|
### Fixed
|
366
|
+
|
181
367
|
* Add missing require for addressable [Jorge Bejar]
|
182
368
|
|
183
369
|
# Version 2.6.0
|
370
|
+
|
184
371
|
Relase date: 2016-01-17
|
185
372
|
|
186
373
|
### Fixed
|
374
|
+
|
187
375
|
* Fixed path escaping issue with current_path matchers [Thomas Walpole, Luke Rollans] (Issue #1611)
|
188
376
|
* Fixed circular require [David Rodríguez]
|
189
377
|
* Capybara::RackTest::Form no longer overrides Object#method [David Rodriguez]
|
@@ -192,6 +380,7 @@ Relase date: 2016-01-17
|
|
192
380
|
|
193
381
|
|
194
382
|
### Added
|
383
|
+
|
195
384
|
* Capybara.modify_selector [Thomas Walpole]
|
196
385
|
* xfeature and ffeature aliases added when using RSpec [Filip Bartuzi]
|
197
386
|
* Selenium driver supports a :clear option to #set to handle different strategies for clearing a field [Thomas Walpole]
|
@@ -200,15 +389,18 @@ Relase date: 2016-01-17
|
|
200
389
|
* Modal API methods now default wait time to Capybara.default_max_wait_time [Thomas Walpole]
|
201
390
|
|
202
391
|
# Version 2.5.0
|
392
|
+
|
203
393
|
Release date: 2015-08-25
|
204
394
|
|
205
395
|
### Fixed
|
396
|
+
|
206
397
|
* Error message now raised correctly when invalid options passed to 'have_text'/'have_content' [Thomas Walpole]
|
207
398
|
* Rack-test driver correctly gets document title when elements on the page have nested title elements (SVG) [Thomas Walpole]
|
208
399
|
* 'save_page' no longer errors when using Capybara.asset_host if the page has no \<head> element [Travis Grathwell]
|
209
400
|
* rack-test driver will ignore clicks on links with href starting with '#' or 'javascript:'
|
210
401
|
|
211
402
|
### Added
|
403
|
+
|
212
404
|
* has_current_path? and associated asserts/matchers added [Thomas Walpole]
|
213
405
|
* Implement Node#path in selenium driver [Soutaro Matsumoto]
|
214
406
|
* 'using_session' is now nestable [Thomas Walpole]
|
@@ -226,25 +418,32 @@ Release date: 2015-08-25
|
|
226
418
|
* Clear field using backspaces in Selenium driver by using `:fill_options => { :clear => :backspace }` [Joe Lencioni]
|
227
419
|
|
228
420
|
### Deprecated
|
421
|
+
|
229
422
|
* Capybara.default_wait_time deprecated in favor of Capybara.default_max_wait_time to more clearly explain its purpose [Paul Pettengill]
|
230
423
|
|
231
|
-
#Version 2.4.4
|
424
|
+
# Version 2.4.4
|
425
|
+
|
232
426
|
Release date: 2014-10-13
|
233
427
|
|
234
428
|
### Fixed
|
429
|
+
|
235
430
|
* Test for visit behavior updated [Phil Baker]
|
236
431
|
* Removed concurrency prevention in favor of a note in the README - due to load order issues
|
237
432
|
|
238
433
|
# Version 2.4.3
|
434
|
+
|
239
435
|
Relase date: 2014-09-21
|
240
436
|
|
241
437
|
### Fixed
|
438
|
+
|
242
439
|
* Update concurrency prevention to match Rails 4.2 behavior
|
243
440
|
|
244
441
|
# Version 2.4.2
|
442
|
+
|
245
443
|
Release date: 2014-09-20
|
246
444
|
|
247
445
|
### Fixed
|
446
|
+
|
248
447
|
* Prevent concurrency issue when testing Rails app with default test environment [Thomas Walpole]
|
249
448
|
* Tags for windows API tests fixed [Dmitry Vorotilin]
|
250
449
|
* Documentation Fixes [Andrey Botalov]
|
@@ -279,6 +478,7 @@ Release date: 2014-07-03
|
|
279
478
|
Release date: 2014-06-02
|
280
479
|
|
281
480
|
### Added
|
481
|
+
|
282
482
|
* New window management API [Andrey Botalov]
|
283
483
|
* Speed improvement for visible text detection in RackTest [Thomas Walpole]
|
284
484
|
Thanks to Phillipe Creux for instigating this
|
data/README.md
CHANGED
@@ -10,24 +10,14 @@ interact with your app. It is agnostic about the driver running your tests and
|
|
10
10
|
comes with Rack::Test and Selenium support built in. WebKit is supported
|
11
11
|
through an external gem.
|
12
12
|
|
13
|
-
|
14
|
-
GitHub): http://groups.google.com/group/ruby-capybara
|
13
|
+
## Support Capybara
|
15
14
|
|
16
|
-
|
17
|
-
|
15
|
+
If you and/or your company find value in Capybara and would like to contribute financially to its ongoing maintenance and development, please visit
|
16
|
+
<a href="https://www.patreon.com/capybara">Patreon</a>
|
18
17
|
|
19
|
-
```ruby
|
20
|
-
Capybara.register_driver :selenium do |app|
|
21
|
-
Capybara::Selenium::Driver.new(
|
22
|
-
app,
|
23
|
-
browser: :firefox,
|
24
|
-
desired_capabilities: Selenium::WebDriver::Remote::Capabilities.firefox(marionette: false)
|
25
|
-
)
|
26
|
-
end
|
27
|
-
```
|
28
18
|
|
29
|
-
|
30
|
-
|
19
|
+
**Need help?** Ask on the mailing list (please do not open an issue on
|
20
|
+
GitHub): http://groups.google.com/group/ruby-capybara
|
31
21
|
|
32
22
|
## Table of contents
|
33
23
|
|
@@ -67,6 +57,7 @@ You can read more about the missing features [here](https://github.com/teamcapyb
|
|
67
57
|
- [Beware the XPath // trap](#beware-the-xpath--trap)
|
68
58
|
- [Configuring and adding drivers](#configuring-and-adding-drivers)
|
69
59
|
- [Gotchas:](#gotchas)
|
60
|
+
- ["Threadsafe" mode](#threadsafe)
|
70
61
|
- [Development](#development)
|
71
62
|
|
72
63
|
## <a name="key-benefits"></a>Key benefits
|
@@ -87,7 +78,7 @@ Capybara requires Ruby 1.9.3 or later. To install, add this line to your
|
|
87
78
|
gem 'capybara'
|
88
79
|
```
|
89
80
|
|
90
|
-
**Note:** If using Ruby < 2.0 you will also need to limit the version of
|
81
|
+
**Note:** If using Ruby < 2.0 you will also need to limit the version of rack to < 2.0
|
91
82
|
|
92
83
|
If the application that you are testing is a Rails app, add this line to your test helper file:
|
93
84
|
|
@@ -105,7 +96,13 @@ Capybara.app = MyRackApp
|
|
105
96
|
```
|
106
97
|
|
107
98
|
If you need to test JavaScript, or if your app interacts with (or is located at)
|
108
|
-
a remote URL, you'll need to [use a different driver](#drivers).
|
99
|
+
a remote URL, you'll need to [use a different driver](#drivers). If using Rails 5.0+, but not using the Rails system tests from 5.1, you'll probably also
|
100
|
+
want to swap the "server" used to launch your app to Puma in order to match Rails defaults.
|
101
|
+
|
102
|
+
```ruby
|
103
|
+
Capybara.server = :puma # Until your setup is working
|
104
|
+
Capybara.server = :puma, { Silent: true } # To clean up your test output
|
105
|
+
```
|
109
106
|
|
110
107
|
## <a name="using-capybara-with-cucumber"></a>Using Capybara with Cucumber
|
111
108
|
|
@@ -139,8 +136,7 @@ Scenario: do something Ajaxy
|
|
139
136
|
...
|
140
137
|
```
|
141
138
|
|
142
|
-
There are also explicit `@selenium
|
143
|
-
tags set up for you.
|
139
|
+
There are also explicit tags for each registered driver set up for you (`@selenium`, `@rack_test`, etc).
|
144
140
|
|
145
141
|
## <a name="using-capybara-with-rspec"></a>Using Capybara with RSpec
|
146
142
|
|
@@ -241,6 +237,9 @@ RSpec.describe "todos/show.html.erb", type: :view do
|
|
241
237
|
end
|
242
238
|
```
|
243
239
|
|
240
|
+
**Note: When you require 'capybara/rspec' proxy methods are installed to work around name collisions between Capybara::DSL methods
|
241
|
+
`all`/`within` and the identically named built-in RSpec matchers. If you opt not to require 'capybara/rspec' you can install the proxy methods by requiring 'capybara/rspec/matcher_proxies' after requiring RSpec and 'capybara/dsl'**
|
242
|
+
|
244
243
|
## <a name="using-capybara-with-testunit"></a>Using Capybara with Test::Unit
|
245
244
|
|
246
245
|
* If you are using `Test::Unit`, define a base class for your Capybara tests
|
@@ -339,7 +338,7 @@ these limitations, you can set up a different default driver for your features.
|
|
339
338
|
For example if you'd prefer to run everything in Selenium, you could do:
|
340
339
|
|
341
340
|
```ruby
|
342
|
-
Capybara.default_driver = :selenium
|
341
|
+
Capybara.default_driver = :selenium # :selenium_chrome and :selenium_chrome_headless are also registered
|
343
342
|
```
|
344
343
|
|
345
344
|
However, if you are using RSpec or Cucumber, you may instead want to consider
|
@@ -388,7 +387,7 @@ See the section on adding and configuring drivers.
|
|
388
387
|
|
389
388
|
### <a name="selenium"></a>Selenium
|
390
389
|
|
391
|
-
At the moment, Capybara supports [Selenium 2.0
|
390
|
+
At the moment, Capybara supports [Selenium 2.0+
|
392
391
|
(Webdriver)](http://seleniumhq.org/docs/01_introducing_selenium.html#selenium-2-aka-selenium-webdriver),
|
393
392
|
*not* Selenium RC. In order to use Selenium, you'll need to install the
|
394
393
|
`selenium-webdriver` gem, and add it to your Gemfile if you're using bundler.
|
@@ -550,7 +549,7 @@ If you find yourself needing to use this a lot you may be better off adding a [c
|
|
550
549
|
```ruby
|
551
550
|
find_field('First Name'){ |el| el['data-xyz'] == '123' }
|
552
551
|
find("#img_loading"){ |img| img['complete'] == true }
|
553
|
-
|
552
|
+
```
|
554
553
|
|
555
554
|
**Note**: `find` will wait for an element to appear on the page, as explained in the
|
556
555
|
Ajax section. If the element does not appear it will raise an error.
|
@@ -743,6 +742,9 @@ Capybara 1.x, set `Capybara.match` to `:prefer_exact`.
|
|
743
742
|
|
744
743
|
## <a name="transactions-and-database-setup"></a>Transactions and database setup
|
745
744
|
|
745
|
+
**Note:** Rails 5.1+ now "safely" shares the database connection between the app and test threads. Therefore,
|
746
|
+
if using Rails 5.1+ you SHOULD be able to ignore this section.
|
747
|
+
|
746
748
|
Some Capybara drivers need to run against an actual HTTP server. Capybara takes
|
747
749
|
care of this and starts one for you in the same process as your test, but on
|
748
750
|
another thread. Selenium is one of those drivers, whereas RackTest is not.
|
@@ -892,7 +894,7 @@ To permanently switch the current session to a different session
|
|
892
894
|
|
893
895
|
```ruby
|
894
896
|
Capybara.session_name = "some other session"
|
895
|
-
|
897
|
+
```
|
896
898
|
|
897
899
|
### <a name="using-sessions-manually"></a>Using sessions manually
|
898
900
|
|
@@ -1045,6 +1047,35 @@ additional info about how the underlying driver can be configured.
|
|
1045
1047
|
are testing for specific server errors and using multiple sessions make sure to test for the
|
1046
1048
|
errors using the initial session (usually :default)
|
1047
1049
|
|
1050
|
+
## <a name="threadsafe"></a>"Threadsafe" mode - BETA - may change
|
1051
|
+
|
1052
|
+
In normal mode most of Capybara's configuration options are global settings which can cause issues
|
1053
|
+
if using multiple sessions and wanting to change a setting for only one of the sessions. To provide
|
1054
|
+
support for this type of usage Capybara now provides a "threadsafe" mode which can be enabled by setting
|
1055
|
+
|
1056
|
+
```ruby
|
1057
|
+
Capybara.threadsafe = true
|
1058
|
+
```
|
1059
|
+
|
1060
|
+
This setting can only be changed before any sessions have been created. In "threadsafe" mode the following
|
1061
|
+
behaviors of Capybara change
|
1062
|
+
|
1063
|
+
* Most options can now be set on a session. These can either be set at session creation time or after, and
|
1064
|
+
default to the global options at the time of session creation. Options which are NOT session specific are
|
1065
|
+
`app`, `reuse_server`, `default_driver`, `javascript_driver`, and (obviously) `threadsafe`. Any drivers and servers
|
1066
|
+
registered through `register_driver` and `register_server` are also global.
|
1067
|
+
|
1068
|
+
```ruby
|
1069
|
+
my_session = Capybara::Session.new(:driver, some_app) do |config|
|
1070
|
+
config.automatic_label_click = true # only set for my_session
|
1071
|
+
end
|
1072
|
+
my_session.config.default_max_wait_time = 10 # only set for my_session
|
1073
|
+
Capybara.default_max_wait_time = 2 # will not change the default_max_wait in my_session
|
1074
|
+
```
|
1075
|
+
|
1076
|
+
* `current_driver` and `session_name` are thread specific. This means that `using_session` and
|
1077
|
+
`using_driver` also only affect the current thread.
|
1078
|
+
|
1048
1079
|
## <a name="development"></a>Development
|
1049
1080
|
|
1050
1081
|
To set up a development environment, simply do:
|