def expected_element(element_name, timeout=::PageObject.default_element_wait)
      define_method("has_expected_element?") do
        self.respond_to? "#{element_name}_element" and self.send("#{element_name}_element").when_present timeout
      end
    end
def expected_element(element_name, timeout=::PageObject.default_element_wait)
      define_method("has_expected_element?") do
        self.respond_to? "#{element_name}_element" and self.send("#{element_name}_element").when_present timeout
      end
    end
Creates a method that provides a way to initialize a page based upon an expected element.
 This is useful for pages that load dynamic content.
 @param [Symbol] the name given to the element in the declaration
 @param [optional, Integer] timeout default value is 5 seconds
 @return [boolean]

 @example Specify a text box named :address expected on the page within 10 seconds
   expected_element(:address, 10)
   page.has_expected_element?