Module: CapybaraPageObject::ClassMethods

Included in:
Page
Defined in:
lib/capybara-page-object/page.rb

Instance Method Summary collapse

Instance Method Details

#current?Boolean

Returns:

  • (Boolean)


36
37
38
39
# File 'lib/capybara-page-object/page.rb', line 36

def current?
  page = new
  page.source.current_path == page.root_path + page.path
end

#from_string(string, target) ⇒ Object



32
33
34
# File 'lib/capybara-page-object/page.rb', line 32

def from_string(string, target)
  new(Capybara.string(string).find(target))
end

#visit(attr = nil) ⇒ Object



41
42
43
44
45
# File 'lib/capybara-page-object/page.rb', line 41

def visit(attr=nil)
  page = new
  page.visit_path(attr)
  page
end