Method: Capybara::Node::Finders#first
- Defined in:
- lib/capybara/node/finders.rb
#first([kind], locator, options) ⇒ Capybara::Node::Element
Find the first element on the page matching the given selector
and options. By default #first will wait up to default_max_wait_time
seconds for matching elements to appear and then raise an error if no matching
element is found, or nil
if the provided count options allow for empty results.
293 294 295 296 |
# File 'lib/capybara/node/finders.rb', line 293 def first(*args, **, &optional_filter_block) = { minimum: 1 }.merge() unless () all(*args, **, &optional_filter_block).first end |