Class: CapybaraPageObject::ListElement

Inherits:
Element
  • Object
show all
Defined in:
lib/capybara_page_object/elements/list_element.rb

Instance Attribute Summary

Attributes inherited from Element

#element, #page

Instance Method Summary collapse

Methods inherited from Element

#attribute, #class, #enabled?, #focus, #html, #initialize, #method_missing, #native, #parent, #respond_to_missing?, #scroll_into_view, #within

Constructor Details

This class inherits a constructor from CapybaraPageObject::Element

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class CapybaraPageObject::Element

Instance Method Details

#[](item_index) ⇒ Object



8
9
10
# File 'lib/capybara_page_object/elements/list_element.rb', line 8

def [](item_index)
  items[item_index]
end

#itemsObject



4
5
6
# File 'lib/capybara_page_object/elements/list_element.rb', line 4

def items
  @page.within(element) { all('li') }
end