lib/page-object/accessors.rb
#
# adds a method to return a page object rooted at an element
#
# @example
#   page_section(:navigation_bar, NavigationBar, :id => 'nav-bar')
#   # will generate 'navigation_bar'
#
# @param [Symbol] the name used for the generated methods
# @param [Class] the class to instantiate for the element
# @param [Hash] identifier how we find an element.
#
adds a method to return a page object rooted at an element
adds a method to return a page object rooted at an element
def page_section(name, section_class, identifier)
      define_method(name) do
        platform.page_for(identifier, section_class)
      end
    end
def page_section ( name , section_class , identifier ) define_method ( name ) do platform . page_for ( identifier , section_class ) end end
adds a method to return a page object rooted at an element
adds a method to return a page object rooted at an element
name
section_class
identifier
identifier how we find an element.
identifier how we find an element .
example
navigation_bar, NavigationBar, :id => 'nav-bar') # will generate 'navigation_bar'
navigation_bar NavigationBar : id = > ' nav - bar ' ) # will generate ' navigation_bar '