Class: WebDriverScriptAdapter::FrameAdapter::WatirAdapter

Inherits:
DumbDelegator
  • Object
show all
Defined in:
lib/webdriver_script_adapter/frame_adapter.rb

Instance Method Summary collapse

Constructor Details

#initialize(driver) ⇒ WatirAdapter

Returns a new instance of WatirAdapter.



20
21
22
23
# File 'lib/webdriver_script_adapter/frame_adapter.rb', line 20

def initialize(driver)
  super(driver)
  @driver = driver
end

Instance Method Details

#find_framesObject



30
31
32
# File 'lib/webdriver_script_adapter/frame_adapter.rb', line 30

def find_frames
  find_elements(:css, "iframe")
end

#within_frame(frame, &block) ⇒ Object

delegate to Watir’s Selenium #driver



26
27
28
# File 'lib/webdriver_script_adapter/frame_adapter.rb', line 26

def within_frame(frame, &block)
  SeleniumAdapter.instance_method(:within_frame).bind(FrameAdapter.wrap @driver).call(frame, &block)
end