lib/site-object/site.rb
# Helper method designed to assist with complex workflows. Basically, if you're navigating and
# expect a certain page to be displayed you can use this method to confirm that the page you want is
# displayed and then get a page object for it.
#
# This method just checks to see if the right class of page is being displayed. If you have defined
# a templated value in the URL of the page object getting checked it doesn't check the values of
# the arguments. It only confirms whether or not the arguments are present.
Helper method designed to assist with complex workflows. Basically, if you're navigating and
expect a certain page to be displayed you can use this method to confirm that the page you want is
displayed and then get a page object for it.

This method just checks to see if the right class of page is being displayed. If you have defined
a templated value in the URL of the page object getting checked it doesn't check the values of
the arguments. It only confirms whether or not the arguments are present.
Helper method designed to assist with complex workflows . Basically if you ' re navigating and expect a certain page to be displayed you can use this method to confirm that the page you want is displayed and then get a page object for it . This method just checks to see if the right class of page is being displayed . If you have defined a templated value in the URL of the page object getting checked it doesn ' t check the values of the arguments . It only confirms whether or not the arguments are present .
def expect_page(page_arg)
    p = page
    if p
      if p.class.name == page_arg.class.name  
        return p
      elsif p.class == page_arg               
        return p
      elsif page_arg.is_a?(Symbol) && p.class.name.underscore.to_sym == page_arg
        return p
      else
        raise SiteObject::WrongPageError, "Expected #{page_arg} page to be displayed but the URL doesn't look right. \n\n#{caller.join("\n")}"
      end
    else
      raise SiteObject::WrongPageError, "Expected #{page_arg} page to be displayed but the URL doesn't appear to match the URL template of any known page. \n\n#{caller.join("\n")}"
    end
  end
def expect_page ( page_arg ) p = page if p if p . class . name == page_arg . class . name return p elsif p . class == page_arg return p elsif page_arg . is_a? ( Symbol ) && p . class . name . underscore . to_sym == page_arg return p else raise SiteObject :: WrongPageError , "Expected #{page_arg} page to be displayed but the URL doesn't look right. \n\n#{caller.join("\n")}" end else raise SiteObject :: WrongPageError , "Expected #{page_arg} page to be displayed but the URL doesn't appear to match the URL template of any known page. \n\n#{caller.join("\n")}" end end
Helper method designed to assist with complex workflows.
Helper method designed to assist with complex workflows .
# Do this if it looks like an instance of a page. # Do this if it looks like a page class name.
page_arg
<not_specific>