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.



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

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.



124
125
126
# File 'lib/selenium/webdriver/support/event_firing_bridge.rb', line 124

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.



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

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.



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

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.



101
102
103
# File 'lib/selenium/webdriver/support/event_firing_bridge.rb', line 101

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.



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

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.



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

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.



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

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.



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

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.



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

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.



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

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.



97
98
99
# File 'lib/selenium/webdriver/support/event_firing_bridge.rb', line 97

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.



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

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