Class: Test::Right::BrowserDriver

Inherits:
Object
  • Object
show all
Defined in:
lib/test/right/browser_driver.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ BrowserDriver

Returns a new instance of BrowserDriver.



6
7
8
9
10
11
12
# File 'lib/test/right/browser_driver.rb', line 6

def initialize(config)
  @base_url = config[:base_url]
  if @base_url =~ /\/$/
    @base_url = @base_url[0..-2]
  end
  @driver = Selenium::WebDriver.for :firefox
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object (private)



29
30
31
# File 'lib/test/right/browser_driver.rb', line 29

def method_missing(name, *args)
  @driver.send(name, *args)
end

Instance Method Details

#get(url, options = {}) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/test/right/browser_driver.rb', line 14

def get(url, options = {})
  if options[:relative]
    @driver.get(relative_url(url))
  else
    @driver.get(url)
  end
end