Class: WebDriverScriptAdapter::FrameAdapter

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

Defined Under Namespace

Classes: CapybaraAdapter, ParentlessFrameAdapter, SeleniumAdapter, WatirAdapter

Class Method Summary collapse

Class Method Details

.wrap(driver) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/webdriver_script_adapter/frame_adapter.rb', line 5

def self.wrap(driver)
  if driver.respond_to?(:find_css)
    CapybaraAdapter.new driver
  elsif !driver.respond_to?(:switch_to)
    WatirAdapter.new driver
  elsif driver.switch_to.respond_to?(:parent_frame)
    SeleniumAdapter.new driver # add within_frame to selenium
  else
    ParentlessFrameAdapter.new driver # old selenium doesn't support parent_frame
  end
end