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

Inherits:
Object
  • Object
show all
Defined in:
rb/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.



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

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) ⇒ 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.

rubocop:disable Style/MissingRespondToMissing



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

def method_missing(meth, ...) # rubocop:disable Style/MissingRespondToMissing
  @delegate.__send__(meth, ...)
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.



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

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.



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

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.



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

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.



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

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.



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

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.last
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.



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

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.last }
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.



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

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.



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

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.



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

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.



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

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.



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

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