Method: Capybara::Node::Finders#sibling
- Defined in:
- lib/capybara/node/finders.rb
#sibling(*args, **options, &optional_filter_block) ⇒ Capybara::Node::Element
Find an Element based on the given arguments that is also a sibling of the element called on. #sibling will raise an error if the element is not found.
#sibling takes the same options as #find.
element.sibling('#foo').find('.bar')
element.sibling(:xpath, './/div[contains(., "bar")]')
element.sibling('ul', text: 'Quox').click_link('Delete')
If the driver is capable of executing JavaScript, this method will wait for a set amount of time and continuously retry finding the element until either the element is found or the time expires. The length of time this method will wait is controlled through default_max_wait_time.
104 105 106 107 |
# File 'lib/capybara/node/finders.rb', line 104 def sibling(*args, **, &optional_filter_block) [:session_options] = synced_resolve Capybara::Queries::SiblingQuery.new(*args, **, &optional_filter_block) end |