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.



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

def initialize(delegate, listener)
  @delegate = delegate

  @listener = if listener.respond_to? :call
                BlockEventListener.new(listener)
              else
                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.



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

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

Instance Method Details

#clear_element(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.



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

def clear_element(ref)
  dispatch(:change_value_of, create_element(ref), driver) do
    @delegate.clear_element(ref)
  end
end

#click_element(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.



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

def click_element(ref)
  dispatch(:click, create_element(ref), driver) do
    @delegate.click_element(ref)
  end
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.



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

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

#execute_script(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.



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

def execute_script(script, *args)
  dispatch(:execute_script, script, driver) do
    @delegate.execute_script(script, *args)
  end
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.



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

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

  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.



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

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

  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.



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

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

#go_backObject

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.



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

def go_back
  dispatch(:navigate_back, driver) do
    @delegate.go_back
  end
end

#go_forwardObject

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.



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

def go_forward
  dispatch(:navigate_forward, driver) do
    @delegate.go_forward
  end
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.



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

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

#send_keys_to_element(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.



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

def send_keys_to_element(ref, keys)
  dispatch(:change_value_of, create_element(ref), driver) do
    @delegate.send_keys_to_element(ref, keys)
  end
end