capybara 3.23.0 → 3.35.3
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/History.md +264 -11
- data/README.md +10 -6
- data/lib/capybara.rb +20 -8
- data/lib/capybara/config.rb +10 -8
- data/lib/capybara/cucumber.rb +1 -1
- data/lib/capybara/driver/base.rb +4 -0
- data/lib/capybara/driver/node.rb +4 -0
- data/lib/capybara/dsl.rb +10 -2
- data/lib/capybara/helpers.rb +28 -2
- data/lib/capybara/minitest.rb +232 -144
- data/lib/capybara/minitest/spec.rb +156 -97
- data/lib/capybara/node/actions.rb +36 -36
- data/lib/capybara/node/base.rb +6 -6
- data/lib/capybara/node/document.rb +2 -2
- data/lib/capybara/node/document_matchers.rb +3 -3
- data/lib/capybara/node/element.rb +77 -33
- data/lib/capybara/node/finders.rb +24 -17
- data/lib/capybara/node/matchers.rb +79 -64
- data/lib/capybara/node/simple.rb +11 -4
- data/lib/capybara/queries/ancestor_query.rb +6 -10
- data/lib/capybara/queries/base_query.rb +2 -1
- data/lib/capybara/queries/current_path_query.rb +14 -4
- data/lib/capybara/queries/selector_query.rb +259 -23
- data/lib/capybara/queries/sibling_query.rb +5 -11
- data/lib/capybara/queries/style_query.rb +1 -1
- data/lib/capybara/queries/text_query.rb +13 -1
- data/lib/capybara/rack_test/browser.rb +13 -4
- data/lib/capybara/rack_test/driver.rb +2 -1
- data/lib/capybara/rack_test/form.rb +2 -2
- data/lib/capybara/rack_test/node.rb +42 -6
- data/lib/capybara/registration_container.rb +44 -0
- data/lib/capybara/registrations/drivers.rb +18 -12
- data/lib/capybara/registrations/patches/puma_ssl.rb +29 -0
- data/lib/capybara/registrations/servers.rb +9 -2
- data/lib/capybara/result.rb +39 -19
- data/lib/capybara/rspec.rb +2 -0
- data/lib/capybara/rspec/matcher_proxies.rb +5 -5
- data/lib/capybara/rspec/matchers.rb +97 -74
- data/lib/capybara/rspec/matchers/base.rb +19 -6
- data/lib/capybara/rspec/matchers/count_sugar.rb +2 -1
- data/lib/capybara/rspec/matchers/have_ancestor.rb +5 -7
- data/lib/capybara/rspec/matchers/have_current_path.rb +2 -2
- data/lib/capybara/rspec/matchers/have_selector.rb +15 -10
- data/lib/capybara/rspec/matchers/have_sibling.rb +4 -7
- data/lib/capybara/rspec/matchers/have_text.rb +4 -7
- data/lib/capybara/rspec/matchers/have_title.rb +2 -2
- data/lib/capybara/rspec/matchers/match_selector.rb +3 -3
- data/lib/capybara/rspec/matchers/match_style.rb +7 -2
- data/lib/capybara/rspec/matchers/spatial_sugar.rb +39 -0
- data/lib/capybara/selector.rb +46 -19
- data/lib/capybara/selector/builders/css_builder.rb +10 -6
- data/lib/capybara/selector/builders/xpath_builder.rb +4 -2
- data/lib/capybara/selector/css.rb +1 -1
- data/lib/capybara/selector/definition.rb +13 -11
- data/lib/capybara/selector/definition/button.rb +32 -15
- data/lib/capybara/selector/definition/checkbox.rb +2 -2
- data/lib/capybara/selector/definition/css.rb +3 -1
- data/lib/capybara/selector/definition/datalist_input.rb +2 -2
- data/lib/capybara/selector/definition/datalist_option.rb +1 -1
- data/lib/capybara/selector/definition/element.rb +3 -2
- data/lib/capybara/selector/definition/field.rb +1 -1
- data/lib/capybara/selector/definition/file_field.rb +1 -1
- data/lib/capybara/selector/definition/fillable_field.rb +2 -2
- data/lib/capybara/selector/definition/label.rb +5 -3
- data/lib/capybara/selector/definition/link.rb +8 -0
- data/lib/capybara/selector/definition/option.rb +1 -1
- data/lib/capybara/selector/definition/radio_button.rb +2 -2
- data/lib/capybara/selector/definition/select.rb +33 -14
- data/lib/capybara/selector/definition/table.rb +6 -3
- data/lib/capybara/selector/definition/table_row.rb +2 -2
- data/lib/capybara/selector/filter_set.rb +13 -11
- data/lib/capybara/selector/filters/base.rb +6 -1
- data/lib/capybara/selector/filters/locator_filter.rb +1 -1
- data/lib/capybara/selector/regexp_disassembler.rb +7 -0
- data/lib/capybara/selector/selector.rb +13 -3
- data/lib/capybara/selenium/atoms/getAttribute.min.js +1 -1
- data/lib/capybara/selenium/atoms/isDisplayed.min.js +1 -1
- data/lib/capybara/selenium/atoms/src/getAttribute.js +1 -1
- data/lib/capybara/selenium/atoms/src/isDisplayed.js +10 -10
- data/lib/capybara/selenium/driver.rb +86 -24
- data/lib/capybara/selenium/driver_specializations/chrome_driver.rb +24 -21
- data/lib/capybara/selenium/driver_specializations/edge_driver.rb +21 -19
- data/lib/capybara/selenium/driver_specializations/firefox_driver.rb +17 -1
- data/lib/capybara/selenium/driver_specializations/safari_driver.rb +0 -4
- data/lib/capybara/selenium/extensions/file_input_click_emulation.rb +34 -0
- data/lib/capybara/selenium/extensions/find.rb +37 -26
- data/lib/capybara/selenium/extensions/html5_drag.rb +55 -11
- data/lib/capybara/selenium/extensions/modifier_keys_stack.rb +28 -0
- data/lib/capybara/selenium/extensions/scroll.rb +8 -10
- data/lib/capybara/selenium/logger_suppressor.rb +8 -2
- data/lib/capybara/selenium/node.rb +160 -40
- data/lib/capybara/selenium/nodes/chrome_node.rb +72 -12
- data/lib/capybara/selenium/nodes/edge_node.rb +32 -14
- data/lib/capybara/selenium/nodes/firefox_node.rb +28 -32
- data/lib/capybara/selenium/nodes/safari_node.rb +5 -29
- data/lib/capybara/selenium/patches/action_pauser.rb +26 -0
- data/lib/capybara/selenium/patches/atoms.rb +4 -4
- data/lib/capybara/selenium/patches/is_displayed.rb +16 -0
- data/lib/capybara/selenium/patches/logs.rb +32 -7
- data/lib/capybara/server.rb +19 -3
- data/lib/capybara/server/animation_disabler.rb +8 -3
- data/lib/capybara/server/checker.rb +1 -1
- data/lib/capybara/server/middleware.rb +22 -10
- data/lib/capybara/session.rb +66 -40
- data/lib/capybara/session/config.rb +11 -3
- data/lib/capybara/session/matchers.rb +11 -11
- data/lib/capybara/spec/public/offset.js +6 -0
- data/lib/capybara/spec/public/test.js +75 -7
- data/lib/capybara/spec/session/accept_alert_spec.rb +1 -1
- data/lib/capybara/spec/session/all_spec.rb +60 -5
- data/lib/capybara/spec/session/ancestor_spec.rb +5 -0
- data/lib/capybara/spec/session/assert_text_spec.rb +9 -5
- data/lib/capybara/spec/session/check_spec.rb +6 -0
- data/lib/capybara/spec/session/click_button_spec.rb +16 -0
- data/lib/capybara/spec/session/click_link_or_button_spec.rb +9 -0
- data/lib/capybara/spec/session/current_url_spec.rb +11 -1
- data/lib/capybara/spec/session/fill_in_spec.rb +29 -0
- data/lib/capybara/spec/session/find_spec.rb +55 -0
- data/lib/capybara/spec/session/has_ancestor_spec.rb +2 -0
- data/lib/capybara/spec/session/has_button_spec.rb +51 -0
- data/lib/capybara/spec/session/has_css_spec.rb +26 -4
- data/lib/capybara/spec/session/has_current_path_spec.rb +15 -2
- data/lib/capybara/spec/session/has_field_spec.rb +34 -0
- data/lib/capybara/spec/session/has_select_spec.rb +32 -4
- data/lib/capybara/spec/session/has_selector_spec.rb +4 -4
- data/lib/capybara/spec/session/has_table_spec.rb +51 -5
- data/lib/capybara/spec/session/has_text_spec.rb +30 -0
- data/lib/capybara/spec/session/html_spec.rb +1 -1
- data/lib/capybara/spec/session/matches_style_spec.rb +2 -2
- data/lib/capybara/spec/session/node_spec.rb +394 -9
- data/lib/capybara/spec/session/refresh_spec.rb +2 -1
- data/lib/capybara/spec/session/save_and_open_screenshot_spec.rb +2 -2
- data/lib/capybara/spec/session/save_page_spec.rb +4 -4
- data/lib/capybara/spec/session/save_screenshot_spec.rb +4 -15
- data/lib/capybara/spec/session/selectors_spec.rb +16 -3
- data/lib/capybara/spec/session/window/switch_to_window_spec.rb +1 -1
- data/lib/capybara/spec/session/window/window_opened_by_spec.rb +1 -1
- data/lib/capybara/spec/session/window/window_spec.rb +8 -8
- data/lib/capybara/spec/session/window/windows_spec.rb +1 -1
- data/lib/capybara/spec/spec_helper.rb +14 -14
- data/lib/capybara/spec/test_app.rb +27 -21
- data/lib/capybara/spec/views/form.erb +47 -4
- data/lib/capybara/spec/views/offset.erb +32 -0
- data/lib/capybara/spec/views/spatial.erb +31 -0
- data/lib/capybara/spec/views/with_animation.erb +37 -1
- data/lib/capybara/spec/views/with_dragula.erb +24 -0
- data/lib/capybara/spec/views/with_html.erb +24 -2
- data/lib/capybara/spec/views/with_jquery_animation.erb +24 -0
- data/lib/capybara/spec/views/with_js.erb +4 -1
- data/lib/capybara/spec/views/with_jstree.erb +26 -0
- data/lib/capybara/spec/views/with_sortable_js.erb +1 -1
- data/lib/capybara/version.rb +1 -1
- data/lib/capybara/window.rb +3 -7
- data/spec/basic_node_spec.rb +15 -14
- data/spec/capybara_spec.rb +28 -28
- data/spec/dsl_spec.rb +16 -3
- data/spec/filter_set_spec.rb +5 -5
- data/spec/fixtures/selenium_driver_rspec_failure.rb +1 -1
- data/spec/fixtures/selenium_driver_rspec_success.rb +1 -1
- data/spec/minitest_spec.rb +3 -2
- data/spec/minitest_spec_spec.rb +46 -46
- data/spec/rack_test_spec.rb +38 -15
- data/spec/regexp_dissassembler_spec.rb +52 -38
- data/spec/result_spec.rb +43 -32
- data/spec/rspec/features_spec.rb +4 -1
- data/spec/rspec/scenarios_spec.rb +4 -0
- data/spec/rspec/shared_spec_matchers.rb +68 -56
- data/spec/rspec_spec.rb +9 -5
- data/spec/selector_spec.rb +32 -17
- data/spec/selenium_spec_chrome.rb +78 -11
- data/spec/selenium_spec_chrome_remote.rb +23 -6
- data/spec/selenium_spec_edge.rb +15 -12
- data/spec/selenium_spec_firefox.rb +24 -19
- data/spec/selenium_spec_firefox_remote.rb +0 -8
- data/spec/selenium_spec_ie.rb +1 -6
- data/spec/server_spec.rb +106 -44
- data/spec/session_spec.rb +5 -5
- data/spec/shared_selenium_node.rb +56 -2
- data/spec/shared_selenium_session.rb +122 -15
- data/spec/spec_helper.rb +2 -2
- metadata +63 -17
- data/lib/capybara/spec/session/source_spec.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 516861530f59d3d9713daba7379838146575b920f787ac2c3f5c4bbffc6bf44d
|
4
|
+
data.tar.gz: 85b3fb81bf05e43122c2eef320a7a2dbd500033723ebbc04ebc414b0a42d0881
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f745dac92b73afa56f43a2a509052c7fc5d1efa458863b0b3f05507c664847d6f67720a2c2a680e21126888e63a6eaf6a0e9be7d1a4df9d6aaa9ec61d832e29
|
7
|
+
data.tar.gz: 53532156dd31631879a0a8fda93126f259a5cd856a6cec82e6283f9f96e1cc2d98b788e4414ffee5756024d14819450d358529aa90d4c948618e82b878342ebd
|
data/History.md
CHANGED
@@ -1,3 +1,256 @@
|
|
1
|
+
# Version 3.35.3
|
2
|
+
Release date: 2021-01-29
|
3
|
+
|
4
|
+
### Fixed
|
5
|
+
* Just a release to have the correct dates in the History.md in released gem
|
6
|
+
|
7
|
+
# Version 3.35.2
|
8
|
+
Release date: 2021-01-29
|
9
|
+
|
10
|
+
### Fixed
|
11
|
+
|
12
|
+
* Selenium deprecation suppressor with Selenium 3.x
|
13
|
+
|
14
|
+
# Version 3.35.1
|
15
|
+
Release date: 2021-01-26
|
16
|
+
|
17
|
+
### Fixed
|
18
|
+
|
19
|
+
* Default chrome driver registrations use chrome - Issue #2442 [Yuriy Alekseyev]
|
20
|
+
* 'Capybara.test_id' usage with the :button selector - Issue #2443
|
21
|
+
|
22
|
+
# Version 3.35.0
|
23
|
+
Release date: 2021-01-25
|
24
|
+
|
25
|
+
### Added
|
26
|
+
|
27
|
+
* Support Regexp matching for individual class names in :class filter passed an Array
|
28
|
+
* Animation disabler now supports JQuery animation disabling when JQuery loaded from body [Chien-Wei Huang]
|
29
|
+
|
30
|
+
### Fixed
|
31
|
+
|
32
|
+
* :button selector type use with `enable_aria_role` [Sean Doyle]
|
33
|
+
* <label> elements don't associate with aria-role buttons
|
34
|
+
* Ignore Selenium::WebDriver::Error::InvalidSessionIdError when quitting driver [Robin Daugherty]
|
35
|
+
* Firefox: Don't click input when sending keys if already focused
|
36
|
+
* Miscellaneous issues with selenium-webdriver 4.0.0.alphas
|
37
|
+
* Nil return error in node details optimizations
|
38
|
+
* Animation disabler now inserts XHTML compliant content [Dale Morgan]
|
39
|
+
|
40
|
+
# Version 3.34.0
|
41
|
+
Release date: 2020-11-26
|
42
|
+
|
43
|
+
### Added
|
44
|
+
|
45
|
+
* Ability to fill in with emoji when using Chrome with selenium driver (Firefox already worked)
|
46
|
+
* Current path assertions/expectations accept optional filter block
|
47
|
+
* Animation disabler now specifies `scroll-behavior: auto;` [Nathan Broadbent]
|
48
|
+
* :button selector can now find elements by label text [Sean Doyle]
|
49
|
+
* `Session#send_keys` to send keys to the current element with focus in drivers that support the
|
50
|
+
concept of a current element [Sean Doyle]
|
51
|
+
|
52
|
+
### Changed
|
53
|
+
|
54
|
+
* Text query validates the type parameter to prevent undefined behavior
|
55
|
+
|
56
|
+
### Fixed
|
57
|
+
|
58
|
+
* racktest driver better handles fragments and redirection to urls that include fragments
|
59
|
+
* Don't error when attempting to get XPath location of a shadow element
|
60
|
+
* Missing `readonly?` added to Node::Simple
|
61
|
+
* Selenium version detection when loaded via alternate method [Joel Hawksley]
|
62
|
+
* Connection count issue if REQUEST_URI value changed by app [Blake Williams]
|
63
|
+
* Maintain URI fragment when redirecting in rack-test driver
|
64
|
+
* Text query error message [Wojciech Wnętrzak]
|
65
|
+
* Checking a checkbox/radio button with `allow_label_click` now works if there are multiple labels (Issue #2421)
|
66
|
+
* `drop` with `Pathname` (Issue #2424)[Máximo Mussini]
|
67
|
+
|
68
|
+
# Version 3.33.0
|
69
|
+
Release date: 2020-06-21
|
70
|
+
|
71
|
+
### Added
|
72
|
+
|
73
|
+
* Block passed to `within_session` now receives the new and old session
|
74
|
+
* Support for aria-role button when enabled [Seiei Miyagi]
|
75
|
+
* Support for aria-role link when enabled
|
76
|
+
* Support for `validation_message` filter with :field and :fillable_field selectors
|
77
|
+
* Deprecation warnings show source location [Koichi ITO]
|
78
|
+
|
79
|
+
### Changed
|
80
|
+
|
81
|
+
* Ruby 2.5.0+ is now required
|
82
|
+
* Deprecated direct manipulation of the driver and server registries
|
83
|
+
|
84
|
+
### Fixed
|
85
|
+
|
86
|
+
* Ruby 2.7 warning in minitest `assert_text` [Eileen M. Uchitelle]
|
87
|
+
|
88
|
+
|
89
|
+
# Version 3.32.2
|
90
|
+
Release date: 2020-05-16
|
91
|
+
|
92
|
+
### Fixed
|
93
|
+
|
94
|
+
* Don't use lazy enumerator with JRuby due to leaking threads
|
95
|
+
* Ruby 2.7 deprecation warning when registering Webrick [Jon Zeppieri]
|
96
|
+
* `have_text` description [Juan Pablo Rinaldi]
|
97
|
+
|
98
|
+
# Version 3.32.1
|
99
|
+
Release date: 2020-04-05
|
100
|
+
|
101
|
+
### Fixed
|
102
|
+
|
103
|
+
* Rapid set now respects field maxlength (Issue #2332)
|
104
|
+
* Only patch pause into legacy actions in Selenium < 4 (Issue #2334)
|
105
|
+
|
106
|
+
# Version 3.32.0
|
107
|
+
Release date: 2020-03-29
|
108
|
+
|
109
|
+
### Added
|
110
|
+
|
111
|
+
* Support `delay` setting on click with Selenium
|
112
|
+
* Implement rapid set for values longer than 30 characters in text fields with Selenium
|
113
|
+
|
114
|
+
### Fixed
|
115
|
+
|
116
|
+
* Result#[] and negative max on ranges (Issue #2302/2303) [Jeremy Evans]
|
117
|
+
* RackTest form submission rewrites query string when using GET method
|
118
|
+
* Ruby 2.7 deprecation warnings in RSpec matcher proxies
|
119
|
+
|
120
|
+
# Version 3.31.0
|
121
|
+
Release date: 2020-01-26
|
122
|
+
|
123
|
+
### Added
|
124
|
+
|
125
|
+
* Support setting range inputs with the selenium driver [Andrew White]
|
126
|
+
* Support setting range inputs with the rack driver
|
127
|
+
* Support drop modifier keys in drag & drop [Elliot Crosby-McCullough]
|
128
|
+
* `enabled_options` and `disabled options` filters for select selector
|
129
|
+
* Support beginless ranges
|
130
|
+
* Optionally allow `all` results to be reloaded when stable - Beta feature - may be removed in
|
131
|
+
future version if problems occur
|
132
|
+
|
133
|
+
### Fixed
|
134
|
+
|
135
|
+
* Fix Ruby 2.7 deprecation notices around keyword arguments. I have tried to do this without
|
136
|
+
any breaking changes, but due to the nature of the 2.7 changes and some selector types accepting
|
137
|
+
Hashes as locators there are a lot of edge cases. If you find any broken cases please report
|
138
|
+
them and I'll see if they're fixable.
|
139
|
+
* Clicking on details/summary element behavior in rack_test driver_
|
140
|
+
|
141
|
+
# Version 3.30.0
|
142
|
+
Release date: 2019-12-24
|
143
|
+
|
144
|
+
### Added
|
145
|
+
|
146
|
+
* Display pending requests when they don't complete in time [Juan Carlos Medina]
|
147
|
+
* :order option in selector queries - set to :reverse to for reverse document order results
|
148
|
+
* Support regexp for :name and :placeholder options in selectors that import filters from
|
149
|
+
_field filter set
|
150
|
+
|
151
|
+
### Fixed
|
152
|
+
|
153
|
+
* Issue around automatic port assignment - Issue #2245
|
154
|
+
* Label selector when label has no id - Issue #2260
|
155
|
+
* Preserve clientX/clientY in Selenium HTML5 drag emulation [Nicolò G.]
|
156
|
+
* table selector using :with_cols option if last specified column matched but others didn't - Issue #2287
|
157
|
+
* Some tests updated for Ruby 2.7 behavior change around keyword args
|
158
|
+
|
159
|
+
# Version 3.29.0
|
160
|
+
Release date: 2019-09-02
|
161
|
+
|
162
|
+
### Added
|
163
|
+
|
164
|
+
* Allow clicking on file input when using the block version of `attach_file` with Chrome and Firefox
|
165
|
+
* Spatial filters (`left_of`, `right_of`, `above`, `below`, `near`)
|
166
|
+
* rack_test driver now supports clicking on details elements to open/close them
|
167
|
+
|
168
|
+
### Fixed
|
169
|
+
|
170
|
+
* rack_test driver correctly determines visibility for open details elements descendants
|
171
|
+
|
172
|
+
### Changed
|
173
|
+
|
174
|
+
* Results will now be lazily evaluated when using JRuby >= 9.2.8.0
|
175
|
+
|
176
|
+
|
177
|
+
# Version 3.28.0
|
178
|
+
Release date: 2019-08-03
|
179
|
+
|
180
|
+
### Added
|
181
|
+
|
182
|
+
* Allow forcing HTML5 or legacy dragging via the `:html5` option to `drag_to` when using Selenium with Chrome or Firefox
|
183
|
+
* Autodetection of drag type interprets not seeing the mousedown event as legacy.
|
184
|
+
* HTML5 form validation `:valid` node filter added to `:field` and `:fillable_field` selectors
|
185
|
+
* When using Capybara registered :puma server - patches Puma 4.0.x to fix SSL connection behavior. Removes
|
186
|
+
default `queue_requests` setting - Issue #2227
|
187
|
+
|
188
|
+
# Version 3.27.0
|
189
|
+
Release date: 2019-07-28
|
190
|
+
|
191
|
+
### Added
|
192
|
+
|
193
|
+
* Allow to use chromedriver/geckodriver native `is_element_displayed` endpoint via Selenium
|
194
|
+
driver `native_displayed` option for performance reasons. Disabled by default due to endpoints
|
195
|
+
currently not handling <details> element descendants visibility correctly.
|
196
|
+
|
197
|
+
### Fixed
|
198
|
+
|
199
|
+
* Ignore negative lookahead/lookbehind regex when performing initial XPath text matching
|
200
|
+
* Reloading of elements found via `ancestor` and `sibling`
|
201
|
+
* Only default puma settings to `queue_requests: false` when using SSL
|
202
|
+
* Visibility of descendants of <details> elements is correctly determined when using rack_test
|
203
|
+
and the selenium driver with Capybara optimized atoms
|
204
|
+
* local/session storage clearance in Chrome when clearing only one of them - Issue #2233
|
205
|
+
|
206
|
+
# Version 3.26.0
|
207
|
+
Release date: 2019-07-15
|
208
|
+
|
209
|
+
### Added
|
210
|
+
|
211
|
+
* `w3c_click_offset` configuration option applies to `right_click` and `double_click` as well as `click`
|
212
|
+
* Warning when passing `nil` to the text/content assertions/expectations
|
213
|
+
* `Session#server_url` returns the base url the AUT is being run at (when controlled by Capybara)
|
214
|
+
* `option` selector type accepts an integer as locator
|
215
|
+
|
216
|
+
### Fixed
|
217
|
+
|
218
|
+
* Default puma server registration now specifies `queue_requests: false` - Issue #2227
|
219
|
+
* Workaround issue with FF 68 and hanging during reset if a system modal is visible
|
220
|
+
* Don't expand file path if it's already absolute - Issue #2228
|
221
|
+
|
222
|
+
# Version 3.25.0
|
223
|
+
Release date: 2019-06-27
|
224
|
+
|
225
|
+
### Added
|
226
|
+
|
227
|
+
* Animation disabler also disables before and after pseudoelements - Issue #2221 [Daniel Heath]
|
228
|
+
* `w3c_click_offset` configuration option to determine whether click offsets are calculated from element
|
229
|
+
center or top left corner
|
230
|
+
|
231
|
+
### Fixed
|
232
|
+
|
233
|
+
* Work around issue with chromedriver 76/77 in W3C mode losing mouse state during legacy drag. Only fixed if
|
234
|
+
both source and target are simultaneously inside the viewport - Issue #2223
|
235
|
+
* Negative ancestor expectations/predicates were incorrectly checking siblings rather than ancestors
|
236
|
+
|
237
|
+
# Version 3.24.0
|
238
|
+
Release date: 2019-06-13
|
239
|
+
|
240
|
+
### Added
|
241
|
+
|
242
|
+
* Log access when using the Selenium driver with Chrome 75 in W3C mode has been reenabled.
|
243
|
+
|
244
|
+
### Changed
|
245
|
+
|
246
|
+
* Selenium driver now selects all current content and then sends keys rather than clearing field by JS
|
247
|
+
and then sending keys when setting values to text inputs in order to more closely simulate user behavior
|
248
|
+
|
249
|
+
### Fixed
|
250
|
+
|
251
|
+
* Relative paths passed to `attach_file` will be assumed to be relative to the current working directory when using the
|
252
|
+
Selenium driver
|
253
|
+
|
1
254
|
# Version 3.23.0
|
2
255
|
Release date: 2019-06-10
|
3
256
|
|
@@ -257,7 +510,7 @@ Release date: 2018-10-23
|
|
257
510
|
|
258
511
|
### Fixed
|
259
512
|
|
260
|
-
* Selector `css` expression
|
513
|
+
* Selector `css` expression definition declared filters now work again
|
261
514
|
* Cleaned up warnings [Yuji Yaginuma]
|
262
515
|
* Workaround installation of rspec matcher proxies under jruby by reverting to the old solution not using prepend, so jruby bugs are not hit - Issue #2115
|
263
516
|
|
@@ -374,7 +627,7 @@ Release date: 2018-07-19
|
|
374
627
|
|
375
628
|
### Fixed
|
376
629
|
|
377
|
-
* Make selenium driver :backspace clear
|
630
|
+
* Make selenium driver :backspace clear strategy work even if caret location is in middle of field content [Champier Cyril]
|
378
631
|
* Selenium issue with fieldset nested in disabled fieldset not being considered disabled
|
379
632
|
* `Session#evaluate_script` and `Element#evaluate_script` now strip leading/trailing whitespace from scripts [Ian Lesperance]
|
380
633
|
|
@@ -473,7 +726,7 @@ Release date: 2018-04-13
|
|
473
726
|
### Fixes
|
474
727
|
|
475
728
|
* Fix expression filter descriptions in some selector failure messages
|
476
|
-
* Fix compounding of negated
|
729
|
+
* Fix compounding of negated matchers - Issue #2010
|
477
730
|
|
478
731
|
# Version 3.0.1
|
479
732
|
Release date: 2018-04-06
|
@@ -747,7 +1000,7 @@ Release date: 2016-12-05
|
|
747
1000
|
* Options for clearing session/local storage on reset added to the Selenium driver
|
748
1001
|
* Window size changes wait for the size to stabilize
|
749
1002
|
* Defined return value for most actions
|
750
|
-
* Ignore specific error when
|
1003
|
+
* Ignore specific error when quitting selenium driver instance - Issue #1773 [Dylan Reichstadt, Thomas Walpole]
|
751
1004
|
* Warn on selenium unknown errors rather than raising when quitting driver [Adam Pohorecki, Thomas Walpole]
|
752
1005
|
* Capybara::Result#each now returns an `Enumerator` when called without a block - Issue #1777 [Thomas Walpole]
|
753
1006
|
|
@@ -809,7 +1062,7 @@ Release date: 2016-09-19
|
|
809
1062
|
|
810
1063
|
### Fixed
|
811
1064
|
|
812
|
-
* Issue with rack-test driver and
|
1065
|
+
* Issue with rack-test driver and obsolete mime-types when using `#attach_file` - Issue #1756 [Thomas Walpole]
|
813
1066
|
|
814
1067
|
### Added
|
815
1068
|
|
@@ -876,7 +1129,7 @@ Release date: 2016-04-07
|
|
876
1129
|
|
877
1130
|
### Added
|
878
1131
|
|
879
|
-
* Capybara now waits for requests to Capybaras server to complete while
|
1132
|
+
* Capybara now waits for requests to Capybaras server to complete while resetting the session [John Hawthorn, Thomas Walpole]
|
880
1133
|
* Capybara.reuse_server option to allow disabling of sharing server instance between sessions [Thomas Walpole]
|
881
1134
|
* :multiple filter added to relevant selectors [Thomas Walpole]
|
882
1135
|
* Provided server registrations for :webrick and :puma. Capybara.server = :puma for testing with Rails 5 [Thomas Walpole]
|
@@ -890,7 +1143,7 @@ Release date: 2016-04-07
|
|
890
1143
|
|
891
1144
|
# Version 2.6.2
|
892
1145
|
|
893
|
-
|
1146
|
+
Release date: 2016-01-27
|
894
1147
|
|
895
1148
|
### Fixed
|
896
1149
|
|
@@ -1436,8 +1689,8 @@ Release date: 2011-06-14
|
|
1436
1689
|
* Rack::Test driver honours maxlength on input fields [Guilherme Carvalho]
|
1437
1690
|
* Rack::Test now works as expected with domains and subdomains [Jonas Nicklas]
|
1438
1691
|
* Session is reset more thoroughly between tests. [Jonas Nicklas]
|
1439
|
-
* Raise error when uploading non-
|
1440
|
-
* Rack
|
1692
|
+
* Raise error when uploading non-existent file [Jonas Nicklas]
|
1693
|
+
* Rack response body should respond to #each [Piotr Sarnacki]
|
1441
1694
|
* Deprecation warnings with selenium webdriver 0.2.0 [Aaron Gibraltar]
|
1442
1695
|
* Selenium Chrome no longer YELLS tagname [Carl Jackson & David W. Frank]
|
1443
1696
|
* Capybara no longer strips encoding before sending to Rack [Jonas Nicklas]
|
@@ -1579,7 +1832,7 @@ Release date: 2010-05-12
|
|
1579
1832
|
|
1580
1833
|
Release date: 2010-04-09
|
1581
1834
|
|
1582
|
-
This is a drop in compatible
|
1835
|
+
This is a drop in compatible maintenance release. It's mostly
|
1583
1836
|
important for driver authors.
|
1584
1837
|
|
1585
1838
|
### Added
|
@@ -1598,7 +1851,7 @@ important for driver authors.
|
|
1598
1851
|
|
1599
1852
|
Release date: 2010-03-22
|
1600
1853
|
|
1601
|
-
This is a
|
1854
|
+
This is a maintenance release with minor bug fixes, should be
|
1602
1855
|
drop in compatible.
|
1603
1856
|
|
1604
1857
|
### Added
|
data/README.md
CHANGED
@@ -7,9 +7,6 @@
|
|
7
7
|
[](https://gitter.im/jnicklas/capybara?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
8
8
|
[](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.23.x version of Capybara.
|
11
|
-
|
12
|
-
|
13
10
|
Capybara helps you test web applications by simulating how a real user would
|
14
11
|
interact with your app. It is agnostic about the driver running your tests and
|
15
12
|
comes with Rack::Test and Selenium support built in. WebKit is supported
|
@@ -77,7 +74,7 @@ GitHub): http://groups.google.com/group/ruby-capybara
|
|
77
74
|
|
78
75
|
## <a name="setup"></a>Setup
|
79
76
|
|
80
|
-
Capybara requires Ruby 2.
|
77
|
+
Capybara requires Ruby 2.5.0 or later. To install, add this line to your
|
81
78
|
`Gemfile` and run `bundle install`:
|
82
79
|
|
83
80
|
```ruby
|
@@ -150,7 +147,7 @@ require 'capybara/rspec'
|
|
150
147
|
|
151
148
|
If you are using Rails, put your Capybara specs in `spec/features` or `spec/system` (only works
|
152
149
|
if [you have it configured in
|
153
|
-
RSpec](https://
|
150
|
+
RSpec](https://relishapp.com/rspec/rspec-rails/v/4-0/docs/directory-structure))
|
154
151
|
and if you have your Capybara specs in a different directory, then tag the
|
155
152
|
example groups with `type: :feature` or `type: :system` depending on which type of test you're writing.
|
156
153
|
|
@@ -392,7 +389,7 @@ Capybara supports [Selenium 3.5+
|
|
392
389
|
In order to use Selenium, you'll need to install the `selenium-webdriver` gem,
|
393
390
|
and add it to your Gemfile if you're using bundler.
|
394
391
|
|
395
|
-
Capybara pre-registers a number of named
|
392
|
+
Capybara pre-registers a number of named drivers that use Selenium - they are:
|
396
393
|
|
397
394
|
* :selenium => Selenium driving Firefox
|
398
395
|
* :selenium_headless => Selenium driving Firefox in a headless configuration
|
@@ -1056,6 +1053,13 @@ additional info about how the underlying driver can be configured.
|
|
1056
1053
|
are testing for specific server errors and using multiple sessions make sure to test for the
|
1057
1054
|
errors using the initial session (usually :default)
|
1058
1055
|
|
1056
|
+
* If WebMock is enabled, you may encounter a "Too many open files"
|
1057
|
+
error. A simple `page.find` call may cause thousands of HTTP requests
|
1058
|
+
until the timeout occurs. By default, WebMock will cause each of these
|
1059
|
+
requests to spawn a new connection. To work around this problem, you
|
1060
|
+
may need to [enable WebMock's `net_http_connect_on_start: true`
|
1061
|
+
parameter](https://github.com/bblimke/webmock/blob/master/README.md#connecting-on-nethttpstart).
|
1062
|
+
|
1059
1063
|
## <a name="threadsafe"></a>"Threadsafe" mode
|
1060
1064
|
|
1061
1065
|
In normal mode most of Capybara's configuration options are global settings which can cause issues
|
data/lib/capybara.rb
CHANGED
@@ -5,6 +5,7 @@ require 'nokogiri'
|
|
5
5
|
require 'xpath'
|
6
6
|
require 'forwardable'
|
7
7
|
require 'capybara/config'
|
8
|
+
require 'capybara/registration_container'
|
8
9
|
|
9
10
|
module Capybara
|
10
11
|
class CapybaraError < StandardError; end
|
@@ -81,6 +82,7 @@ module Capybara
|
|
81
82
|
# - **default_selector** (`:css`, `:xpath` = `:css`) - Methods which take a selector use the given type by default. See also {Capybara::Selector}.
|
82
83
|
# - **default_set_options** (Hash = `{}`) - The default options passed to {Capybara::Node::Element#set Element#set}.
|
83
84
|
# - **enable_aria_label** (Boolean = `false`) - Whether fields, links, and buttons will match against `aria-label` attribute.
|
85
|
+
# - **enable_aria_role** (Boolean = `false`) - Selectors will check for relevant aria role (currently only `button`).
|
84
86
|
# - **exact** (Boolean = `false`) - Whether locators are matched exactly or with substrings. Only affects selector conditions
|
85
87
|
# written using the `XPath#is` method.
|
86
88
|
# - **exact_text** (Boolean = `false`) - Whether the text matchers and `:text` filter match exactly or on substrings.
|
@@ -93,10 +95,12 @@ module Capybara
|
|
93
95
|
# - **save_path** (String = `Dir.pwd`) - Where to put pages saved through {Capybara::Session#save_page save_page}, {Capybara::Session#save_screenshot save_screenshot},
|
94
96
|
# {Capybara::Session#save_and_open_page save_and_open_page}, or {Capybara::Session#save_and_open_screenshot save_and_open_screenshot}.
|
95
97
|
# - **server** (Symbol = `:default` (which uses puma)) - The name of the registered server to use when running the app under test.
|
98
|
+
# - **server_port** (Integer) - The port Capybara will run the application server on, if not specified a random port will be used.
|
96
99
|
# - **server_errors** (Array\<Class> = `[Exception]`) - Error classes that should be raised in the tests if they are raised in the server
|
97
100
|
# and {configure raise_server_errors} is `true`.
|
98
101
|
# - **test_id** (Symbol, String, `nil` = `nil`) - Optional attribute to match locator against with built-in selectors along with id.
|
99
102
|
# - **threadsafe** (Boolean = `false`) - Whether sessions can be configured individually.
|
103
|
+
# - **w3c_click_offset** (Boolean = 'false') - Whether click offsets should be from element center (true) or top left (false)
|
100
104
|
#
|
101
105
|
# #### DSL Options
|
102
106
|
#
|
@@ -123,7 +127,7 @@ module Capybara
|
|
123
127
|
# @yieldreturn [Capybara::Driver::Base] A Capybara driver instance
|
124
128
|
#
|
125
129
|
def register_driver(name, &block)
|
126
|
-
drivers
|
130
|
+
drivers.send(:register, name, block)
|
127
131
|
end
|
128
132
|
|
129
133
|
##
|
@@ -142,7 +146,7 @@ module Capybara
|
|
142
146
|
# @yieldparam host The host/ip to bind to
|
143
147
|
#
|
144
148
|
def register_server(name, &block)
|
145
|
-
servers
|
149
|
+
servers.send(:register, name.to_sym, block)
|
146
150
|
end
|
147
151
|
|
148
152
|
##
|
@@ -196,11 +200,11 @@ module Capybara
|
|
196
200
|
end
|
197
201
|
|
198
202
|
def drivers
|
199
|
-
@drivers ||=
|
203
|
+
@drivers ||= RegistrationContainer.new
|
200
204
|
end
|
201
205
|
|
202
206
|
def servers
|
203
|
-
@servers ||=
|
207
|
+
@servers ||= RegistrationContainer.new
|
204
208
|
end
|
205
209
|
|
206
210
|
# Wraps the given string, which should contain an HTML document or fragment
|
@@ -348,7 +352,8 @@ module Capybara
|
|
348
352
|
#
|
349
353
|
# Yield a block using a specific session name or {Capybara::Session} instance.
|
350
354
|
#
|
351
|
-
def using_session(name_or_session)
|
355
|
+
def using_session(name_or_session, &block)
|
356
|
+
previous_session = current_session
|
352
357
|
previous_session_info = {
|
353
358
|
specified_session: specified_session,
|
354
359
|
session_name: session_name,
|
@@ -361,7 +366,12 @@ module Capybara
|
|
361
366
|
else
|
362
367
|
self.session_name = name_or_session
|
363
368
|
end
|
364
|
-
|
369
|
+
|
370
|
+
if block.arity.zero?
|
371
|
+
yield
|
372
|
+
else
|
373
|
+
yield current_session, previous_session
|
374
|
+
end
|
365
375
|
ensure
|
366
376
|
self.session_name, self.specified_session = previous_session_info.values_at(:session_name, :specified_session)
|
367
377
|
self.current_driver, self.app = previous_session_info.values_at(:current_driver, :app) if threadsafe
|
@@ -393,7 +403,7 @@ module Capybara
|
|
393
403
|
template.inner_html = ''
|
394
404
|
end
|
395
405
|
document.xpath('//textarea').each do |textarea|
|
396
|
-
textarea['_capybara_raw_value'] = textarea.content.
|
406
|
+
textarea['_capybara_raw_value'] = textarea.content.delete_prefix("\n")
|
397
407
|
end
|
398
408
|
end
|
399
409
|
end
|
@@ -474,7 +484,7 @@ module Capybara
|
|
474
484
|
require 'capybara/rack_test/node'
|
475
485
|
require 'capybara/rack_test/form'
|
476
486
|
require 'capybara/rack_test/browser'
|
477
|
-
require 'capybara/rack_test/css_handlers
|
487
|
+
require 'capybara/rack_test/css_handlers'
|
478
488
|
|
479
489
|
require 'capybara/selenium/node'
|
480
490
|
require 'capybara/selenium/driver'
|
@@ -500,10 +510,12 @@ Capybara.configure do |config|
|
|
500
510
|
config.visible_text_only = false
|
501
511
|
config.automatic_label_click = false
|
502
512
|
config.enable_aria_label = false
|
513
|
+
config.enable_aria_role = false
|
503
514
|
config.reuse_server = true
|
504
515
|
config.default_set_options = {}
|
505
516
|
config.test_id = nil
|
506
517
|
config.predicates_wait = true
|
507
518
|
config.default_normalize_ws = false
|
508
519
|
config.allow_gumbo = false
|
520
|
+
config.w3c_click_offset = false
|
509
521
|
end
|