Class: Test::Right::BrowserDriver
- Inherits:
-
Object
- Object
- Test::Right::BrowserDriver
- Defined in:
- lib/test/right/browser_driver.rb
Instance Method Summary collapse
- #get(url, options = {}) ⇒ Object
-
#initialize(config) ⇒ BrowserDriver
constructor
A new instance of BrowserDriver.
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, = {}) if [:relative] @driver.get(relative_url(url)) else @driver.get(url) end end |