Module: AePageObjects::Concerns::Visitable::VisitMethod

Defined in:
lib/ae_page_objects/concerns/visitable.rb

Instance Method Summary collapse

Instance Method Details

#visit(*args) ⇒ Object

Raises:



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/ae_page_objects/concerns/visitable.rb', line 24

def visit(*args)
  args = args.dup
  inner_options = args.last.is_a?(::Hash)? args.last : {}

  path = inner_options.delete(:via) || paths.first

  full_path = site.generate_path(path, *args)
  raise PathNotResolvable, "#{self.name} not visitable via #{paths.first}(#{args.inspect})" unless full_path

  Capybara.current_session.visit(full_path)
  new
end