Class: WebDriverScriptAdapter::QuerySelectorAdapter

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.wrap(driver) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/webdriver_script_adapter/query_selector_adapter.rb', line 5

def self.wrap(driver)
  # capybara: all(<tag>) but also seems to support all(:css, <tag>)
  # watir: elements(:css); also supports #iframes
  # selenium: find_elements(:css, <tag>); aliased as all

  driver.respond_to?(:find_elements) ? driver : new(driver)
end

Instance Method Details

#find_elements(*args) ⇒ Object



13
14
15
# File 'lib/webdriver_script_adapter/query_selector_adapter.rb', line 13

def find_elements(*args)
  respond_to?(:elements) ? elements(*args) : all(*args)
end