Module: PageObjectPal

Extended by:
PageObjectPal
Includes:
Diff, Elements
Included in:
PageObjectPal
Defined in:
lib/page-object-pal.rb,
lib/page-object-pal/diff.rb,
lib/page-object-pal/version.rb,
lib/page-object-pal/elements.rb,
lib/page-object-pal/exceptions.rb

Overview

end

Defined Under Namespace

Modules: Diff, Elements Classes: AnchorError, CannotFindClass, PageObjectOutdated, SupportError

Constant Summary collapse

VERSION =
"0.1.1"

Instance Method Summary collapse

Methods included from Diff

#diff_page, #failure?, #scrub_source

Methods included from Elements

#dsl_to_html, #element_tag, #html_to_dsl, #parse_element, #parse_methods, #standard_tag

Instance Method Details

#examine(klass, path, url) ⇒ Boolean

Compare elements constructed by the PageObject::DSL to the elements in the URL’s source code.

Parameters:

  • Page (Class)

    object class to be tested

  • Path (String)

    to the file housing the class being tested

  • Page (String)

    URL

Returns:

  • (Boolean)

    True if no error is raised



44
45
46
47
# File 'lib/page-object-pal.rb', line 44

def examine(klass, path, url)
  diff_page(Nokogiri::HTML(open(url)), parse_class(klass, path))
  success!
end