Class: Kookaburra::UIDriver::ScopedBrowser

Inherits:
BasicObject
Defined in:
lib/kookaburra/ui_driver/scoped_browser.rb

Overview

Wraps a Kookaburra browser object and changes all method calls to that object so that they are scoped within the specified #component_locator.

Instance Method Summary collapse

Constructor Details

#initialize(browser, component_locator) ⇒ ScopedBrowser



16
17
18
19
# File 'lib/kookaburra/ui_driver/scoped_browser.rb', line 16

def initialize(browser, component_locator)
  @browser = browser
  @component_locator = component_locator
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



27
28
29
30
31
# File 'lib/kookaburra/ui_driver/scoped_browser.rb', line 27

def method_missing(name, *args, &blk)
  @browser.within(component_locator) do
    @browser.send(name, *args, &blk)
  end
end