module EDSL::PageObject::Visitable

Public Instance Methods

page_url(url) click to toggle source
# File lib/edsl/page_object/visitation.rb, line 24
def page_url(url)
  define_method("goto") do
    browser.goto page_url_value
  end

  define_method('page_url_value') do
    lookup        = url.kind_of?(Symbol) ? self.send(url) : url
    erb           = ::ERB.new(%Q{#{lookup}})
    merged_params = self.class.instance_variable_get("@merged_params")
    params        = merged_params ? merged_params : self.class.params
    erb.result(binding)
  end
end
params() click to toggle source

Return the params that exist on this page class

# File lib/edsl/page_object/visitation.rb, line 20
def params
  @params ||= {}
end
params=(the_params) click to toggle source

Set some values that can be used within the class. This is typically used to provide values that help build dynamic urls in the page_url method

@param [Hash] the value to set the params

# File lib/edsl/page_object/visitation.rb, line 13
def params=(the_params)
  @params = the_params
end