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.



10
11
12
13
14
15
16
17
18
# File 'lib/selenium/webdriver/support/event_firing_bridge.rb', line 10

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.



105
106
107
# File 'lib/selenium/webdriver/support/event_firing_bridge.rb', line 105

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.



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

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.



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

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.



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

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.



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

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.



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

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.



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

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.



20
21
22
23
24
# File 'lib/selenium/webdriver/support/event_firing_bridge.rb', line 20

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.



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

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.



26
27
28
29
30
# File 'lib/selenium/webdriver/support/event_firing_bridge.rb', line 26

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.



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

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.



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

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