Class: Selenium::WebDriver::Support::EventFiringBridge Private

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/webdriver/support/event_firing_bridge.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(delegate, listener) ⇒ EventFiringBridge

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of EventFiringBridge.



27
28
29
30
31
32
33
34
35
# File 'lib/selenium/webdriver/support/event_firing_bridge.rb', line 27

def initialize(delegate, listener)
  @delegate = delegate

  if listener.respond_to? :call
    @listener = BlockEventListener.new(listener)
  else
    @listener = listener
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &blk) ⇒ Object (private)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



122
123
124
# File 'lib/selenium/webdriver/support/event_firing_bridge.rb', line 122

def method_missing(meth, *args, &blk)
  @delegate.__send__(meth, *args, &blk)
end

Instance Method Details

#clearElement(ref) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



61
62
63
64
65
# File 'lib/selenium/webdriver/support/event_firing_bridge.rb', line 61

def clearElement(ref)
  dispatch(:change_value_of, create_element(ref), driver) {
    @delegate.clearElement(ref)
  }
end

#clickElement(ref) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



55
56
57
58
59
# File 'lib/selenium/webdriver/support/event_firing_bridge.rb', line 55

def clickElement(ref)
  dispatch(:click, create_element(ref), driver) {
    @delegate.clickElement(ref)
  }
end

#closeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



99
100
101
# File 'lib/selenium/webdriver/support/event_firing_bridge.rb', line 99

def close
  dispatch(:close, driver) { @delegate.close }
end

#executeScript(script, *args) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



89
90
91
92
93
# File 'lib/selenium/webdriver/support/event_firing_bridge.rb', line 89

def executeScript(script, *args)
  dispatch(:execute_script, script, driver) {
    @delegate.executeScript(script, *args)
  }
end

#find_element_by(how, what, parent = nil) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



73
74
75
76
77
78
79
# File 'lib/selenium/webdriver/support/event_firing_bridge.rb', line 73

def find_element_by(how, what, parent = nil)
  e = dispatch(:find, how, what, driver) {
    @delegate.find_element_by how, what, parent
  }

  Element.new self, e.ref
end

#find_elements_by(how, what, parent = nil) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



81
82
83
84
85
86
87
# File 'lib/selenium/webdriver/support/event_firing_bridge.rb', line 81

def find_elements_by(how, what, parent = nil)
  es = dispatch(:find, how, what, driver) {
    @delegate.find_elements_by(how, what, parent)
  }

  es.map { |e| Element.new self, e.ref }
end

#get(url) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



37
38
39
40
41
# File 'lib/selenium/webdriver/support/event_firing_bridge.rb', line 37

def get(url)
  dispatch(:navigate_to, url, driver) {
    @delegate.get(url)
  }
end

#goBackObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



49
50
51
52
53
# File 'lib/selenium/webdriver/support/event_firing_bridge.rb', line 49

def goBack
  dispatch(:navigate_back, driver) {
    @delegate.goBack
  }
end

#goForwardObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



43
44
45
46
47
# File 'lib/selenium/webdriver/support/event_firing_bridge.rb', line 43

def goForward
  dispatch(:navigate_forward, driver) {
    @delegate.goForward
  }
end

#quitObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



95
96
97
# File 'lib/selenium/webdriver/support/event_firing_bridge.rb', line 95

def quit
  dispatch(:quit, driver) { @delegate.quit }
end

#sendKeysToElement(ref, keys) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



67
68
69
70
71
# File 'lib/selenium/webdriver/support/event_firing_bridge.rb', line 67

def sendKeysToElement(ref, keys)
  dispatch(:change_value_of, create_element(ref), driver) {
    @delegate.sendKeysToElement(ref, keys)
  }
end