Class: Appium::Core::Base::BiDiBridge
- Inherits:
-
Bridge
- Object
- Selenium::WebDriver::Remote::Bridge
- Bridge
- Appium::Core::Base::BiDiBridge
show all
- Defined in:
- lib/appium_lib_core/common/base/bidi_bridge.rb
Constant Summary
Constants inherited
from Bridge
Appium::Core::Base::Bridge::APPIUM_NATIVE_BROWSER_NAME, Appium::Core::Base::Bridge::APPIUM_PREFIX
Instance Attribute Summary collapse
Attributes inherited from Bridge
#available_commands
Instance Method Summary
collapse
Methods inherited from Bridge
#action, #add_appium_prefix, #add_command, #attach_to, #available_log_types, #browser, #commands, #convert_to_element, #element_attribute, #element_displayed?, #element_screenshot, #get_timeouts, #location, #log, #log_event, #log_events, #send_command, #set_location, #status, #viewport_screenshot
Instance Attribute Details
#bidi ⇒ Object
Returns the value of attribute bidi.
21
22
23
|
# File 'lib/appium_lib_core/common/base/bidi_bridge.rb', line 21
def bidi
@bidi
end
|
Instance Method Details
#close ⇒ Object
84
85
86
|
# File 'lib/appium_lib_core/common/base/bidi_bridge.rb', line 84
def close
execute(:close_window).tap { |handles| bidi.close if handles.empty? }
end
|
Override Creates session handling.
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# File 'lib/appium_lib_core/common/base/bidi_bridge.rb', line 46
def create_session(capabilities)
super
return @capabilities if @capabilities.nil?
begin
socket_url = @capabilities[:web_socket_url]
@bidi = ::Selenium::WebDriver::BiDi.new(url: socket_url) if socket_url
rescue StandardError => e
::Appium::Logger.warn "WebSocket connection to #{socket_url} for BiDi failed. Error #{e}"
raise
end
@capabilities
end
|
#get(url) ⇒ Object
62
63
64
|
# File 'lib/appium_lib_core/common/base/bidi_bridge.rb', line 62
def get(url)
browsing_context.navigate(url)
end
|
#go_back ⇒ Object
66
67
68
|
# File 'lib/appium_lib_core/common/base/bidi_bridge.rb', line 66
def go_back
browsing_context.traverse_history(-1)
end
|
#go_forward ⇒ Object
70
71
72
|
# File 'lib/appium_lib_core/common/base/bidi_bridge.rb', line 70
def go_forward
browsing_context.traverse_history(1)
end
|
#quit ⇒ Object
78
79
80
81
82
|
# File 'lib/appium_lib_core/common/base/bidi_bridge.rb', line 78
def quit
super
ensure
bidi.close
end
|
#refresh ⇒ Object
74
75
76
|
# File 'lib/appium_lib_core/common/base/bidi_bridge.rb', line 74
def refresh
browsing_context.reload
end
|