Class: E2E::Session

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/e2e/session.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(driver_name = E2E.config.driver) ⇒ Session

Returns a new instance of Session.



13
14
15
# File 'lib/e2e/session.rb', line 13

def initialize(driver_name = E2E.config.driver)
  @driver = initialize_driver(driver_name)
end

Instance Attribute Details

#driverObject (readonly)

Returns the value of attribute driver.



9
10
11
# File 'lib/e2e/session.rb', line 9

def driver
  @driver
end

Instance Method Details

#allObject



21
22
23
# File 'lib/e2e/session.rb', line 21

def all(...)
  @driver.all(...)
end

#findObject



17
18
19
# File 'lib/e2e/session.rb', line 17

def find(...)
  @driver.find(...)
end

#visit(url) ⇒ Object



25
26
27
28
29
30
# File 'lib/e2e/session.rb', line 25

def visit(url)
  if url.start_with?("/") && E2E.server
    url = "#{E2E.server.base_url}#{url}"
  end
  @driver.visit(url)
end