module Capybara::RSpecMatchers
Public Instance Methods
Wait for window to become closed.
@example
expect(window).to become_closed(wait: 0.8)
@option options [Numeric] :wait Maximum wait time. Defaults to {Capybara.configure default_max_wait_time}
# File lib/capybara/rspec/matchers.rb, line 198 def become_closed(**options) Matchers::BecomeClosed.new(options) end
RSpec
matcher for whether the element(s) matching a group of selectors exist.
@see Capybara::Node::Matchers#assert_all_of_selectors
# File lib/capybara/rspec/matchers.rb, line 25 def have_all_of_selectors(...) Matchers::HaveAllSelectors.new(...) end
RSpec
matcher for whether ancestor element(s) matching a given selector exist.
@see Capybara::Node::Matchers#assert_ancestor
# File lib/capybara/rspec/matchers.rb, line 187 def have_ancestor(...) Matchers::HaveAncestor.new(...) end
RSpec
matcher for whether the element(s) matching any of a group of selectors exist.
@see Capybara::Node::Matchers#assert_any_of_selectors
# File lib/capybara/rspec/matchers.rb, line 39 def have_any_of_selectors(...) Matchers::HaveAnySelectors.new(...) end
RSpec
matcher for the current path.
@see Capybara::SessionMatchers#assert_current_path
# File lib/capybara/rspec/matchers.rb, line 142 def have_current_path(path, **options, &optional_filter_block) Matchers::HaveCurrentPath.new(path, **options, &optional_filter_block) end
RSpec
matcher for whether no element(s) matching a group of selectors exist.
@see Capybara::Node::Matchers#assert_none_of_selectors
# File lib/capybara/rspec/matchers.rb, line 32 def have_none_of_selectors(...) Matchers::HaveNoSelectors.new(...) end
RSpec
matcher for whether the element(s) matching a given selector exist.
@see Capybara::Node::Matchers#assert_selector
# File lib/capybara/rspec/matchers.rb, line 18 def have_selector(...) Matchers::HaveSelector.new(...) end
RSpec
matcher for whether sibling element(s) matching a given selector exist.
@see Capybara::Node::Matchers#assert_sibling
# File lib/capybara/rspec/matchers.rb, line 180 def have_sibling(...) Matchers::HaveSibling.new(...) end
@deprecated
# File lib/capybara/rspec/matchers.rb, line 157 def have_style(styles = nil, **options) Capybara::Helpers.warn "DEPRECATED: have_style is deprecated, please use match_style : #{Capybara::Helpers.filter_backtrace(caller)}" match_style(styles, **options) end
RSpec
matcher for text content.
@see Capybara::Node::Matchers#assert_text
# File lib/capybara/rspec/matchers.rb, line 130 def have_text(text_or_type, *args, **options) Matchers::HaveText.new(text_or_type, *args, **options) end
# File lib/capybara/rspec/matchers.rb, line 135 def have_title(title, **options) Matchers::HaveTitle.new(title, **options) end
RSpec
matcher for whether the current element matches a given selector.
@see Capybara::Node::Matchers#assert_matches_selector
# File lib/capybara/rspec/matchers.rb, line 46 def match_selector(...) Matchers::MatchSelector.new(...) end
RSpec
matcher for element style.
@see Capybara::Node::Matchers#matches_style?
# File lib/capybara/rspec/matchers.rb, line 149 def match_style(styles = nil, **options) styles, options = options, {} if styles.nil? Matchers::MatchStyle.new(styles, **options) end