capybara 3.26.0 → 3.31.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.md +86 -0
- data/README.md +2 -3
- data/lib/capybara/config.rb +7 -3
- data/lib/capybara/driver/node.rb +4 -0
- data/lib/capybara/dsl.rb +10 -2
- data/lib/capybara/helpers.rb +3 -1
- data/lib/capybara/minitest.rb +47 -33
- data/lib/capybara/node/actions.rb +24 -19
- data/lib/capybara/node/document.rb +2 -2
- data/lib/capybara/node/document_matchers.rb +3 -3
- data/lib/capybara/node/element.rb +54 -17
- data/lib/capybara/node/finders.rb +17 -11
- data/lib/capybara/node/matchers.rb +66 -51
- data/lib/capybara/node/simple.rb +6 -3
- data/lib/capybara/queries/ancestor_query.rb +5 -9
- data/lib/capybara/queries/base_query.rb +2 -1
- data/lib/capybara/queries/selector_query.rb +220 -6
- data/lib/capybara/queries/sibling_query.rb +4 -10
- data/lib/capybara/rack_test/browser.rb +4 -1
- data/lib/capybara/rack_test/driver.rb +1 -1
- data/lib/capybara/rack_test/form.rb +1 -1
- data/lib/capybara/rack_test/node.rb +38 -3
- data/lib/capybara/registrations/patches/puma_ssl.rb +27 -0
- data/lib/capybara/registrations/servers.rb +7 -1
- data/lib/capybara/result.rb +29 -9
- data/lib/capybara/rspec/matchers.rb +27 -27
- data/lib/capybara/rspec/matchers/base.rb +14 -6
- data/lib/capybara/rspec/matchers/count_sugar.rb +2 -1
- data/lib/capybara/rspec/matchers/have_ancestor.rb +4 -3
- data/lib/capybara/rspec/matchers/have_current_path.rb +2 -2
- data/lib/capybara/rspec/matchers/have_selector.rb +15 -7
- data/lib/capybara/rspec/matchers/have_sibling.rb +3 -3
- data/lib/capybara/rspec/matchers/have_text.rb +2 -2
- 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 +2 -2
- data/lib/capybara/rspec/matchers/spatial_sugar.rb +39 -0
- data/lib/capybara/selector.rb +35 -17
- data/lib/capybara/selector/css.rb +1 -1
- data/lib/capybara/selector/definition.rb +2 -2
- data/lib/capybara/selector/definition/button.rb +7 -2
- 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 +1 -1
- data/lib/capybara/selector/definition/datalist_option.rb +1 -1
- data/lib/capybara/selector/definition/element.rb +1 -1
- 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 +4 -2
- data/lib/capybara/selector/definition/radio_button.rb +2 -2
- data/lib/capybara/selector/definition/select.rb +32 -13
- data/lib/capybara/selector/definition/table.rb +5 -2
- data/lib/capybara/selector/filter_set.rb +11 -9
- 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 +4 -2
- data/lib/capybara/selenium/atoms/isDisplayed.min.js +1 -1
- data/lib/capybara/selenium/atoms/src/isDisplayed.js +9 -9
- data/lib/capybara/selenium/driver.rb +25 -12
- data/lib/capybara/selenium/driver_specializations/chrome_driver.rb +10 -9
- data/lib/capybara/selenium/driver_specializations/edge_driver.rb +14 -10
- data/lib/capybara/selenium/driver_specializations/firefox_driver.rb +5 -2
- 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 +19 -9
- data/lib/capybara/selenium/extensions/html5_drag.rb +37 -15
- data/lib/capybara/selenium/node.rb +62 -15
- data/lib/capybara/selenium/nodes/chrome_node.rb +54 -14
- data/lib/capybara/selenium/nodes/edge_node.rb +32 -14
- data/lib/capybara/selenium/nodes/firefox_node.rb +20 -6
- data/lib/capybara/selenium/nodes/safari_node.rb +0 -4
- data/lib/capybara/selenium/patches/is_displayed.rb +16 -0
- data/lib/capybara/server.rb +15 -3
- data/lib/capybara/server/checker.rb +1 -1
- data/lib/capybara/server/middleware.rb +20 -10
- data/lib/capybara/session.rb +40 -23
- data/lib/capybara/session/config.rb +6 -2
- data/lib/capybara/session/matchers.rb +6 -6
- data/lib/capybara/spec/public/test.js +51 -6
- 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/click_button_spec.rb +5 -0
- data/lib/capybara/spec/session/fill_in_spec.rb +20 -0
- data/lib/capybara/spec/session/find_spec.rb +52 -0
- data/lib/capybara/spec/session/has_css_spec.rb +21 -3
- data/lib/capybara/spec/session/has_field_spec.rb +18 -0
- data/lib/capybara/spec/session/has_select_spec.rb +28 -0
- data/lib/capybara/spec/session/has_table_spec.rb +51 -5
- data/lib/capybara/spec/session/has_text_spec.rb +35 -0
- data/lib/capybara/spec/session/node_spec.rb +168 -3
- data/lib/capybara/spec/session/save_and_open_screenshot_spec.rb +2 -2
- data/lib/capybara/spec/session/save_screenshot_spec.rb +4 -4
- data/lib/capybara/spec/session/selectors_spec.rb +15 -2
- data/lib/capybara/spec/views/form.erb +17 -2
- data/lib/capybara/spec/views/spatial.erb +31 -0
- data/lib/capybara/spec/views/with_html.erb +19 -0
- data/lib/capybara/spec/views/with_jstree.erb +26 -0
- data/lib/capybara/version.rb +1 -1
- data/spec/basic_node_spec.rb +6 -6
- data/spec/capybara_spec.rb +28 -28
- data/spec/dsl_spec.rb +3 -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_spec.rb +46 -46
- data/spec/rack_test_spec.rb +10 -10
- data/spec/regexp_dissassembler_spec.rb +56 -38
- data/spec/result_spec.rb +8 -4
- data/spec/rspec/features_spec.rb +1 -0
- data/spec/rspec/shared_spec_matchers.rb +5 -5
- data/spec/rspec_spec.rb +5 -5
- data/spec/selector_spec.rb +15 -15
- data/spec/selenium_spec_chrome.rb +44 -1
- data/spec/selenium_spec_chrome_remote.rb +0 -6
- data/spec/selenium_spec_edge.rb +14 -15
- data/spec/selenium_spec_firefox.rb +8 -5
- data/spec/selenium_spec_firefox_remote.rb +0 -8
- data/spec/selenium_spec_ie.rb +1 -6
- data/spec/server_spec.rb +60 -18
- data/spec/session_spec.rb +5 -5
- data/spec/shared_selenium_node.rb +38 -2
- data/spec/shared_selenium_session.rb +8 -7
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd31d35629d475d7fdaba1d6e415599d995a08f27b28fa619a3a4449b61b91d8
|
4
|
+
data.tar.gz: 27c812629e2d99e8f4c62fa7961df9b499c5346b1c61092faf487f592356033d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 946e3f2de0137ddaa6e3a2febba2c87244997737c54a10024133de110ca41b8aeddcb66e0437bef5d826e9fe21d4c42701674c3864bd578d24c30c7b1f90e2a9
|
7
|
+
data.tar.gz: f9409de3e2e0ea44e0bb6b6f77cce7e0e8f5a4d95c43fb62af2eb63d11e755d6a8c00b9b9b4d2bbe2729538d0d1038e92468e0a7994d1578b50e05b5227b87f4
|
data/History.md
CHANGED
@@ -1,3 +1,89 @@
|
|
1
|
+
# Version 3.31.0
|
2
|
+
Release date: 2020-01-26
|
3
|
+
|
4
|
+
### Added
|
5
|
+
|
6
|
+
* Support setting range inputs with the selenium driver [Andrew White]
|
7
|
+
* Support setting range inputs with the rack driver
|
8
|
+
* Support drop modifier keys in drag & drop [Elliot Crosby-McCullough]
|
9
|
+
* `enabled_options` and `disabled options` filters for select selector
|
10
|
+
* Support beginless ranges
|
11
|
+
* Optionally allow `all` results to be reloaded when stable - Beta feature - may be removed in
|
12
|
+
future version if problems occur
|
13
|
+
|
14
|
+
### Fixed
|
15
|
+
|
16
|
+
* Fix Ruby 2.7 deprecation notices around keyword arguments. I have tried to do this without
|
17
|
+
any breaking changes, but due to the nature of the 2.7 changes and some selector types accepting
|
18
|
+
Hashes as locators there are a lot of edge cases. If you find any broken cases please report
|
19
|
+
them and I'll see if they're fixable.
|
20
|
+
* Clicking on details/summary element behavior in rack_test driver_
|
21
|
+
|
22
|
+
# Version 3.30.0
|
23
|
+
Release date: 2019-12-24
|
24
|
+
|
25
|
+
### Added
|
26
|
+
|
27
|
+
* Display pending requests when they don't complete in time [Juan Carlos Medina]
|
28
|
+
* :order option in selector queries - set to :reverse to for reverse document order results
|
29
|
+
* Support regexp for :name and :placeholder options in selectors that import filters from
|
30
|
+
_field filter set
|
31
|
+
|
32
|
+
### Fixed
|
33
|
+
|
34
|
+
* Issue around automatic port assignment - Issue #2245
|
35
|
+
* Label selector when label has no id - Issue #2260
|
36
|
+
* Preserve clientX/clientY in Selenium HTML5 drag emulation [Nicolò G.]
|
37
|
+
* table selector using :with_cols option if last specified column matched but others didn't - Issue #2287
|
38
|
+
* Some tests updated for Ruby 2.7 behavior change around keyword args
|
39
|
+
|
40
|
+
# Version 3.29.0
|
41
|
+
Release date: 2019-09-02
|
42
|
+
|
43
|
+
### Added
|
44
|
+
|
45
|
+
* Allow clicking on file input when using the block version of `attach_file` with Chrome and Firefox
|
46
|
+
* Spatial filters (`left_of`, `right_of`, `above`, `below`, `near`)
|
47
|
+
* rack_test driver now supports clicking on details elements to open/close them
|
48
|
+
|
49
|
+
### Fixed
|
50
|
+
|
51
|
+
* rack_test driver correctly determines visibility for open details elements descendants
|
52
|
+
|
53
|
+
### Changed
|
54
|
+
|
55
|
+
* Results will now be lazily evaluated when using JRuby >= 9.2.8.0
|
56
|
+
|
57
|
+
|
58
|
+
# Version 3.28.0
|
59
|
+
Release date: 2019-08-03
|
60
|
+
|
61
|
+
### Added
|
62
|
+
|
63
|
+
* Allow forcing HTML5 or legacy dragging via the `:html5` option to `drag_to` when using Selenium with Chrome or Firefox
|
64
|
+
* Autodetection of drag type interprets not seeing the mousedown event as legacy.
|
65
|
+
* HTML5 form validation `:valid` node filter added to `:field` and `:fillable_field` selectors
|
66
|
+
* When using Capybara registered :puma server - patches Puma 4.0.x to fix SSL connection behavior. Removes
|
67
|
+
default `queue_requests` setting - Issue #2227
|
68
|
+
|
69
|
+
# Version 3.27.0
|
70
|
+
Release date: 2019-07-28
|
71
|
+
|
72
|
+
### Added
|
73
|
+
|
74
|
+
* Allow to use chromedriver/geckodriver native `is_element_displayed` endpoint via Selenium
|
75
|
+
driver `native_displayed` option for performance reasons. Disabled by default due to endpoints
|
76
|
+
currently not handling <details> element descendants visibility correctly.
|
77
|
+
|
78
|
+
### Fixed
|
79
|
+
|
80
|
+
* Ignore negative lookahead/lookbehind regex when performing initial XPath text matching
|
81
|
+
* Reloading of elements found via `ancestor` and `sibling`
|
82
|
+
* Only default puma settings to `queue_requests: false` when using SSL
|
83
|
+
* Visibility of descendants of <details> elements is correctly determined when using rack_test
|
84
|
+
and the selenium driver with Capybara optimized atoms
|
85
|
+
* local/session storage clearance in Chrome when clearing only one of them - Issue #2233
|
86
|
+
|
1
87
|
# Version 3.26.0
|
2
88
|
Release date: 2019-07-15
|
3
89
|
|
data/README.md
CHANGED
@@ -7,8 +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.
|
11
|
-
|
10
|
+
**Note** You are viewing the README for the 3.31.x stable branch of Capybara.
|
12
11
|
|
13
12
|
Capybara helps you test web applications by simulating how a real user would
|
14
13
|
interact with your app. It is agnostic about the driver running your tests and
|
@@ -392,7 +391,7 @@ Capybara supports [Selenium 3.5+
|
|
392
391
|
In order to use Selenium, you'll need to install the `selenium-webdriver` gem,
|
393
392
|
and add it to your Gemfile if you're using bundler.
|
394
393
|
|
395
|
-
Capybara pre-registers a number of named
|
394
|
+
Capybara pre-registers a number of named drivers that use Selenium - they are:
|
396
395
|
|
397
396
|
* :selenium => Selenium driving Firefox
|
398
397
|
* :selenium_headless => Selenium driving Firefox in a headless configuration
|
data/lib/capybara/config.rb
CHANGED
@@ -27,7 +27,9 @@ module Capybara
|
|
27
27
|
attr_writer :reuse_server
|
28
28
|
|
29
29
|
def threadsafe=(bool)
|
30
|
-
|
30
|
+
if (bool != threadsafe) && Session.instance_created?
|
31
|
+
raise 'Threadsafe setting cannot be changed once a session is created'
|
32
|
+
end
|
31
33
|
|
32
34
|
@threadsafe = bool
|
33
35
|
end
|
@@ -59,7 +61,7 @@ module Capybara
|
|
59
61
|
@server = if name.respond_to? :call
|
60
62
|
name
|
61
63
|
elsif options
|
62
|
-
proc { |app, port, host| Capybara.servers[name.to_sym].call(app, port, host, options) }
|
64
|
+
proc { |app, port, host| Capybara.servers[name.to_sym].call(app, port, host, **options) }
|
63
65
|
else
|
64
66
|
Capybara.servers[name.to_sym]
|
65
67
|
end
|
@@ -83,7 +85,9 @@ module Capybara
|
|
83
85
|
|
84
86
|
def deprecate(method, alternate_method, once = false)
|
85
87
|
@deprecation_notified ||= {}
|
86
|
-
|
88
|
+
unless once && @deprecation_notified[method]
|
89
|
+
warn "DEPRECATED: ##{method} is deprecated, please use ##{alternate_method} instead"
|
90
|
+
end
|
87
91
|
@deprecation_notified[method] = true
|
88
92
|
end
|
89
93
|
end
|
data/lib/capybara/driver/node.rb
CHANGED
data/lib/capybara/dsl.rb
CHANGED
@@ -47,8 +47,16 @@ module Capybara
|
|
47
47
|
end
|
48
48
|
|
49
49
|
Session::DSL_METHODS.each do |method|
|
50
|
-
|
51
|
-
|
50
|
+
if RUBY_VERSION >= '2.7'
|
51
|
+
class_eval <<~METHOD, __FILE__, __LINE__ + 1
|
52
|
+
def #{method}(...)
|
53
|
+
page.method("#{method}").call(...)
|
54
|
+
end
|
55
|
+
METHOD
|
56
|
+
else
|
57
|
+
define_method method do |*args, &block|
|
58
|
+
page.send method, *args, &block
|
59
|
+
end
|
52
60
|
end
|
53
61
|
end
|
54
62
|
end
|
data/lib/capybara/helpers.rb
CHANGED
@@ -87,7 +87,9 @@ module Capybara
|
|
87
87
|
end
|
88
88
|
|
89
89
|
def expired?
|
90
|
-
|
90
|
+
if stalled?
|
91
|
+
raise Capybara::FrozenInTime, 'Time appears to be frozen. Capybara does not work with libraries which freeze time, consider using time travelling instead'
|
92
|
+
end
|
91
93
|
|
92
94
|
current - @start >= @expire_in
|
93
95
|
end
|
data/lib/capybara/minitest.rb
CHANGED
@@ -9,38 +9,38 @@ module Capybara
|
|
9
9
|
## Assert text exists
|
10
10
|
#
|
11
11
|
# @!method assert_text
|
12
|
-
#
|
12
|
+
# @see Capybara::Node::Matchers#assert_text
|
13
13
|
|
14
14
|
## Assert text does not exist
|
15
15
|
#
|
16
16
|
# @!method assert_no_text
|
17
|
-
#
|
17
|
+
# @see Capybara::Node::Matchers#assert_no_text
|
18
18
|
|
19
19
|
##
|
20
20
|
# Assertion that page title does match
|
21
21
|
#
|
22
22
|
# @!method assert_title
|
23
|
-
# see
|
23
|
+
# @see Capybara::Node::DocumentMatchers#assert_title
|
24
24
|
|
25
25
|
##
|
26
26
|
# Assertion that page title does not match
|
27
27
|
#
|
28
28
|
# @!method refute_title
|
29
29
|
# @!method assert_no_title
|
30
|
-
# see
|
30
|
+
# @see Capybara::Node::DocumentMatchers#assert_no_title
|
31
31
|
|
32
32
|
##
|
33
33
|
# Assertion that current path matches
|
34
34
|
#
|
35
35
|
# @!method assert_current_path
|
36
|
-
# see
|
36
|
+
# @see Capybara::SessionMatchers#assert_current_path
|
37
37
|
|
38
38
|
##
|
39
39
|
# Assertion that current page does not match
|
40
40
|
#
|
41
41
|
# @!method refute_current_path
|
42
42
|
# @!method assert_no_current_path
|
43
|
-
# see
|
43
|
+
# @see Capybara::SessionMatchers#assert_no_current_path
|
44
44
|
|
45
45
|
%w[text no_text title no_title current_path no_current_path].each do |assertion_name|
|
46
46
|
class_eval <<-ASSERTION, __FILE__, __LINE__ + 1
|
@@ -52,6 +52,7 @@ module Capybara
|
|
52
52
|
raise ::Minitest::Assertion, e.message
|
53
53
|
end
|
54
54
|
ASSERTION
|
55
|
+
ruby2_keywords "assert_#{assertion_name}" if respond_to?(:ruby2_keywords)
|
55
56
|
end
|
56
57
|
|
57
58
|
alias_method :refute_title, :assert_no_title
|
@@ -64,37 +65,37 @@ module Capybara
|
|
64
65
|
## Assert selector exists on page
|
65
66
|
#
|
66
67
|
# @!method assert_selector
|
67
|
-
# see
|
68
|
+
# @see Capybara::Node::Matchers#assert_selector
|
68
69
|
|
69
70
|
## Assert selector does not exist on page
|
70
71
|
#
|
71
72
|
# @!method assert_no_selector
|
72
|
-
# see
|
73
|
+
# @see Capybara::Node::Matchers#assert_no_selector
|
73
74
|
|
74
75
|
## Assert element matches selector
|
75
76
|
#
|
76
77
|
# @!method assert_matches_selector
|
77
|
-
# see
|
78
|
+
# @see Capybara::Node::Matchers#assert_matches_selector
|
78
79
|
|
79
80
|
## Assert element does not match selector
|
80
81
|
#
|
81
82
|
# @!method assert_xpath
|
82
|
-
# see
|
83
|
+
# @see Capybara::Node::Matchers#assert_not_matches_selector
|
83
84
|
|
84
85
|
## Assert element has the provided CSS styles
|
85
86
|
#
|
86
87
|
# @!method assert_matches_style
|
87
|
-
# see
|
88
|
+
# @see Capybara::Node::Matchers#assert_matches_style
|
88
89
|
|
89
90
|
## Assert element has a matching sibling
|
90
91
|
#
|
91
92
|
# @!method assert_sibling
|
92
|
-
# see
|
93
|
+
# @see Capybara::Node::Matchers#assert_sibling
|
93
94
|
|
94
95
|
## Assert element has a matching ancestor
|
95
96
|
#
|
96
97
|
# @!method assert_ancestor
|
97
|
-
# see
|
98
|
+
# @see Capybara::Node::Matchers#assert_ancestor
|
98
99
|
|
99
100
|
%w[selector no_selector matches_style
|
100
101
|
all_of_selectors none_of_selectors any_of_selectors
|
@@ -109,6 +110,7 @@ module Capybara
|
|
109
110
|
raise ::Minitest::Assertion, e.message
|
110
111
|
end
|
111
112
|
ASSERTION
|
113
|
+
ruby2_keywords "assert_#{assertion_name}" if respond_to?(:ruby2_keywords)
|
112
114
|
end
|
113
115
|
|
114
116
|
alias_method :refute_selector, :assert_no_selector
|
@@ -120,14 +122,16 @@ module Capybara
|
|
120
122
|
define_method "assert_#{selector_type}" do |*args, &optional_filter_block|
|
121
123
|
subject, args = determine_subject(args)
|
122
124
|
locator, options = extract_locator(args)
|
123
|
-
assert_selector(subject, selector_type.to_sym, locator, options, &optional_filter_block)
|
125
|
+
assert_selector(subject, selector_type.to_sym, locator, **options, &optional_filter_block)
|
124
126
|
end
|
127
|
+
ruby2_keywords "assert_#{selector_type}" if respond_to?(:ruby2_keywords)
|
125
128
|
|
126
129
|
define_method "assert_no_#{selector_type}" do |*args, &optional_filter_block|
|
127
130
|
subject, args = determine_subject(args)
|
128
131
|
locator, options = extract_locator(args)
|
129
|
-
assert_no_selector(subject, selector_type.to_sym, locator, options, &optional_filter_block)
|
132
|
+
assert_no_selector(subject, selector_type.to_sym, locator, **options, &optional_filter_block)
|
130
133
|
end
|
134
|
+
ruby2_keywords "assert_no_#{selector_type}" if respond_to?(:ruby2_keywords)
|
131
135
|
alias_method "refute_#{selector_type}", "assert_no_#{selector_type}"
|
132
136
|
end
|
133
137
|
|
@@ -135,14 +139,22 @@ module Capybara
|
|
135
139
|
define_method "assert_#{field_type}_field" do |*args, &optional_filter_block|
|
136
140
|
subject, args = determine_subject(args)
|
137
141
|
locator, options = extract_locator(args)
|
138
|
-
assert_selector(subject, :field, locator, options.merge(field_type.to_sym => true), &optional_filter_block)
|
142
|
+
assert_selector(subject, :field, locator, **options.merge(field_type.to_sym => true), &optional_filter_block)
|
139
143
|
end
|
144
|
+
ruby2_keywords "assert_#{field_type}_field" if respond_to?(:ruby2_keywords)
|
140
145
|
|
141
146
|
define_method "assert_no_#{field_type}_field" do |*args, &optional_filter_block|
|
142
147
|
subject, args = determine_subject(args)
|
143
148
|
locator, options = extract_locator(args)
|
144
|
-
assert_no_selector(
|
149
|
+
assert_no_selector(
|
150
|
+
subject,
|
151
|
+
:field,
|
152
|
+
locator,
|
153
|
+
**options.merge(field_type.to_sym => true),
|
154
|
+
&optional_filter_block
|
155
|
+
)
|
145
156
|
end
|
157
|
+
ruby2_keywords "assert_no_#{field_type}_field" if respond_to?(:ruby2_keywords)
|
146
158
|
alias_method "refute_#{field_type}_field", "assert_no_#{field_type}_field"
|
147
159
|
end
|
148
160
|
|
@@ -151,11 +163,13 @@ module Capybara
|
|
151
163
|
subject, args = determine_subject(args)
|
152
164
|
assert_matches_selector(subject, selector_type.to_sym, *args, &optional_filter_block)
|
153
165
|
end
|
166
|
+
ruby2_keywords "assert_matches_#{selector_type}" if respond_to?(:ruby2_keywords)
|
154
167
|
|
155
168
|
define_method "assert_not_matches_#{selector_type}" do |*args, &optional_filter_block|
|
156
169
|
subject, args = determine_subject(args)
|
157
170
|
assert_not_matches_selector(subject, selector_type.to_sym, *args, &optional_filter_block)
|
158
171
|
end
|
172
|
+
ruby2_keywords "assert_not_matches_#{selector_type}" if respond_to?(:ruby2_keywords)
|
159
173
|
alias_method "refute_matches_#{selector_type}", "assert_not_matches_#{selector_type}"
|
160
174
|
end
|
161
175
|
|
@@ -163,72 +177,72 @@ module Capybara
|
|
163
177
|
# Assertion that there is xpath
|
164
178
|
#
|
165
179
|
# @!method assert_xpath
|
166
|
-
# see
|
180
|
+
# @see Capybara::Node::Matchers#has_xpath?
|
167
181
|
|
168
182
|
##
|
169
183
|
# Assertion that there is no xpath
|
170
184
|
#
|
171
185
|
# @!method refute_xpath
|
172
186
|
# @!method assert_no_xpath
|
173
|
-
# see
|
187
|
+
# @see Capybara::Node::Matchers#has_no_xpath?
|
174
188
|
|
175
189
|
##
|
176
190
|
# Assertion that there is css
|
177
191
|
#
|
178
192
|
# @!method assert_css
|
179
|
-
# see
|
193
|
+
# @see Capybara::Node::Matchers#has_css?
|
180
194
|
|
181
195
|
##
|
182
196
|
# Assertion that there is no css
|
183
197
|
#
|
184
198
|
# @!method refute_css
|
185
199
|
# @!method assert_no_css
|
186
|
-
# see
|
200
|
+
# @see Capybara::Node::Matchers#has_no_css?
|
187
201
|
|
188
202
|
##
|
189
203
|
# Assertion that there is link
|
190
204
|
#
|
191
205
|
# @!method assert_link
|
192
|
-
# see
|
206
|
+
# @see Capybara::Node::Matchers#has_link?
|
193
207
|
|
194
208
|
##
|
195
209
|
# Assertion that there is no link
|
196
210
|
#
|
197
211
|
# @!method assert_no_link
|
198
212
|
# @!method refute_link
|
199
|
-
#
|
213
|
+
# @see Capybara::Node::Matchers#has_no_link?
|
200
214
|
|
201
215
|
##
|
202
216
|
# Assertion that there is button
|
203
217
|
#
|
204
218
|
# @!method assert_button
|
205
|
-
# see
|
219
|
+
# @see Capybara::Node::Matchers#has_button?
|
206
220
|
|
207
221
|
##
|
208
222
|
# Assertion that there is no button
|
209
223
|
#
|
210
224
|
# @!method refute_button
|
211
225
|
# @!method assert_no_button
|
212
|
-
# see
|
226
|
+
# @see Capybara::Node::Matchers#has_no_button?
|
213
227
|
|
214
228
|
##
|
215
229
|
# Assertion that there is field
|
216
230
|
#
|
217
231
|
# @!method assert_field
|
218
|
-
# see
|
232
|
+
# @see Capybara::Node::Matchers#has_field?
|
219
233
|
|
220
234
|
##
|
221
235
|
# Assertion that there is no field
|
222
236
|
#
|
223
237
|
# @!method refute_field
|
224
238
|
# @!method assert_no_field
|
225
|
-
# see
|
239
|
+
# @see Capybara::Node::Matchers#has_no_field?
|
226
240
|
|
227
241
|
##
|
228
242
|
# Assertion that there is checked_field
|
229
243
|
#
|
230
244
|
# @!method assert_checked_field
|
231
|
-
# see
|
245
|
+
# @see Capybara::Node::Matchers#has_checked_field?
|
232
246
|
|
233
247
|
##
|
234
248
|
# Assertion that there is no checked_field
|
@@ -240,7 +254,7 @@ module Capybara
|
|
240
254
|
# Assertion that there is unchecked_field
|
241
255
|
#
|
242
256
|
# @!method assert_unchecked_field
|
243
|
-
# see
|
257
|
+
# @see Capybara::Node::Matchers#has_unchecked_field?
|
244
258
|
|
245
259
|
##
|
246
260
|
# Assertion that there is no unchecked_field
|
@@ -252,27 +266,27 @@ module Capybara
|
|
252
266
|
# Assertion that there is select
|
253
267
|
#
|
254
268
|
# @!method assert_select
|
255
|
-
# see
|
269
|
+
# @see Capybara::Node::Matchers#has_select?
|
256
270
|
|
257
271
|
##
|
258
272
|
# Assertion that there is no select
|
259
273
|
#
|
260
274
|
# @!method refute_select
|
261
275
|
# @!method assert_no_select
|
262
|
-
# see
|
276
|
+
# @see Capybara::Node::Matchers#has_no_select?
|
263
277
|
|
264
278
|
##
|
265
279
|
# Assertion that there is table
|
266
280
|
#
|
267
281
|
# @!method assert_table
|
268
|
-
# see
|
282
|
+
# @see Capybara::Node::Matchers#has_table?
|
269
283
|
|
270
284
|
##
|
271
285
|
# Assertion that there is no table
|
272
286
|
#
|
273
287
|
# @!method refute_table
|
274
288
|
# @!method assert_no_table
|
275
|
-
# see
|
289
|
+
# @see Capybara::Node::Matchers#has_no_table?
|
276
290
|
|
277
291
|
private
|
278
292
|
|