Module: AutomationObject::Driver

Defined in:
lib/automation_object/driver.rb,
lib/automation_object/driver/base.rb,
lib/automation_object/driver/driver.rb,
lib/automation_object/driver/element.rb,
lib/automation_object/driver/appium_adapter/driver.rb,
lib/automation_object/driver/nokogiri_adapter/form.rb,
lib/automation_object/driver/appium_adapter/element.rb,
lib/automation_object/driver/common_selenium/driver.rb,
lib/automation_object/driver/nokogiri_adapter/error.rb,
lib/automation_object/driver/common_selenium/element.rb,
lib/automation_object/driver/nokogiri_adapter/driver.rb,
lib/automation_object/driver/nokogiri_adapter/window.rb,
lib/automation_object/driver/selenium_adapter/driver.rb,
lib/automation_object/driver/nokogiri_adapter/element.rb,
lib/automation_object/driver/nokogiri_adapter/request.rb,
lib/automation_object/driver/nokogiri_adapter/session.rb,
lib/automation_object/driver/selenium_adapter/element.rb,
lib/automation_object/driver/common_selenium/element_geometry.rb

Overview

Driver Port

Defined Under Namespace

Modules: AppiumAdapter, CommonSelenium, NokogiriAdapter, SeleniumAdapter Classes: Base, BoxCoordinates, Dimension, Driver, Element, Point

Class Method Summary collapse

Class Method Details

.adapterObject



20
21
22
23
24
# File 'lib/automation_object/driver.rb', line 20

def adapter
  return @adapter if @adapter
  self.adapter = :nokogiri
  @adapter
end

.adapter=(adapter_name) ⇒ Object

Sets adapter const will append _adapter if needed

Parameters:

  • adapter_name (String)

    name of adapter wanted for composite creation



28
29
30
31
32
33
34
# File 'lib/automation_object/driver.rb', line 28

def adapter=(adapter_name)
  adapter_name = adapter_name.to_s
  adapter_name << '_adapter' unless adapter_name =~ /_adapter$/
  adapter_const = adapter_name.pascalize

  @adapter = AutomationObject::Driver.const_get(adapter_const.to_s)::Driver
end

.create(driver = nil) ⇒ AutomationObject::Driver::Driver

Parameters:

  • driver (Object) (defaults to: nil)

    selenium or appium driver. default nil for Nokogiri

Returns:



38
39
40
41
42
43
44
45
# File 'lib/automation_object/driver.rb', line 38

def create(driver = nil)
  adapted_driver = Driver.new(adapter.new(driver))

  # Add throttling and mutex proxies around adapter
  AutomationObject::Proxy::MutexProxy.new(
    AutomationObject::Proxy::ThrottleProxy.new(adapted_driver)
  )
end