Method: Capybara::Node::Matchers#has_button?

Defined in:
lib/capybara/node/matchers.rb

#has_button?(locator = nil, **options, &optional_filter_block) ⇒ Boolean

Checks if the page or current node has a button with the given text, value or id.

Parameters:

  • locator (String) (defaults to: nil)

    The text, value or id of a button to check for

Returns:

  • (Boolean)

    Whether it exists



383
384
385
# File 'lib/capybara/node/matchers.rb', line 383

def has_button?(locator = nil, **options, &optional_filter_block)
  has_selector?(:button, locator, **options, &optional_filter_block)
end