capybara 3.31.0 → 3.32.1
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 +22 -0
 - data/README.md +1 -1
 - data/lib/capybara/minitest.rb +213 -138
 - data/lib/capybara/minitest/spec.rb +153 -97
 - data/lib/capybara/node/element.rb +2 -0
 - data/lib/capybara/rack_test/browser.rb +3 -1
 - data/lib/capybara/result.rb +1 -0
 - data/lib/capybara/rspec/matcher_proxies.rb +4 -4
 - data/lib/capybara/selenium/atoms/getAttribute.min.js +1 -1
 - data/lib/capybara/selenium/atoms/src/getAttribute.js +1 -1
 - data/lib/capybara/selenium/driver.rb +5 -4
 - data/lib/capybara/selenium/driver_specializations/firefox_driver.rb +2 -2
 - data/lib/capybara/selenium/node.rb +68 -9
 - data/lib/capybara/selenium/nodes/chrome_node.rb +0 -9
 - data/lib/capybara/selenium/nodes/firefox_node.rb +1 -1
 - data/lib/capybara/selenium/patches/action_pauser.rb +26 -0
 - data/lib/capybara/spec/public/test.js +11 -0
 - data/lib/capybara/spec/session/fill_in_spec.rb +9 -0
 - data/lib/capybara/spec/session/find_spec.rb +11 -8
 - data/lib/capybara/spec/session/has_css_spec.rb +9 -6
 - data/lib/capybara/spec/session/node_spec.rb +48 -21
 - data/lib/capybara/spec/session/window/window_spec.rb +7 -7
 - data/lib/capybara/spec/spec_helper.rb +1 -2
 - data/lib/capybara/spec/views/form.erb +5 -0
 - data/lib/capybara/spec/views/with_html.erb +2 -2
 - data/lib/capybara/version.rb +1 -1
 - data/spec/rack_test_spec.rb +12 -0
 - data/spec/regexp_dissassembler_spec.rb +0 -4
 - data/spec/result_spec.rb +37 -14
 - data/spec/selenium_spec_chrome.rb +4 -0
 - data/spec/selenium_spec_chrome_remote.rb +2 -0
 - data/spec/shared_selenium_node.rb +18 -0
 - data/spec/shared_selenium_session.rb +15 -6
 - metadata +3 -2
 
| 
         @@ -5,192 +5,248 @@ require 'minitest/spec' 
     | 
|
| 
       5 
5 
     | 
    
         
             
            module Capybara
         
     | 
| 
       6 
6 
     | 
    
         
             
              module Minitest
         
     | 
| 
       7 
7 
     | 
    
         
             
                module Expectations
         
     | 
| 
       8 
     | 
    
         
            -
                   
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
                   
     | 
| 
      
 8 
     | 
    
         
            +
                  ##
         
     | 
| 
      
 9 
     | 
    
         
            +
                  # Expectation that there is an ancestor
         
     | 
| 
      
 10 
     | 
    
         
            +
                  #
         
     | 
| 
      
 11 
     | 
    
         
            +
                  # @!method must_have_ancestor
         
     | 
| 
      
 12 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#has_ancestor?}
         
     | 
| 
       12 
13 
     | 
    
         | 
| 
       13 
     | 
    
         
            -
                   
     | 
| 
       14 
     | 
    
         
            -
                   
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
       18 
     | 
    
         
            -
                      end + [%w[assert_all_of_selectors must_have_all_of_selectors],
         
     | 
| 
       19 
     | 
    
         
            -
                             %w[assert_none_of_selectors must_have_none_of_selectors],
         
     | 
| 
       20 
     | 
    
         
            -
                             %w[assert_any_of_selectors must_have_any_of_selectors],
         
     | 
| 
       21 
     | 
    
         
            -
                             %w[assert_matches_style must_match_style]] +
         
     | 
| 
       22 
     | 
    
         
            -
                  %w[selector xpath css].flat_map do |assertion|
         
     | 
| 
       23 
     | 
    
         
            -
                    [%W[assert_matches_#{assertion} must_match_#{assertion}],
         
     | 
| 
       24 
     | 
    
         
            -
                     %W[refute_matches_#{assertion} wont_match_#{assertion}]]
         
     | 
| 
       25 
     | 
    
         
            -
                  end).each do |(meth, new_name)|
         
     | 
| 
       26 
     | 
    
         
            -
                    class_eval <<-ASSERTION, __FILE__, __LINE__ + 1
         
     | 
| 
       27 
     | 
    
         
            -
                      def #{new_name} *args, &block
         
     | 
| 
       28 
     | 
    
         
            -
                        ::Minitest::Expectation.new(self, ::Minitest::Spec.current).#{new_name}(*args, &block)
         
     | 
| 
       29 
     | 
    
         
            -
                      end
         
     | 
| 
       30 
     | 
    
         
            -
                    ASSERTION
         
     | 
| 
      
 14 
     | 
    
         
            +
                  ##
         
     | 
| 
      
 15 
     | 
    
         
            +
                  # Expectation that there is button
         
     | 
| 
      
 16 
     | 
    
         
            +
                  #
         
     | 
| 
      
 17 
     | 
    
         
            +
                  # @!method must_have_button
         
     | 
| 
      
 18 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#has_button?}
         
     | 
| 
       31 
19 
     | 
    
         | 
| 
       32 
     | 
    
         
            -
             
     | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
       35 
     | 
    
         
            -
             
     | 
| 
       36 
     | 
    
         
            -
             
     | 
| 
       37 
     | 
    
         
            -
                  end
         
     | 
| 
       38 
     | 
    
         
            -
                  # rubocop:enable Style/MultilineBlockChain
         
     | 
| 
      
 20 
     | 
    
         
            +
                  ##
         
     | 
| 
      
 21 
     | 
    
         
            +
                  # Expectation that there is no button
         
     | 
| 
      
 22 
     | 
    
         
            +
                  #
         
     | 
| 
      
 23 
     | 
    
         
            +
                  # @!method wont_have_button
         
     | 
| 
      
 24 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#has_no_button?}
         
     | 
| 
       39 
25 
     | 
    
         | 
| 
       40 
26 
     | 
    
         
             
                  ##
         
     | 
| 
       41 
     | 
    
         
            -
                  #  
     | 
| 
       42 
     | 
    
         
            -
                   
     | 
| 
       43 
     | 
    
         
            -
             
     | 
| 
       44 
     | 
    
         
            -
             
     | 
| 
       45 
     | 
    
         
            -
                  end
         
     | 
| 
      
 27 
     | 
    
         
            +
                  # Expectation that there is checked_field
         
     | 
| 
      
 28 
     | 
    
         
            +
                  #
         
     | 
| 
      
 29 
     | 
    
         
            +
                  # @!method must_have_checked_field
         
     | 
| 
      
 30 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#has_checked_field?}
         
     | 
| 
       46 
31 
     | 
    
         | 
| 
       47 
32 
     | 
    
         
             
                  ##
         
     | 
| 
       48 
     | 
    
         
            -
                  # Expectation that there is  
     | 
| 
      
 33 
     | 
    
         
            +
                  # Expectation that there is no checked_field
         
     | 
| 
       49 
34 
     | 
    
         
             
                  #
         
     | 
| 
       50 
     | 
    
         
            -
                  # @!method  
     | 
| 
       51 
     | 
    
         
            -
                  #    
     | 
| 
      
 35 
     | 
    
         
            +
                  # @!method wont_have_checked_field
         
     | 
| 
      
 36 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#has_no_checked_field?}
         
     | 
| 
       52 
37 
     | 
    
         | 
| 
       53 
38 
     | 
    
         
             
                  ##
         
     | 
| 
       54 
     | 
    
         
            -
                  # Expectation that there is  
     | 
| 
      
 39 
     | 
    
         
            +
                  # Expectation that there is unchecked_field
         
     | 
| 
       55 
40 
     | 
    
         
             
                  #
         
     | 
| 
       56 
     | 
    
         
            -
                  # @!method  
     | 
| 
       57 
     | 
    
         
            -
                  #    
     | 
| 
      
 41 
     | 
    
         
            +
                  # @!method must_have_unchecked_field
         
     | 
| 
      
 42 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#has_unchecked_field?}
         
     | 
| 
       58 
43 
     | 
    
         | 
| 
       59 
44 
     | 
    
         
             
                  ##
         
     | 
| 
       60 
     | 
    
         
            -
                  # Expectation that there is  
     | 
| 
      
 45 
     | 
    
         
            +
                  # Expectation that there is no unchecked_field
         
     | 
| 
       61 
46 
     | 
    
         
             
                  #
         
     | 
| 
       62 
     | 
    
         
            -
                  # @!method  
     | 
| 
       63 
     | 
    
         
            -
                  #    
     | 
| 
      
 47 
     | 
    
         
            +
                  # @!method wont_have_unchecked_field
         
     | 
| 
      
 48 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#has_no_unchecked_field?}
         
     | 
| 
       64 
49 
     | 
    
         | 
| 
       65 
50 
     | 
    
         
             
                  ##
         
     | 
| 
       66 
     | 
    
         
            -
                  # Expectation that  
     | 
| 
      
 51 
     | 
    
         
            +
                  # Expectation that page content does match
         
     | 
| 
       67 
52 
     | 
    
         
             
                  #
         
     | 
| 
       68 
     | 
    
         
            -
                  # @!method  
     | 
| 
       69 
     | 
    
         
            -
                  #    
     | 
| 
      
 53 
     | 
    
         
            +
                  # @!method must_have_content
         
     | 
| 
      
 54 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#has_content?}
         
     | 
| 
       70 
55 
     | 
    
         | 
| 
       71 
56 
     | 
    
         
             
                  ##
         
     | 
| 
       72 
     | 
    
         
            -
                  # Expectation that  
     | 
| 
      
 57 
     | 
    
         
            +
                  # Expectation that page content does not match
         
     | 
| 
       73 
58 
     | 
    
         
             
                  #
         
     | 
| 
       74 
     | 
    
         
            -
                  # @!method  
     | 
| 
       75 
     | 
    
         
            -
                  #    
     | 
| 
      
 59 
     | 
    
         
            +
                  # @!method wont_have_content
         
     | 
| 
      
 60 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#has_no_content?}
         
     | 
| 
       76 
61 
     | 
    
         | 
| 
       77 
62 
     | 
    
         
             
                  ##
         
     | 
| 
       78 
     | 
    
         
            -
                  # Expectation that there is  
     | 
| 
      
 63 
     | 
    
         
            +
                  # Expectation that there is css
         
     | 
| 
       79 
64 
     | 
    
         
             
                  #
         
     | 
| 
       80 
     | 
    
         
            -
                  # @!method  
     | 
| 
       81 
     | 
    
         
            -
                  #  
     | 
| 
      
 65 
     | 
    
         
            +
                  # @!method must_have_css
         
     | 
| 
      
 66 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#has_css?}
         
     | 
| 
       82 
67 
     | 
    
         | 
| 
       83 
68 
     | 
    
         
             
                  ##
         
     | 
| 
       84 
     | 
    
         
            -
                  # Expectation that there is  
     | 
| 
      
 69 
     | 
    
         
            +
                  # Expectation that there is no css
         
     | 
| 
       85 
70 
     | 
    
         
             
                  #
         
     | 
| 
       86 
     | 
    
         
            -
                  # @!method  
     | 
| 
       87 
     | 
    
         
            -
                  #    
     | 
| 
      
 71 
     | 
    
         
            +
                  # @!method wont_have_css
         
     | 
| 
      
 72 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#has_no_css?}
         
     | 
| 
       88 
73 
     | 
    
         | 
| 
       89 
74 
     | 
    
         
             
                  ##
         
     | 
| 
       90 
     | 
    
         
            -
                  # Expectation that  
     | 
| 
      
 75 
     | 
    
         
            +
                  # Expectation that current path matches
         
     | 
| 
       91 
76 
     | 
    
         
             
                  #
         
     | 
| 
       92 
     | 
    
         
            -
                  # @!method  
     | 
| 
       93 
     | 
    
         
            -
                  #    
     | 
| 
      
 77 
     | 
    
         
            +
                  # @!method must_have_current_path
         
     | 
| 
      
 78 
     | 
    
         
            +
                  #   See {Capybara::SessionMatchers#has_current_path?}
         
     | 
| 
      
 79 
     | 
    
         
            +
             
     | 
| 
      
 80 
     | 
    
         
            +
                  ##
         
     | 
| 
      
 81 
     | 
    
         
            +
                  # Expectation that current page does not match
         
     | 
| 
      
 82 
     | 
    
         
            +
                  #
         
     | 
| 
      
 83 
     | 
    
         
            +
                  # @!method wont_have_current_path
         
     | 
| 
      
 84 
     | 
    
         
            +
                  #   See {Capybara::SessionMatchers#has_no_current_path?}
         
     | 
| 
       94 
85 
     | 
    
         | 
| 
       95 
86 
     | 
    
         
             
                  ##
         
     | 
| 
       96 
87 
     | 
    
         
             
                  # Expectation that there is field
         
     | 
| 
       97 
88 
     | 
    
         
             
                  #
         
     | 
| 
       98 
89 
     | 
    
         
             
                  # @!method must_have_field
         
     | 
| 
       99 
     | 
    
         
            -
                  #    
     | 
| 
      
 90 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#has_field?}
         
     | 
| 
       100 
91 
     | 
    
         | 
| 
       101 
92 
     | 
    
         
             
                  ##
         
     | 
| 
       102 
93 
     | 
    
         
             
                  # Expectation that there is no field
         
     | 
| 
       103 
94 
     | 
    
         
             
                  #
         
     | 
| 
       104 
95 
     | 
    
         
             
                  # @!method wont_have_field
         
     | 
| 
       105 
     | 
    
         
            -
                  #    
     | 
| 
      
 96 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#has_no_field?}
         
     | 
| 
       106 
97 
     | 
    
         | 
| 
       107 
98 
     | 
    
         
             
                  ##
         
     | 
| 
       108 
     | 
    
         
            -
                  # Expectation that there is  
     | 
| 
      
 99 
     | 
    
         
            +
                  # Expectation that there is link
         
     | 
| 
       109 
100 
     | 
    
         
             
                  #
         
     | 
| 
       110 
     | 
    
         
            -
                  # @!method  
     | 
| 
       111 
     | 
    
         
            -
                  #    
     | 
| 
      
 101 
     | 
    
         
            +
                  # @!method must_have_link
         
     | 
| 
      
 102 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#has_link?}
         
     | 
| 
       112 
103 
     | 
    
         | 
| 
       113 
104 
     | 
    
         
             
                  ##
         
     | 
| 
       114 
     | 
    
         
            -
                  # Expectation that there is no  
     | 
| 
      
 105 
     | 
    
         
            +
                  # Expectation that there is no link
         
     | 
| 
       115 
106 
     | 
    
         
             
                  #
         
     | 
| 
       116 
     | 
    
         
            -
                  # @!method  
     | 
| 
      
 107 
     | 
    
         
            +
                  # @!method wont_have_link
         
     | 
| 
      
 108 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#has_no_link?}
         
     | 
| 
       117 
109 
     | 
    
         | 
| 
       118 
110 
     | 
    
         
             
                  ##
         
     | 
| 
       119 
     | 
    
         
            -
                  # Expectation that  
     | 
| 
      
 111 
     | 
    
         
            +
                  # Expectation that page text does match
         
     | 
| 
       120 
112 
     | 
    
         
             
                  #
         
     | 
| 
       121 
     | 
    
         
            -
                  # @!method  
     | 
| 
       122 
     | 
    
         
            -
                  #    
     | 
| 
      
 113 
     | 
    
         
            +
                  # @!method must_have_text
         
     | 
| 
      
 114 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#has_text?}
         
     | 
| 
       123 
115 
     | 
    
         | 
| 
       124 
116 
     | 
    
         
             
                  ##
         
     | 
| 
       125 
     | 
    
         
            -
                  # Expectation that  
     | 
| 
      
 117 
     | 
    
         
            +
                  # Expectation that page text does not match
         
     | 
| 
      
 118 
     | 
    
         
            +
                  #
         
     | 
| 
      
 119 
     | 
    
         
            +
                  # @!method wont_have_text
         
     | 
| 
      
 120 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#has_no_text?}
         
     | 
| 
      
 121 
     | 
    
         
            +
             
     | 
| 
      
 122 
     | 
    
         
            +
                  ##
         
     | 
| 
      
 123 
     | 
    
         
            +
                  # Expectation that page title does match
         
     | 
| 
      
 124 
     | 
    
         
            +
                  #
         
     | 
| 
      
 125 
     | 
    
         
            +
                  # @!method must_have_title
         
     | 
| 
      
 126 
     | 
    
         
            +
                  #   See {Capybara::Node::DocumentMatchers#has_title?}
         
     | 
| 
      
 127 
     | 
    
         
            +
             
     | 
| 
      
 128 
     | 
    
         
            +
                  ##
         
     | 
| 
      
 129 
     | 
    
         
            +
                  # Expectation that page title does not match
         
     | 
| 
       126 
130 
     | 
    
         
             
                  #
         
     | 
| 
       127 
     | 
    
         
            -
                  # @!method  
     | 
| 
      
 131 
     | 
    
         
            +
                  # @!method wont_have_title
         
     | 
| 
      
 132 
     | 
    
         
            +
                  #   See {Capybara::Node::DocumentMatchers#has_no_title?}
         
     | 
| 
       128 
133 
     | 
    
         | 
| 
       129 
134 
     | 
    
         
             
                  ##
         
     | 
| 
       130 
135 
     | 
    
         
             
                  # Expectation that there is select
         
     | 
| 
       131 
136 
     | 
    
         
             
                  #
         
     | 
| 
       132 
137 
     | 
    
         
             
                  # @!method must_have_select
         
     | 
| 
       133 
     | 
    
         
            -
                  #    
     | 
| 
      
 138 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#has_select?}
         
     | 
| 
       134 
139 
     | 
    
         | 
| 
       135 
140 
     | 
    
         
             
                  ##
         
     | 
| 
       136 
141 
     | 
    
         
             
                  # Expectation that there is no select
         
     | 
| 
       137 
142 
     | 
    
         
             
                  #
         
     | 
| 
       138 
143 
     | 
    
         
             
                  # @!method wont_have_select
         
     | 
| 
       139 
     | 
    
         
            -
                  #    
     | 
| 
      
 144 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#has_no_select?}
         
     | 
| 
       140 
145 
     | 
    
         | 
| 
       141 
146 
     | 
    
         
             
                  ##
         
     | 
| 
       142 
     | 
    
         
            -
                  # Expectation that there is  
     | 
| 
      
 147 
     | 
    
         
            +
                  # Expectation that there is a selector
         
     | 
| 
       143 
148 
     | 
    
         
             
                  #
         
     | 
| 
       144 
     | 
    
         
            -
                  # @!method  
     | 
| 
       145 
     | 
    
         
            -
                  #    
     | 
| 
      
 149 
     | 
    
         
            +
                  # @!method must_have_selector
         
     | 
| 
      
 150 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#has_selector?}
         
     | 
| 
       146 
151 
     | 
    
         | 
| 
       147 
152 
     | 
    
         
             
                  ##
         
     | 
| 
       148 
     | 
    
         
            -
                  # Expectation that there is no  
     | 
| 
      
 153 
     | 
    
         
            +
                  # Expectation that there is no selector
         
     | 
| 
       149 
154 
     | 
    
         
             
                  #
         
     | 
| 
       150 
     | 
    
         
            -
                  # @!method  
     | 
| 
       151 
     | 
    
         
            -
                  #    
     | 
| 
      
 155 
     | 
    
         
            +
                  # @!method wont_have_selector
         
     | 
| 
      
 156 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#has_no_selector?}
         
     | 
| 
       152 
157 
     | 
    
         | 
| 
       153 
158 
     | 
    
         
             
                  ##
         
     | 
| 
       154 
     | 
    
         
            -
                  # Expectation that  
     | 
| 
      
 159 
     | 
    
         
            +
                  # Expectation that all of the provided selectors are present
         
     | 
| 
       155 
160 
     | 
    
         
             
                  #
         
     | 
| 
       156 
     | 
    
         
            -
                  # @!method  
     | 
| 
       157 
     | 
    
         
            -
                  #    
     | 
| 
      
 161 
     | 
    
         
            +
                  # @!method must_have_all_of_selectors
         
     | 
| 
      
 162 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#assert_all_of_selectors}
         
     | 
| 
       158 
163 
     | 
    
         | 
| 
       159 
164 
     | 
    
         
             
                  ##
         
     | 
| 
       160 
     | 
    
         
            -
                  # Expectation that  
     | 
| 
      
 165 
     | 
    
         
            +
                  # Expectation that none of the provided selectors are present
         
     | 
| 
       161 
166 
     | 
    
         
             
                  #
         
     | 
| 
       162 
     | 
    
         
            -
                  # @!method  
     | 
| 
       163 
     | 
    
         
            -
                  #    
     | 
| 
      
 167 
     | 
    
         
            +
                  # @!method must_have_none_of_selectors
         
     | 
| 
      
 168 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#assert_none_of_selectors}
         
     | 
| 
       164 
169 
     | 
    
         | 
| 
       165 
170 
     | 
    
         
             
                  ##
         
     | 
| 
       166 
     | 
    
         
            -
                  # Expectation that  
     | 
| 
      
 171 
     | 
    
         
            +
                  # Expectation that any of the provided selectors are present
         
     | 
| 
       167 
172 
     | 
    
         
             
                  #
         
     | 
| 
       168 
     | 
    
         
            -
                  # @!method  
     | 
| 
       169 
     | 
    
         
            -
                  #    
     | 
| 
      
 173 
     | 
    
         
            +
                  # @!method must_have_any_of_selectors
         
     | 
| 
      
 174 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#assert_any_of_selectors}
         
     | 
| 
       170 
175 
     | 
    
         | 
| 
       171 
176 
     | 
    
         
             
                  ##
         
     | 
| 
       172 
     | 
    
         
            -
                  # Expectation that  
     | 
| 
      
 177 
     | 
    
         
            +
                  # Expectation that there is a sibling
         
     | 
| 
       173 
178 
     | 
    
         
             
                  #
         
     | 
| 
       174 
     | 
    
         
            -
                  # @!method  
     | 
| 
       175 
     | 
    
         
            -
                  #    
     | 
| 
      
 179 
     | 
    
         
            +
                  # @!method must_have_sibling
         
     | 
| 
      
 180 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#has_sibling?}
         
     | 
| 
       176 
181 
     | 
    
         | 
| 
       177 
182 
     | 
    
         
             
                  ##
         
     | 
| 
       178 
183 
     | 
    
         
             
                  # Expectation that element has style
         
     | 
| 
       179 
184 
     | 
    
         
             
                  #
         
     | 
| 
       180 
185 
     | 
    
         
             
                  # @!method must_match_style
         
     | 
| 
       181 
     | 
    
         
            -
                  #    
     | 
| 
      
 186 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#matches_style?}
         
     | 
| 
       182 
187 
     | 
    
         | 
| 
       183 
188 
     | 
    
         
             
                  ##
         
     | 
| 
       184 
     | 
    
         
            -
                  # Expectation that there is  
     | 
| 
      
 189 
     | 
    
         
            +
                  # Expectation that there is table
         
     | 
| 
       185 
190 
     | 
    
         
             
                  #
         
     | 
| 
       186 
     | 
    
         
            -
                  # @!method  
     | 
| 
       187 
     | 
    
         
            -
                  #    
     | 
| 
      
 191 
     | 
    
         
            +
                  # @!method must_have_table
         
     | 
| 
      
 192 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#has_table?}
         
     | 
| 
       188 
193 
     | 
    
         | 
| 
       189 
194 
     | 
    
         
             
                  ##
         
     | 
| 
       190 
     | 
    
         
            -
                  # Expectation that there is  
     | 
| 
      
 195 
     | 
    
         
            +
                  # Expectation that there is no table
         
     | 
| 
       191 
196 
     | 
    
         
             
                  #
         
     | 
| 
       192 
     | 
    
         
            -
                  # @!method  
     | 
| 
       193 
     | 
    
         
            -
                  #    
     | 
| 
      
 197 
     | 
    
         
            +
                  # @!method wont_have_table
         
     | 
| 
      
 198 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#has_no_table?}
         
     | 
| 
      
 199 
     | 
    
         
            +
             
     | 
| 
      
 200 
     | 
    
         
            +
                  ##
         
     | 
| 
      
 201 
     | 
    
         
            +
                  # Expectation that there is xpath
         
     | 
| 
      
 202 
     | 
    
         
            +
                  #
         
     | 
| 
      
 203 
     | 
    
         
            +
                  # @!method must_have_xpath
         
     | 
| 
      
 204 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#has_xpath?}
         
     | 
| 
      
 205 
     | 
    
         
            +
             
     | 
| 
      
 206 
     | 
    
         
            +
                  ##
         
     | 
| 
      
 207 
     | 
    
         
            +
                  # Expectation that there is no xpath
         
     | 
| 
      
 208 
     | 
    
         
            +
                  #
         
     | 
| 
      
 209 
     | 
    
         
            +
                  # @!method wont_have_xpath
         
     | 
| 
      
 210 
     | 
    
         
            +
                  #   See {Capybara::Node::Matchers#has_no_xpath?}
         
     | 
| 
      
 211 
     | 
    
         
            +
             
     | 
| 
      
 212 
     | 
    
         
            +
                  %w[text content title current_path].each do |assertion|
         
     | 
| 
      
 213 
     | 
    
         
            +
                    infect_an_assertion "assert_#{assertion}", "must_have_#{assertion}", :reverse
         
     | 
| 
      
 214 
     | 
    
         
            +
                    infect_an_assertion "refute_#{assertion}", "wont_have_#{assertion}", :reverse
         
     | 
| 
      
 215 
     | 
    
         
            +
                  end
         
     | 
| 
      
 216 
     | 
    
         
            +
             
     | 
| 
      
 217 
     | 
    
         
            +
                  # rubocop:disable Style/MultilineBlockChain
         
     | 
| 
      
 218 
     | 
    
         
            +
                  (%w[selector xpath css link button field select table checked_field unchecked_field
         
     | 
| 
      
 219 
     | 
    
         
            +
                      ancestor sibling].flat_map do |assertion|
         
     | 
| 
      
 220 
     | 
    
         
            +
                        [%W[assert_#{assertion} must_have_#{assertion}],
         
     | 
| 
      
 221 
     | 
    
         
            +
                         %W[refute_#{assertion} wont_have_#{assertion}]]
         
     | 
| 
      
 222 
     | 
    
         
            +
                      end + [%w[assert_all_of_selectors must_have_all_of_selectors],
         
     | 
| 
      
 223 
     | 
    
         
            +
                             %w[assert_none_of_selectors must_have_none_of_selectors],
         
     | 
| 
      
 224 
     | 
    
         
            +
                             %w[assert_any_of_selectors must_have_any_of_selectors],
         
     | 
| 
      
 225 
     | 
    
         
            +
                             %w[assert_matches_style must_match_style]] +
         
     | 
| 
      
 226 
     | 
    
         
            +
                  %w[selector xpath css].flat_map do |assertion|
         
     | 
| 
      
 227 
     | 
    
         
            +
                    [%W[assert_matches_#{assertion} must_match_#{assertion}],
         
     | 
| 
      
 228 
     | 
    
         
            +
                     %W[refute_matches_#{assertion} wont_match_#{assertion}]]
         
     | 
| 
      
 229 
     | 
    
         
            +
                  end).each do |(meth, new_name)|
         
     | 
| 
      
 230 
     | 
    
         
            +
                    class_eval <<-ASSERTION, __FILE__, __LINE__ + 1
         
     | 
| 
      
 231 
     | 
    
         
            +
                      def #{new_name} *args, &block
         
     | 
| 
      
 232 
     | 
    
         
            +
                        ::Minitest::Expectation.new(self, ::Minitest::Spec.current).#{new_name}(*args, &block)
         
     | 
| 
      
 233 
     | 
    
         
            +
                      end
         
     | 
| 
      
 234 
     | 
    
         
            +
                    ASSERTION
         
     | 
| 
      
 235 
     | 
    
         
            +
             
     | 
| 
      
 236 
     | 
    
         
            +
                    ::Minitest::Expectation.class_eval <<-ASSERTION, __FILE__, __LINE__ + 1
         
     | 
| 
      
 237 
     | 
    
         
            +
                      def #{new_name} *args, &block
         
     | 
| 
      
 238 
     | 
    
         
            +
                        ctx.#{meth}(target, *args, &block)
         
     | 
| 
      
 239 
     | 
    
         
            +
                      end
         
     | 
| 
      
 240 
     | 
    
         
            +
                    ASSERTION
         
     | 
| 
      
 241 
     | 
    
         
            +
                  end
         
     | 
| 
      
 242 
     | 
    
         
            +
                  # rubocop:enable Style/MultilineBlockChain
         
     | 
| 
      
 243 
     | 
    
         
            +
             
     | 
| 
      
 244 
     | 
    
         
            +
                  ##
         
     | 
| 
      
 245 
     | 
    
         
            +
                  # @deprecated
         
     | 
| 
      
 246 
     | 
    
         
            +
                  def must_have_style(*args, &block)
         
     | 
| 
      
 247 
     | 
    
         
            +
                    warn 'must_have_style is deprecated, please use must_match_style'
         
     | 
| 
      
 248 
     | 
    
         
            +
                    must_match_style(*args, &block)
         
     | 
| 
      
 249 
     | 
    
         
            +
                  end
         
     | 
| 
       194 
250 
     | 
    
         
             
                end
         
     | 
| 
       195 
251 
     | 
    
         
             
              end
         
     | 
| 
       196 
252 
     | 
    
         
             
            end
         
     | 
| 
         @@ -165,6 +165,7 @@ module Capybara 
     | 
|
| 
       165 
165 
     | 
    
         
             
                  #       offset will be from the element center, otherwise it will be from the top left corner of the element
         
     | 
| 
       166 
166 
     | 
    
         
             
                  #     @option options [Integer] y  Y coordinate to offset the click location. If {Capybara.configure w3c_click_offset} is `true` the
         
     | 
| 
       167 
167 
     | 
    
         
             
                  #       offset will be from the element center, otherwise it will be from the top left corner of the element
         
     | 
| 
      
 168 
     | 
    
         
            +
                  # @option options [Float] delay  Delay between the mouse down and mouse up events in seconds (0)
         
     | 
| 
       168 
169 
     | 
    
         
             
                  # @return [Capybara::Node::Element]  The element
         
     | 
| 
       169 
170 
     | 
    
         
             
                  def click(*keys, **options)
         
     | 
| 
       170 
171 
     | 
    
         
             
                    perform_click_action(keys, **options) do |k, opts|
         
     | 
| 
         @@ -178,6 +179,7 @@ module Capybara 
     | 
|
| 
       178 
179 
     | 
    
         
             
                  #
         
     | 
| 
       179 
180 
     | 
    
         
             
                  # @macro action_waiting_behavior
         
     | 
| 
       180 
181 
     | 
    
         
             
                  # @macro click_modifiers
         
     | 
| 
      
 182 
     | 
    
         
            +
                  # @option options [Float] delay  Delay between the mouse down and mouse up events in seconds (0)
         
     | 
| 
       181 
183 
     | 
    
         
             
                  # @return [Capybara::Node::Element]  The element
         
     | 
| 
       182 
184 
     | 
    
         
             
                  def right_click(*keys, **options)
         
     | 
| 
       183 
185 
     | 
    
         
             
                    perform_click_action(keys, **options) do |k, opts|
         
     | 
| 
         @@ -30,7 +30,9 @@ class Capybara::RackTest::Browser 
     | 
|
| 
       30 
30 
     | 
    
         | 
| 
       31 
31 
     | 
    
         
             
              def submit(method, path, attributes)
         
     | 
| 
       32 
32 
     | 
    
         
             
                path = request_path if path.nil? || path.empty?
         
     | 
| 
       33 
     | 
    
         
            -
                 
     | 
| 
      
 33 
     | 
    
         
            +
                uri = build_uri(path)
         
     | 
| 
      
 34 
     | 
    
         
            +
                uri.query = '' if method&.to_s&.downcase == 'get'
         
     | 
| 
      
 35 
     | 
    
         
            +
                process_and_follow_redirects(method, uri.to_s, attributes, 'HTTP_REFERER' => current_url)
         
     | 
| 
       34 
36 
     | 
    
         
             
              end
         
     | 
| 
       35 
37 
     | 
    
         | 
| 
       36 
38 
     | 
    
         
             
              def follow(method, path, **attributes)
         
     | 
    
        data/lib/capybara/result.rb
    CHANGED
    
    
| 
         @@ -2,17 +2,17 @@ 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            module Capybara
         
     | 
| 
       4 
4 
     | 
    
         
             
              module RSpecMatcherProxies
         
     | 
| 
       5 
     | 
    
         
            -
                def all(*args, &block)
         
     | 
| 
      
 5 
     | 
    
         
            +
                def all(*args, **kwargs, &block)
         
     | 
| 
       6 
6 
     | 
    
         
             
                  if defined?(::RSpec::Matchers::BuiltIn::All) && args.first.respond_to?(:matches?)
         
     | 
| 
       7 
7 
     | 
    
         
             
                    ::RSpec::Matchers::BuiltIn::All.new(*args)
         
     | 
| 
       8 
8 
     | 
    
         
             
                  else
         
     | 
| 
       9 
     | 
    
         
            -
                    find_all(*args, &block)
         
     | 
| 
      
 9 
     | 
    
         
            +
                    find_all(*args, **kwargs, &block)
         
     | 
| 
       10 
10 
     | 
    
         
             
                  end
         
     | 
| 
       11 
11 
     | 
    
         
             
                end
         
     | 
| 
       12 
12 
     | 
    
         | 
| 
       13 
     | 
    
         
            -
                def within(*args, &block)
         
     | 
| 
      
 13 
     | 
    
         
            +
                def within(*args, **kwargs, &block)
         
     | 
| 
       14 
14 
     | 
    
         
             
                  if block_given?
         
     | 
| 
       15 
     | 
    
         
            -
                    within_element(*args, &block)
         
     | 
| 
      
 15 
     | 
    
         
            +
                    within_element(*args, **kwargs, &block)
         
     | 
| 
       16 
16 
     | 
    
         
             
                  else
         
     | 
| 
       17 
17 
     | 
    
         
             
                    be_within(*args)
         
     | 
| 
       18 
18 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            (function(){function u(e){var t=e.tagName.toUpperCase();if("OPTION"==t)return!0;if("INPUT"!=t)return!1;var r=e.type.toLowerCase();return"checkbox"==r||"radio"==r}function s(e){var t="selected",r=e.type&&e.type.toLowerCase();return"checkbox"!=r&&"radio"!=r||(t="checked"),!!e[t]}function c(e,t){var r=e.getAttributeNode(t);return r&&r.specified?r.value:null}var i=["allowfullscreen","allowpaymentrequest","allowusermedia","async","autofocus","autoplay","checked","compact","complete","controls","declare","default","defaultchecked","defaultselected","defer","disabled","ended","formnovalidate","hidden","indeterminate","iscontenteditable","ismap","itemscope","loop","multiple","muted","nohref","nomodule","noresize","noshade","novalidate","nowrap","open","paused","playsinline","pubdate","readonly","required","reversed","scoped","seamless","seeking","selected","truespeed","typemustmatch","willvalidate"],d={"class":"className",readonly:"readOnly"};return function f(e,t){var r=null,a=t.toLowerCase();if("style"==a)return(r=e.style)&&"string"!=typeof r&&(r=r.cssText),r;if(("selected"==a||"checked"==a)&&u(e))return s(e)?"true":null;if(tagName=e.tagName.toUpperCase(),"IMG"==tagName&&"src"==a||"A"==tagName&&"href"==a)return(r=c(e,a))&&(r=e[a]),r;if("spellcheck"==a){if(null 
     | 
| 
      
 1 
     | 
    
         
            +
            (function(){function u(e){var t=e.tagName.toUpperCase();if("OPTION"==t)return!0;if("INPUT"!=t)return!1;var r=e.type.toLowerCase();return"checkbox"==r||"radio"==r}function s(e){var t="selected",r=e.type&&e.type.toLowerCase();return"checkbox"!=r&&"radio"!=r||(t="checked"),!!e[t]}function c(e,t){var r=e.getAttributeNode(t);return r&&r.specified?r.value:null}var i=["allowfullscreen","allowpaymentrequest","allowusermedia","async","autofocus","autoplay","checked","compact","complete","controls","declare","default","defaultchecked","defaultselected","defer","disabled","ended","formnovalidate","hidden","indeterminate","iscontenteditable","ismap","itemscope","loop","multiple","muted","nohref","nomodule","noresize","noshade","novalidate","nowrap","open","paused","playsinline","pubdate","readonly","required","reversed","scoped","seamless","seeking","selected","truespeed","typemustmatch","willvalidate"],d={"class":"className",readonly:"readOnly"};return function f(e,t){var r=null,a=t.toLowerCase();if("style"==a)return(r=e.style)&&"string"!=typeof r&&(r=r.cssText),r;if(("selected"==a||"checked"==a)&&u(e))return s(e)?"true":null;if(tagName=e.tagName.toUpperCase(),"IMG"==tagName&&"src"==a||"A"==tagName&&"href"==a)return(r=c(e,a))&&(r=e[a]),r;if("spellcheck"==a){if(null!==(r=c(e,a))){if("false"==r.toLowerCase())return"false";if("true"==r.toLowerCase())return"true"}return e[a]+""}var l,n=d[t]||t;if(i.some(function(e){e==a}))return(r=!(null===(r=c(e,a)))||e[n])?"true":null;try{l=e[n]}catch(o){}return null!=(r=null==l||"object"==typeof l||"function"==typeof l?c(e,t):l)?r.toString():null}})()
         
     | 
| 
         @@ -20,6 +20,7 @@ class Capybara::Selenium::Driver < Capybara::Driver::Base 
     | 
|
| 
       20 
20 
     | 
    
         
             
                  require 'capybara/selenium/logger_suppressor'
         
     | 
| 
       21 
21 
     | 
    
         
             
                  require 'capybara/selenium/patches/atoms'
         
     | 
| 
       22 
22 
     | 
    
         
             
                  require 'capybara/selenium/patches/is_displayed'
         
     | 
| 
      
 23 
     | 
    
         
            +
                  require 'capybara/selenium/patches/action_pauser'
         
     | 
| 
       23 
24 
     | 
    
         
             
                  if Gem.loaded_specs['selenium-webdriver'].version < Gem::Version.new('3.5.0')
         
     | 
| 
       24 
25 
     | 
    
         
             
                    warn "Warning: You're using an unsupported version of selenium-webdriver, please upgrade."
         
     | 
| 
       25 
26 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -240,7 +241,7 @@ class Capybara::Selenium::Driver < Capybara::Driver::Base 
     | 
|
| 
       240 
241 
     | 
    
         | 
| 
       241 
242 
     | 
    
         
             
              def quit
         
     | 
| 
       242 
243 
     | 
    
         
             
                @browser&.quit
         
     | 
| 
       243 
     | 
    
         
            -
              rescue Selenium::WebDriver::Error::SessionNotCreatedError, Errno::ECONNREFUSED 
     | 
| 
      
 244 
     | 
    
         
            +
              rescue Selenium::WebDriver::Error::SessionNotCreatedError, Errno::ECONNREFUSED
         
     | 
| 
       244 
245 
     | 
    
         
             
                # Browser must have already gone
         
     | 
| 
       245 
246 
     | 
    
         
             
              rescue Selenium::WebDriver::Error::UnknownError => e
         
     | 
| 
       246 
247 
     | 
    
         
             
                unless silenced_unknown_error_message?(e.message) # Most likely already gone
         
     | 
| 
         @@ -292,7 +293,7 @@ private 
     | 
|
| 
       292 
293 
     | 
    
         
             
              def clear_browser_state
         
     | 
| 
       293 
294 
     | 
    
         
             
                delete_all_cookies
         
     | 
| 
       294 
295 
     | 
    
         
             
                clear_storage
         
     | 
| 
       295 
     | 
    
         
            -
              rescue *clear_browser_state_errors 
     | 
| 
      
 296 
     | 
    
         
            +
              rescue *clear_browser_state_errors
         
     | 
| 
       296 
297 
     | 
    
         
             
                # delete_all_cookies fails when we've previously gone
         
     | 
| 
       297 
298 
     | 
    
         
             
                # to about:blank, so we rescue this error and do nothing
         
     | 
| 
       298 
299 
     | 
    
         
             
                # instead.
         
     | 
| 
         @@ -316,7 +317,7 @@ private 
     | 
|
| 
       316 
317 
     | 
    
         
             
              def clear_storage
         
     | 
| 
       317 
318 
     | 
    
         
             
                clear_session_storage unless options[:clear_session_storage] == false
         
     | 
| 
       318 
319 
     | 
    
         
             
                clear_local_storage unless options[:clear_local_storage] == false
         
     | 
| 
       319 
     | 
    
         
            -
              rescue Selenium::WebDriver::Error::JavascriptError 
     | 
| 
      
 320 
     | 
    
         
            +
              rescue Selenium::WebDriver::Error::JavascriptError
         
     | 
| 
       320 
321 
     | 
    
         
             
                # session/local storage may not be available if on non-http pages (e.g. about:blank)
         
     | 
| 
       321 
322 
     | 
    
         
             
              end
         
     | 
| 
       322 
323 
     | 
    
         | 
| 
         @@ -352,7 +353,7 @@ private 
     | 
|
| 
       352 
353 
     | 
    
         
             
                @browser.navigate.to(url)
         
     | 
| 
       353 
354 
     | 
    
         
             
                sleep 0.1 # slight wait for alert
         
     | 
| 
       354 
355 
     | 
    
         
             
                @browser.switch_to.alert.accept
         
     | 
| 
       355 
     | 
    
         
            -
              rescue modal_error 
     | 
| 
      
 356 
     | 
    
         
            +
              rescue modal_error
         
     | 
| 
       356 
357 
     | 
    
         
             
                # alert now gone, should mean navigation happened
         
     | 
| 
       357 
358 
     | 
    
         
             
              end
         
     | 
| 
       358 
359 
     | 
    
         |