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
-
#initialize(browser, component_locator) ⇒ ScopedBrowser
constructor
A new instance of ScopedBrowser.
Constructor Details
#initialize(browser, component_locator) ⇒ ScopedBrowser
Returns a new instance of 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 |