Module: Capybara::Minitest::Assertions
Relationships & Source Files | |
Defined in: | lib/capybara/minitest.rb |
Instance Method Summary
- #assert_all_of_selectors
- #assert_ancestor
- #assert_any_of_selectors
- #assert_button
- #assert_checked_field
-
#assert_content
Alias for #assert_text.
- #assert_css
- #assert_current_path
- #assert_element
- #assert_field
- #assert_link
- #assert_matches_css
- #assert_matches_selector
- #assert_matches_style
- #assert_matches_xpath
- #assert_no_ancestor (also: #refute_ancestor)
- #assert_no_button
-
#assert_no_checked_field
Assert that provided checked_field does not exist.
-
#assert_no_content
Alias for #refute_text.
- #assert_no_css
- #assert_no_current_path (also: #refute_current_path)
-
#assert_no_element
Assert that provided element does not exist.
- #assert_no_field
-
#assert_no_link
Assert that provided link does not exist.
- #assert_no_select
- #assert_no_selector (also: #refute_selector)
- #assert_no_sibling (also: #refute_sibling)
- #assert_no_table
- #assert_no_text (also: #refute_text)
- #assert_no_title (also: #refute_title)
-
#assert_no_unchecked_field
Assert that provided unchecked field does not exist.
- #assert_no_xpath
- #assert_none_of_selectors
- #assert_not_matches_css
- #assert_not_matches_selector (also: #refute_matches_selector)
- #assert_not_matches_xpath
- #assert_select
- #assert_selector
- #assert_sibling
- #assert_table
- #assert_text (also: #assert_content)
- #assert_title
- #assert_unchecked_field
- #assert_xpath
-
#refute_ancestor
Alias for #assert_no_ancestor.
-
#refute_button
Assert that provided button does not exist.
- #refute_checked_field
-
#refute_content
Alias for #refute_text.
-
#refute_css
Assert that provided css does not exist.
-
#refute_current_path
Alias for #assert_no_current_path.
- #refute_element
-
#refute_field
Assert that provided field does not exist.
- #refute_link
-
#refute_matches_css
Assert that element matches css.
-
#refute_matches_selector
Alias for #assert_not_matches_selector.
-
#refute_matches_xpath
Assert that element does not match xpath.
-
#refute_select
Assert that provided select does not exist.
-
#refute_selector
Alias for #assert_no_selector.
-
#refute_sibling
Alias for #assert_no_sibling.
-
#refute_table
Assert that provided table does not exist.
-
#refute_text
(also: #refute_content, #assert_no_content)
Alias for #assert_no_text.
-
#refute_title
Alias for #assert_no_title.
- #refute_unchecked_field
-
#refute_xpath
Assert that provide xpath does not exist.
- #determine_subject(args) private
- #extract_locator(args) private
Instance Method Details
#assert_all_of_selectors
[ GitHub ]#assert_ancestor
[ GitHub ]#assert_any_of_selectors
[ GitHub ]#assert_button
[ GitHub ]#assert_checked_field
[ GitHub ]#assert_content
Alias for #assert_text.
#assert_css
[ GitHub ]#assert_current_path
[ GitHub ]#assert_element
[ GitHub ]#assert_field
[ GitHub ]#assert_link
[ GitHub ]#assert_matches_css
[ GitHub ]#assert_matches_selector
[ GitHub ]#assert_matches_style
[ GitHub ]#assert_matches_xpath
[ GitHub ]#assert_no_ancestor Also known as: #refute_ancestor
[ GitHub ]# 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
[ GitHub ]#assert_no_checked_field
Assert that provided checked_field does not exist
#assert_no_content
Alias for #refute_text.
#assert_no_css
[ GitHub ]#assert_no_current_path Also known as: #refute_current_path
[ GitHub ]# 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
Assert that provided element does not exist
#assert_no_field
[ GitHub ]#assert_no_link
Assert that provided link does not exist
#assert_no_select
[ GitHub ]#assert_no_selector Also known as: #refute_selector
[ GitHub ]#assert_no_sibling Also known as: #refute_sibling
[ GitHub ]#assert_no_table
[ GitHub ]# 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 Also known as: #refute_text
[ GitHub ]#assert_no_title Also known as: #refute_title
[ GitHub ]#assert_no_unchecked_field
Assert that provided unchecked field does not exist
#assert_no_xpath
[ GitHub ]#assert_none_of_selectors
[ GitHub ]#assert_not_matches_css
[ GitHub ]# 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 Also known as: #refute_matches_selector
[ GitHub ]#assert_not_matches_xpath
[ GitHub ]#assert_select
[ GitHub ]#assert_selector
[ GitHub ]#assert_sibling
[ GitHub ]#assert_table
[ GitHub ]#assert_text Also known as: #assert_content
[ GitHub ]#assert_title
[ GitHub ]#assert_unchecked_field
[ GitHub ]#assert_xpath
[ GitHub ]#determine_subject(args) (private)
[ GitHub ]#extract_locator(args) (private)
[ GitHub ]# File 'lib/capybara/minitest.rb', line 391
def extract_locator(args) locator, = *args, {} locator, = nil, locator if locator.is_a? Hash [locator, ] end
#refute_ancestor
Alias for #assert_no_ancestor.
# 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
#refute_button
Assert that provided button does not exist
#refute_checked_field
[ GitHub ]#refute_content
Alias for #refute_text.
#refute_css
Assert that provided css does not exist
#refute_current_path
Alias for #assert_no_current_path.
# 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
#refute_element
[ GitHub ]#refute_field
Assert that provided field does not exist
#refute_link
[ GitHub ]#refute_matches_css
Assert that element matches css
# 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_selector
Alias for #assert_not_matches_selector.
#refute_matches_xpath
Assert that element does not match xpath
#refute_select
Assert that provided select does not exist
#refute_selector
Alias for #assert_no_selector.
#refute_sibling
Alias for #assert_no_sibling.
#refute_table
Assert that provided table does not exist
# 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_text Also known as: #refute_content, #assert_no_content
Alias for #assert_no_text.
#refute_title
Alias for #assert_no_title.
#refute_unchecked_field
[ GitHub ]#refute_xpath
Assert that provide xpath does not exist