class Insite::UndefinedPage

Attributes

arguments[R]
browser[R]
component_elements[R]
has_fragment[R]
page_attributes[R]
page_elements[R]
page_features[R]
page_url[R]
required_arguments[R]
site[R]
url_matcher[R]
url_template[R]

Public Class Methods

new(site) click to toggle source
# File lib/insite/page/undefined_page.rb, line 23
def initialize(site)
  @site    = site
  @browser = process_browser
  @url     = @site.browser.url
end

Public Instance Methods

defined?() click to toggle source

Always returns false.

# File lib/insite/page/undefined_page.rb, line 11
def defined?
  false
end
driver() click to toggle source
# File lib/insite/page/undefined_page.rb, line 15
def driver
  @browser.driver
end
html() click to toggle source
# File lib/insite/page/undefined_page.rb, line 19
def html
  @browser.html
end
method_missing(mth, *args, &block) click to toggle source

TODO: Do the same cache check that's done for a defined page and reapply the method if the cache is updated and the new page DOES respond to the method.

# File lib/insite/page/undefined_page.rb, line 31
def method_missing(mth, *args, &block)
  raise NoMethodError, "Could not apply #{mth}. The current page couldn't " \
  "be recognized. Current URL #{@browser.url}"
end
nokogiri() click to toggle source

Returns a Nokogiri object for the page HTML.

# File lib/insite/page/undefined_page.rb, line 37
def nokogiri
  Nokogiri::HTML(html)
end
on_page?() click to toggle source

Similar to the method that you can call on a page object you've defined (but always returns false since the Undefined page class is only returned when the current page doesn't match up to any page that you've actually defined.

# File lib/insite/page/undefined_page.rb, line 44
def on_page?
  false
end
title() click to toggle source

Returns the page title displayed by the browser.

# File lib/insite/page/undefined_page.rb, line 60
def title
  @browser.title
end
url() click to toggle source

Returns the current URL.

# File lib/insite/page/undefined_page.rb, line 55
def url
  @browser.url
end