lib/site-object/page_feature.rb
# Used to define access to a single HTML element on a page. This method takes two arguments:
#
# * A symbol representing the element you are defining. This symbol is used to create an accessor method on the
#   page object.
# * A block where access to the HTML element gets defined.
#
# Example: The page you are working with has a "First Name" field.
#
#  element(:first_name) { |b| b.text_field(:id 'signup-first-name') }
#
# In this example, 'b' is the browser object that will get passed down from the site to the page and then used
# when the page element needs to be accessed.
#
# The 'element' method is aliased to 'el' and using the alias is recommended as it saves space:
#
#  el(:first_name) { |b| b.text_field(:id 'signup-first-name') }
#
Used to define access to a single HTML element on a page. This method takes two arguments:
A symbol representing the element you are defining. This symbol is used to create an accessor method on the
page object.
A block where access to the HTML element gets defined.

The page you are working with has a "First Name" field.



In this example, 'b' is the browser object that will get passed down from the site to the page and then used
when the page element needs to be accessed.

The 'element' method is aliased to 'el' and using the alias is recommended as it saves space.


Used to define access to a single HTML element on a page . This method takes two arguments : A symbol representing the element you are defining . This symbol is used to create an accessor method on the page object . A block where access to the HTML element gets defined . The page you are working with has a " First Name " field . In this example ' b ' is the browser object that will get passed down from the site to the page and then used when the page element needs to be accessed . The ' element ' method is aliased to ' el ' and using the alias is recommended as it saves space .
def element(name, &block)
      define_method(name) do
        block.call(@browser)
      end
    end
def element ( name , & block ) define_method ( name ) do block . call ( @browser ) end end
Used to define access to a single HTML element on a page.
Used to define access to a single HTML element on a page .
name
<not_specific>
block
<not_specific>