Module: Capybara::Minitest::Assertions
- Defined in:
- lib/capybara/minitest.rb
Instance Method Summary collapse
- #assert_all_of_selectors ⇒ Object
- #assert_ancestor ⇒ Object
- #assert_any_of_selectors ⇒ Object
- #assert_button ⇒ Object
- #assert_checked_field ⇒ Object
- #assert_css ⇒ Object
- #assert_current_path ⇒ Object
- #assert_element ⇒ Object
- #assert_field ⇒ Object
- #assert_link ⇒ Object
- #assert_matches_css ⇒ Object
- #assert_matches_selector ⇒ Object
- #assert_matches_style ⇒ Object
- #assert_matches_xpath ⇒ Object
- #assert_no_ancestor ⇒ Object (also: #refute_ancestor)
- #assert_no_button ⇒ Object
-
#assert_no_checked_field ⇒ Object
Assert that provided checked_field does not exist.
- #assert_no_css ⇒ Object
- #assert_no_current_path ⇒ Object (also: #refute_current_path)
-
#assert_no_element ⇒ Object
Assert that provided element does not exist.
- #assert_no_field ⇒ Object
-
#assert_no_link ⇒ Object
Assert that provided link does not exist.
- #assert_no_select ⇒ Object
- #assert_no_selector ⇒ Object (also: #refute_selector)
- #assert_no_sibling ⇒ Object (also: #refute_sibling)
- #assert_no_table ⇒ Object
- #assert_no_text ⇒ Object (also: #refute_text)
- #assert_no_title ⇒ Object (also: #refute_title)
-
#assert_no_unchecked_field ⇒ Object
Assert that provided unchecked field does not exist.
- #assert_no_xpath ⇒ Object
- #assert_none_of_selectors ⇒ Object
- #assert_not_matches_css ⇒ Object
- #assert_not_matches_selector ⇒ Object (also: #refute_matches_selector)
- #assert_not_matches_xpath ⇒ Object
- #assert_select ⇒ Object
- #assert_selector ⇒ Object
- #assert_sibling ⇒ Object
- #assert_table ⇒ Object
- #assert_text ⇒ Object (also: #assert_content)
- #assert_title ⇒ Object
- #assert_unchecked_field ⇒ Object
- #assert_xpath ⇒ Object
-
#refute_button ⇒ Object
Assert that provided button does not exist.
- #refute_checked_field ⇒ Object
-
#refute_css ⇒ Object
Assert that provided css does not exist.
- #refute_element ⇒ Object
-
#refute_field ⇒ Object
Assert that provided field does not exist.
- #refute_link ⇒ Object
-
#refute_matches_css ⇒ Object
Assert that element matches css.
-
#refute_matches_xpath ⇒ Object
Assert that element does not match xpath.
-
#refute_select ⇒ Object
Assert that provided select does not exist.
-
#refute_table ⇒ Object
Assert that provided table does not exist.
- #refute_unchecked_field ⇒ Object
-
#refute_xpath ⇒ Object
Assert that provide xpath does not exist.
Instance Method Details
#assert_all_of_selectors ⇒ Object
|
# File 'lib/capybara/minitest.rb', line 96
|
#assert_ancestor ⇒ Object
|
# File 'lib/capybara/minitest.rb', line 133
|
#assert_any_of_selectors ⇒ Object
|
# File 'lib/capybara/minitest.rb', line 108
|
#assert_checked_field ⇒ Object
|
# File 'lib/capybara/minitest.rb', line 245
|
#assert_current_path ⇒ Object
|
# File 'lib/capybara/minitest.rb', line 38
|
#assert_element ⇒ Object
|
# File 'lib/capybara/minitest.rb', line 193
|
#assert_matches_css ⇒ Object
|
# File 'lib/capybara/minitest.rb', line 350
|
#assert_matches_selector ⇒ Object
|
# File 'lib/capybara/minitest.rb', line 83
|
#assert_matches_style ⇒ Object
|
# File 'lib/capybara/minitest.rb', line 114
|
#assert_matches_xpath ⇒ Object
|
# File 'lib/capybara/minitest.rb', line 337
|
#assert_no_ancestor ⇒ Object Also known as: refute_ancestor
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/capybara/minitest.rb', line 146 %w[selector no_selector matches_style all_of_selectors none_of_selectors any_of_selectors matches_selector not_matches_selector sibling no_sibling ancestor no_ancestor].each do |assertion_name| class_eval <<-ASSERTION, __FILE__, __LINE__ + 1 def assert_#{assertion_name} *args, &optional_filter_block self.assertions +=1 subject, args = determine_subject(args) subject.assert_#{assertion_name}(*args, &optional_filter_block) rescue Capybara::ExpectationNotMet => e raise ::Minitest::Assertion, e.message end ASSERTION ruby2_keywords "assert_#{assertion_name}" if respond_to?(:ruby2_keywords) end |
#assert_no_button ⇒ Object
|
# File 'lib/capybara/minitest.rb', line 225
|
#assert_no_checked_field ⇒ Object
Assert that provided checked_field does not exist
|
# File 'lib/capybara/minitest.rb', line 251
|
#assert_no_current_path ⇒ Object Also known as: refute_current_path
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/capybara/minitest.rb', line 51 %w[text no_text title no_title current_path no_current_path].each do |assertion_name| class_eval <<-ASSERTION, __FILE__, __LINE__ + 1 def assert_#{assertion_name}(*args, **kwargs, &optional_filter_block) self.assertions +=1 subject, args = determine_subject(args) subject.assert_#{assertion_name}(*args, **kwargs, &optional_filter_block) rescue Capybara::ExpectationNotMet => e raise ::Minitest::Assertion, e.message end ASSERTION end |
#assert_no_element ⇒ Object
Assert that provided element does not exist
|
# File 'lib/capybara/minitest.rb', line 199
|
#assert_no_field ⇒ Object
|
# File 'lib/capybara/minitest.rb', line 238
|
#assert_no_link ⇒ Object
Assert that provided link does not exist
|
# File 'lib/capybara/minitest.rb', line 212
|
#assert_no_select ⇒ Object
|
# File 'lib/capybara/minitest.rb', line 277
|
#assert_no_selector ⇒ Object Also known as: refute_selector
|
# File 'lib/capybara/minitest.rb', line 76
|
#assert_no_sibling ⇒ Object Also known as: refute_sibling
|
# File 'lib/capybara/minitest.rb', line 126
|
#assert_no_table ⇒ Object
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 |
# File 'lib/capybara/minitest.rb', line 297 %w[xpath css element link button field select table].each do |selector_type| define_method "assert_#{selector_type}" do |*args, &optional_filter_block| subject, args = determine_subject(args) locator, = extract_locator(args) assert_selector(subject, selector_type.to_sym, locator, **, &optional_filter_block) end ruby2_keywords "assert_#{selector_type}" if respond_to?(:ruby2_keywords) define_method "assert_no_#{selector_type}" do |*args, &optional_filter_block| subject, args = determine_subject(args) locator, = extract_locator(args) assert_no_selector(subject, selector_type.to_sym, locator, **, &optional_filter_block) end ruby2_keywords "assert_no_#{selector_type}" if respond_to?(:ruby2_keywords) alias_method "refute_#{selector_type}", "assert_no_#{selector_type}" end |
#assert_no_text ⇒ Object Also known as: refute_text
|
# File 'lib/capybara/minitest.rb', line 16
|
#assert_no_title ⇒ Object Also known as: refute_title
|
# File 'lib/capybara/minitest.rb', line 31
|
#assert_no_unchecked_field ⇒ Object
Assert that provided unchecked field does not exist
|
# File 'lib/capybara/minitest.rb', line 264
|
#assert_no_xpath ⇒ Object
|
# File 'lib/capybara/minitest.rb', line 173
|
#assert_none_of_selectors ⇒ Object
|
# File 'lib/capybara/minitest.rb', line 102
|
#assert_not_matches_css ⇒ Object
363 364 365 366 367 368 369 370 371 372 373 374 375 376 |
# File 'lib/capybara/minitest.rb', line 363 %w[xpath css].each do |selector_type| define_method "assert_matches_#{selector_type}" do |*args, &optional_filter_block| subject, args = determine_subject(args) assert_matches_selector(subject, selector_type.to_sym, *args, &optional_filter_block) end ruby2_keywords "assert_matches_#{selector_type}" if respond_to?(:ruby2_keywords) define_method "assert_not_matches_#{selector_type}" do |*args, &optional_filter_block| subject, args = determine_subject(args) assert_not_matches_selector(subject, selector_type.to_sym, *args, &optional_filter_block) end ruby2_keywords "assert_not_matches_#{selector_type}" if respond_to?(:ruby2_keywords) alias_method "refute_matches_#{selector_type}", "assert_not_matches_#{selector_type}" end |
#assert_not_matches_selector ⇒ Object Also known as: refute_matches_selector
|
# File 'lib/capybara/minitest.rb', line 89
|
#assert_not_matches_xpath ⇒ Object
|
# File 'lib/capybara/minitest.rb', line 343
|
#assert_selector ⇒ Object
|
# File 'lib/capybara/minitest.rb', line 70
|
#assert_sibling ⇒ Object
|
# File 'lib/capybara/minitest.rb', line 120
|
#assert_text ⇒ Object Also known as: assert_content
|
# File 'lib/capybara/minitest.rb', line 9
|
#assert_title ⇒ Object
|
# File 'lib/capybara/minitest.rb', line 25
|
#assert_unchecked_field ⇒ Object
|
# File 'lib/capybara/minitest.rb', line 258
|
#refute_button ⇒ Object
Assert that provided button does not exist
|
# File 'lib/capybara/minitest.rb', line 225
|
#refute_checked_field ⇒ Object
|
# File 'lib/capybara/minitest.rb', line 251
|
#refute_css ⇒ Object
Assert that provided css does not exist
|
# File 'lib/capybara/minitest.rb', line 186
|
#refute_element ⇒ Object
|
# File 'lib/capybara/minitest.rb', line 199
|
#refute_field ⇒ Object
Assert that provided field does not exist
|
# File 'lib/capybara/minitest.rb', line 238
|
#refute_matches_css ⇒ Object
Assert that element matches css
363 364 365 366 367 368 369 370 371 372 373 374 375 376 |
# File 'lib/capybara/minitest.rb', line 363 %w[xpath css].each do |selector_type| define_method "assert_matches_#{selector_type}" do |*args, &optional_filter_block| subject, args = determine_subject(args) assert_matches_selector(subject, selector_type.to_sym, *args, &optional_filter_block) end ruby2_keywords "assert_matches_#{selector_type}" if respond_to?(:ruby2_keywords) define_method "assert_not_matches_#{selector_type}" do |*args, &optional_filter_block| subject, args = determine_subject(args) assert_not_matches_selector(subject, selector_type.to_sym, *args, &optional_filter_block) end ruby2_keywords "assert_not_matches_#{selector_type}" if respond_to?(:ruby2_keywords) alias_method "refute_matches_#{selector_type}", "assert_not_matches_#{selector_type}" end |
#refute_matches_xpath ⇒ Object
Assert that element does not match xpath
|
# File 'lib/capybara/minitest.rb', line 343
|
#refute_select ⇒ Object
Assert that provided select does not exist
|
# File 'lib/capybara/minitest.rb', line 277
|
#refute_table ⇒ Object
Assert that provided table does not exist
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 |
# File 'lib/capybara/minitest.rb', line 297 %w[xpath css element link button field select table].each do |selector_type| define_method "assert_#{selector_type}" do |*args, &optional_filter_block| subject, args = determine_subject(args) locator, = extract_locator(args) assert_selector(subject, selector_type.to_sym, locator, **, &optional_filter_block) end ruby2_keywords "assert_#{selector_type}" if respond_to?(:ruby2_keywords) define_method "assert_no_#{selector_type}" do |*args, &optional_filter_block| subject, args = determine_subject(args) locator, = extract_locator(args) assert_no_selector(subject, selector_type.to_sym, locator, **, &optional_filter_block) end ruby2_keywords "assert_no_#{selector_type}" if respond_to?(:ruby2_keywords) alias_method "refute_#{selector_type}", "assert_no_#{selector_type}" end |
#refute_unchecked_field ⇒ Object
|
# File 'lib/capybara/minitest.rb', line 264
|
#refute_xpath ⇒ Object
Assert that provide xpath does not exist
|
# File 'lib/capybara/minitest.rb', line 173
|