Instance Method Details
#become_closed(**options) ⇒ Object
Wait for window to become closed.
203 204 205 |
# File 'lib/capybara/rspec/matchers.rb', line 203 def become_closed(**options) Matchers::BecomeClosed.new(options) end |
#have_all_of_selectors ⇒ Object
RSpec matcher for whether the element(s) matching a group of selectors exist.
#have_ancestor ⇒ Object
RSpec matcher for whether ancestor element(s) matching a given selector exist.
192 193 194 |
# File 'lib/capybara/rspec/matchers.rb', line 192 def have_ancestor(...) Matchers::HaveAncestor.new(...) end |
#have_any_of_selectors ⇒ Object
RSpec matcher for whether the element(s) matching any of a group of selectors exist.
#have_button(locator = nil, **options, &optional_filter_block) ⇒ Object
RSpec matcher for buttons.
|
|
# File 'lib/capybara/rspec/matchers.rb', line 96
|
#have_checked_field(locator = nil, **options, &optional_filter_block) ⇒ Object
RSpec matcher for checked fields.
|
|
# File 'lib/capybara/rspec/matchers.rb', line 122
|
#have_css(css, **options, &optional_filter_block) ⇒ Object
RSpec matcher for whether elements(s) matching a given css selector exist
|
|
# File 'lib/capybara/rspec/matchers.rb', line 65
|
#have_current_path(path, **options, &optional_filter_block) ⇒ Object
RSpec matcher for the current path.
147 148 149 |
# File 'lib/capybara/rspec/matchers.rb', line 147 def have_current_path(path, **options, &optional_filter_block) Matchers::HaveCurrentPath.new(path, **options, &optional_filter_block) end |
#have_element(locator = nil, **options, &optional_filter_block) ⇒ Object
RSpec matcher for elements.
|
|
# File 'lib/capybara/rspec/matchers.rb', line 86
|
#have_field(locator = nil, **options, &optional_filter_block) ⇒ Object
RSpec matcher for form fields.
|
|
# File 'lib/capybara/rspec/matchers.rb', line 101
|
#have_link(locator = nil, **options, &optional_filter_block) ⇒ Object
RSpec matcher for links.
|
|
# File 'lib/capybara/rspec/matchers.rb', line 91
|
#have_none_of_selectors ⇒ Object
RSpec matcher for whether no element(s) matching a group of selectors exist.
#have_select(locator = nil, **options, &optional_filter_block) ⇒ Object
RSpec matcher for select elements.
|
|
# File 'lib/capybara/rspec/matchers.rb', line 106
|
#have_selector ⇒ Object
RSpec matcher for whether the element(s) matching a given selector exist.
18 19 20 |
# File 'lib/capybara/rspec/matchers.rb', line 18 def have_selector(...) Matchers::HaveSelector.new(...) end |
#have_sibling ⇒ Object
RSpec matcher for whether sibling element(s) matching a given selector exist.
185 186 187 |
# File 'lib/capybara/rspec/matchers.rb', line 185 def have_sibling(...) Matchers::HaveSibling.new(...) end |
#have_style(styles = nil, **options) ⇒ Object
Deprecated.
162 163 164 165 |
# File 'lib/capybara/rspec/matchers.rb', line 162 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 |
#have_table(locator = nil, **options, &optional_filter_block) ⇒ Object
RSpec matcher for table elements.
116 117 118 119 120 |
# File 'lib/capybara/rspec/matchers.rb', line 116 %i[checked unchecked].each do |state| define_method "have_#{state}_field" do |locator = nil, **options, &optional_filter_block| Matchers::HaveSelector.new(:field, locator, **options.merge(state => true), &optional_filter_block) end end |
#have_text(text_or_type, *args, **options) ⇒ Object Also known as: have_content
RSpec matcher for text content.
135 136 137 |
# File 'lib/capybara/rspec/matchers.rb', line 135 def have_text(text_or_type, *args, **options) Matchers::HaveText.new(text_or_type, *args, **options) end |
#have_title(title, **options) ⇒ Object
140 141 142 |
# File 'lib/capybara/rspec/matchers.rb', line 140 def have_title(title, **options) Matchers::HaveTitle.new(title, **options) end |
#have_unchecked_field(locator = nil, **options, &optional_filter_block) ⇒ Object
RSpec matcher for unchecked fields.
|
|
# File 'lib/capybara/rspec/matchers.rb', line 127
|
#have_xpath(xpath, **options, &optional_filter_block) ⇒ Object
RSpec matcher for whether elements(s) matching a given xpath selector exist.
|
|
# File 'lib/capybara/rspec/matchers.rb', line 60
|
#match_css(css, **options, &optional_filter_block) ⇒ Object
RSpec matcher for whether the current element matches a given css selector.
80 81 82 83 84 |
# File 'lib/capybara/rspec/matchers.rb', line 80 %i[link button field select table element].each do |selector| define_method "have_#{selector}" do |locator = nil, **options, &optional_filter_block| Matchers::HaveSelector.new(selector, locator, **options, &optional_filter_block) end end |
#match_selector ⇒ Object
RSpec matcher for whether the current element matches a given selector.
#match_style(styles = nil, **options) ⇒ Object
RSpec matcher for element style.
154 155 156 157 |
# File 'lib/capybara/rspec/matchers.rb', line 154 def match_style(styles = nil, **options) styles, options = options, {} if styles.nil? Matchers::MatchStyle.new(styles, **options) end |
#match_xpath(xpath, **options, &optional_filter_block) ⇒ Object
RSpec matcher for whether the current element matches a given xpath selector.
|
|
# File 'lib/capybara/rspec/matchers.rb', line 70
|