selenium-webdriver 4.48.0 → 4.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +21 -0
  3. data/Gemfile +0 -0
  4. data/LICENSE +0 -0
  5. data/NOTICE +0 -0
  6. data/README.md +0 -0
  7. data/bin/linux-arm64/selenium-manager +0 -0
  8. data/bin/{linux → linux-x86_64}/selenium-manager +0 -0
  9. data/bin/macos/selenium-manager +0 -0
  10. data/bin/selenium-manager-THIRD-PARTY-NOTICES.txt +327 -51
  11. data/bin/selenium-manager.cdx.json +491 -491
  12. data/bin/windows/selenium-manager.exe +0 -0
  13. data/lib/selenium/server.rb +0 -0
  14. data/lib/selenium/webdriver/atoms/findElements.js +14 -2
  15. data/lib/selenium/webdriver/atoms.rb +0 -0
  16. data/lib/selenium/webdriver/bidi/browser.rb +0 -0
  17. data/lib/selenium/webdriver/bidi/browsing_context.rb +0 -0
  18. data/lib/selenium/webdriver/bidi/error.rb +0 -0
  19. data/lib/selenium/webdriver/bidi/log_handler.rb +0 -0
  20. data/lib/selenium/webdriver/bidi/network/cookies.rb +0 -0
  21. data/lib/selenium/webdriver/bidi/network/credentials.rb +0 -0
  22. data/lib/selenium/webdriver/bidi/network/headers.rb +0 -0
  23. data/lib/selenium/webdriver/bidi/network/intercepted_auth.rb +0 -0
  24. data/lib/selenium/webdriver/bidi/network/intercepted_item.rb +0 -0
  25. data/lib/selenium/webdriver/bidi/network/intercepted_request.rb +0 -0
  26. data/lib/selenium/webdriver/bidi/network/intercepted_response.rb +0 -0
  27. data/lib/selenium/webdriver/bidi/network/url_pattern.rb +0 -0
  28. data/lib/selenium/webdriver/bidi/network.rb +0 -0
  29. data/lib/selenium/webdriver/bidi/protocol/bluetooth.rb +27 -23
  30. data/lib/selenium/webdriver/bidi/protocol/browser.rb +0 -0
  31. data/lib/selenium/webdriver/bidi/protocol/browsing_context.rb +78 -7
  32. data/lib/selenium/webdriver/bidi/protocol/digital_credentials.rb +69 -0
  33. data/lib/selenium/webdriver/bidi/protocol/domain.rb +0 -0
  34. data/lib/selenium/webdriver/bidi/protocol/emulation.rb +303 -6
  35. data/lib/selenium/webdriver/bidi/protocol/error_code.rb +0 -0
  36. data/lib/selenium/webdriver/bidi/protocol/input.rb +0 -0
  37. data/lib/selenium/webdriver/bidi/protocol/log.rb +0 -0
  38. data/lib/selenium/webdriver/bidi/protocol/moz_debugging.rb +334 -0
  39. data/lib/selenium/webdriver/bidi/protocol/moz_profiler.rb +108 -0
  40. data/lib/selenium/webdriver/bidi/protocol/network.rb +0 -0
  41. data/lib/selenium/webdriver/bidi/protocol/permissions.rb +0 -0
  42. data/lib/selenium/webdriver/bidi/protocol/script.rb +0 -0
  43. data/lib/selenium/webdriver/bidi/protocol/session.rb +0 -0
  44. data/lib/selenium/webdriver/bidi/protocol/speculation.rb +0 -0
  45. data/lib/selenium/webdriver/bidi/protocol/storage.rb +0 -0
  46. data/lib/selenium/webdriver/bidi/protocol/user_agent_client_hints.rb +0 -0
  47. data/lib/selenium/webdriver/bidi/protocol/web_extension.rb +41 -5
  48. data/lib/selenium/webdriver/bidi/protocol.rb +3 -0
  49. data/lib/selenium/webdriver/bidi/serialization/record.rb +0 -0
  50. data/lib/selenium/webdriver/bidi/serialization/union.rb +0 -0
  51. data/lib/selenium/webdriver/bidi/serialization.rb +0 -0
  52. data/lib/selenium/webdriver/bidi/session.rb +0 -0
  53. data/lib/selenium/webdriver/bidi/struct.rb +0 -0
  54. data/lib/selenium/webdriver/bidi/support/bidi_generate.rb +175 -50
  55. data/lib/selenium/webdriver/bidi/support/check_generated.rb +0 -0
  56. data/lib/selenium/webdriver/bidi/transport.rb +0 -0
  57. data/lib/selenium/webdriver/bidi.rb +0 -0
  58. data/lib/selenium/webdriver/chrome/driver.rb +0 -0
  59. data/lib/selenium/webdriver/chrome/features.rb +0 -0
  60. data/lib/selenium/webdriver/chrome/options.rb +0 -0
  61. data/lib/selenium/webdriver/chrome/profile.rb +0 -0
  62. data/lib/selenium/webdriver/chrome/service.rb +0 -0
  63. data/lib/selenium/webdriver/chrome.rb +0 -0
  64. data/lib/selenium/webdriver/chromium/driver.rb +0 -0
  65. data/lib/selenium/webdriver/chromium/features.rb +0 -0
  66. data/lib/selenium/webdriver/chromium/options.rb +0 -0
  67. data/lib/selenium/webdriver/chromium/profile.rb +0 -0
  68. data/lib/selenium/webdriver/chromium.rb +0 -0
  69. data/lib/selenium/webdriver/common/action_builder.rb +0 -0
  70. data/lib/selenium/webdriver/common/alert.rb +0 -0
  71. data/lib/selenium/webdriver/common/child_process.rb +0 -0
  72. data/lib/selenium/webdriver/common/client_config.rb +0 -0
  73. data/lib/selenium/webdriver/common/driver.rb +24 -0
  74. data/lib/selenium/webdriver/common/driver_extensions/downloads_files.rb +0 -0
  75. data/lib/selenium/webdriver/common/driver_extensions/full_page_screenshot.rb +0 -0
  76. data/lib/selenium/webdriver/common/driver_extensions/has_addons.rb +2 -0
  77. data/lib/selenium/webdriver/common/driver_extensions/has_apple_permissions.rb +0 -0
  78. data/lib/selenium/webdriver/common/driver_extensions/has_authentication.rb +0 -0
  79. data/lib/selenium/webdriver/common/driver_extensions/has_casting.rb +0 -0
  80. data/lib/selenium/webdriver/common/driver_extensions/has_cdp.rb +0 -0
  81. data/lib/selenium/webdriver/common/driver_extensions/has_context.rb +0 -0
  82. data/lib/selenium/webdriver/common/driver_extensions/has_debugger.rb +0 -0
  83. data/lib/selenium/webdriver/common/driver_extensions/has_devtools.rb +0 -0
  84. data/lib/selenium/webdriver/common/driver_extensions/has_fedcm_dialog.rb +0 -0
  85. data/lib/selenium/webdriver/common/driver_extensions/has_file_downloads.rb +0 -0
  86. data/lib/selenium/webdriver/common/driver_extensions/has_launching.rb +0 -0
  87. data/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb +0 -0
  88. data/lib/selenium/webdriver/common/driver_extensions/has_logs.rb +0 -0
  89. data/lib/selenium/webdriver/common/driver_extensions/has_network_conditions.rb +0 -0
  90. data/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb +0 -0
  91. data/lib/selenium/webdriver/common/driver_extensions/has_permissions.rb +0 -0
  92. data/lib/selenium/webdriver/common/driver_extensions/has_pinned_scripts.rb +0 -0
  93. data/lib/selenium/webdriver/common/driver_extensions/has_session_events.rb +0 -0
  94. data/lib/selenium/webdriver/common/driver_extensions/has_session_id.rb +0 -0
  95. data/lib/selenium/webdriver/common/driver_extensions/prints_page.rb +0 -0
  96. data/lib/selenium/webdriver/common/driver_extensions/uploads_files.rb +0 -0
  97. data/lib/selenium/webdriver/common/driver_finder.rb +0 -0
  98. data/lib/selenium/webdriver/common/element.rb +0 -0
  99. data/lib/selenium/webdriver/common/error.rb +0 -0
  100. data/lib/selenium/webdriver/common/fedcm/account.rb +0 -0
  101. data/lib/selenium/webdriver/common/fedcm/dialog.rb +0 -0
  102. data/lib/selenium/webdriver/common/fedcm.rb +0 -0
  103. data/lib/selenium/webdriver/common/file_reaper.rb +0 -0
  104. data/lib/selenium/webdriver/common/interactions/input_device.rb +0 -0
  105. data/lib/selenium/webdriver/common/interactions/interaction.rb +0 -0
  106. data/lib/selenium/webdriver/common/interactions/interactions.rb +0 -0
  107. data/lib/selenium/webdriver/common/interactions/key_actions.rb +0 -0
  108. data/lib/selenium/webdriver/common/interactions/key_input.rb +0 -0
  109. data/lib/selenium/webdriver/common/interactions/none_input.rb +0 -0
  110. data/lib/selenium/webdriver/common/interactions/pause.rb +0 -0
  111. data/lib/selenium/webdriver/common/interactions/pointer_actions.rb +0 -0
  112. data/lib/selenium/webdriver/common/interactions/pointer_cancel.rb +0 -0
  113. data/lib/selenium/webdriver/common/interactions/pointer_event_properties.rb +0 -0
  114. data/lib/selenium/webdriver/common/interactions/pointer_input.rb +0 -0
  115. data/lib/selenium/webdriver/common/interactions/pointer_move.rb +0 -0
  116. data/lib/selenium/webdriver/common/interactions/pointer_press.rb +0 -0
  117. data/lib/selenium/webdriver/common/interactions/scroll.rb +0 -0
  118. data/lib/selenium/webdriver/common/interactions/scroll_origin.rb +0 -0
  119. data/lib/selenium/webdriver/common/interactions/typing_interaction.rb +0 -0
  120. data/lib/selenium/webdriver/common/interactions/wheel_actions.rb +0 -0
  121. data/lib/selenium/webdriver/common/interactions/wheel_input.rb +0 -0
  122. data/lib/selenium/webdriver/common/keys.rb +0 -0
  123. data/lib/selenium/webdriver/common/local_driver.rb +0 -0
  124. data/lib/selenium/webdriver/common/log_entry.rb +0 -0
  125. data/lib/selenium/webdriver/common/logger.rb +0 -0
  126. data/lib/selenium/webdriver/common/logs.rb +0 -0
  127. data/lib/selenium/webdriver/common/manager.rb +0 -0
  128. data/lib/selenium/webdriver/common/navigation.rb +0 -0
  129. data/lib/selenium/webdriver/common/network.rb +0 -0
  130. data/lib/selenium/webdriver/common/options.rb +0 -0
  131. data/lib/selenium/webdriver/common/platform.rb +0 -0
  132. data/lib/selenium/webdriver/common/port_prober.rb +0 -0
  133. data/lib/selenium/webdriver/common/print_options.rb +0 -0
  134. data/lib/selenium/webdriver/common/profile_helper.rb +0 -0
  135. data/lib/selenium/webdriver/common/proxy.rb +0 -0
  136. data/lib/selenium/webdriver/common/script.rb +0 -0
  137. data/lib/selenium/webdriver/common/search_context.rb +0 -0
  138. data/lib/selenium/webdriver/common/selenium_manager.rb +6 -2
  139. data/lib/selenium/webdriver/common/service.rb +0 -0
  140. data/lib/selenium/webdriver/common/service_manager.rb +0 -0
  141. data/lib/selenium/webdriver/common/shadow_root.rb +0 -0
  142. data/lib/selenium/webdriver/common/socket_lock.rb +0 -0
  143. data/lib/selenium/webdriver/common/socket_poller.rb +0 -0
  144. data/lib/selenium/webdriver/common/takes_screenshot.rb +0 -0
  145. data/lib/selenium/webdriver/common/target_locator.rb +0 -0
  146. data/lib/selenium/webdriver/common/timeouts.rb +0 -0
  147. data/lib/selenium/webdriver/common/virtual_authenticator/credential.rb +0 -0
  148. data/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb +0 -0
  149. data/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator_options.rb +0 -0
  150. data/lib/selenium/webdriver/common/wait.rb +0 -0
  151. data/lib/selenium/webdriver/common/web_extension.rb +42 -0
  152. data/lib/selenium/webdriver/common/websocket_connection.rb +2 -2
  153. data/lib/selenium/webdriver/common/window.rb +0 -0
  154. data/lib/selenium/webdriver/common/zipper.rb +15 -11
  155. data/lib/selenium/webdriver/common.rb +1 -0
  156. data/lib/selenium/webdriver/devtools/console_event.rb +0 -0
  157. data/lib/selenium/webdriver/devtools/exception_event.rb +0 -0
  158. data/lib/selenium/webdriver/devtools/mutation_event.rb +0 -0
  159. data/lib/selenium/webdriver/devtools/network_interceptor.rb +0 -0
  160. data/lib/selenium/webdriver/devtools/pinned_script.rb +0 -0
  161. data/lib/selenium/webdriver/devtools/request.rb +0 -0
  162. data/lib/selenium/webdriver/devtools/response.rb +0 -0
  163. data/lib/selenium/webdriver/devtools.rb +0 -0
  164. data/lib/selenium/webdriver/edge/driver.rb +0 -0
  165. data/lib/selenium/webdriver/edge/features.rb +0 -0
  166. data/lib/selenium/webdriver/edge/options.rb +0 -0
  167. data/lib/selenium/webdriver/edge/profile.rb +0 -0
  168. data/lib/selenium/webdriver/edge/service.rb +0 -0
  169. data/lib/selenium/webdriver/edge.rb +0 -0
  170. data/lib/selenium/webdriver/firefox/driver.rb +0 -0
  171. data/lib/selenium/webdriver/firefox/features.rb +18 -7
  172. data/lib/selenium/webdriver/firefox/options.rb +0 -0
  173. data/lib/selenium/webdriver/firefox/profile.rb +0 -37
  174. data/lib/selenium/webdriver/firefox/profiles_ini.rb +0 -0
  175. data/lib/selenium/webdriver/firefox/service.rb +0 -0
  176. data/lib/selenium/webdriver/firefox/util.rb +0 -0
  177. data/lib/selenium/webdriver/firefox.rb +0 -2
  178. data/lib/selenium/webdriver/ie/driver.rb +0 -0
  179. data/lib/selenium/webdriver/ie/features.rb +0 -0
  180. data/lib/selenium/webdriver/ie/options.rb +0 -0
  181. data/lib/selenium/webdriver/ie/service.rb +0 -0
  182. data/lib/selenium/webdriver/ie.rb +0 -0
  183. data/lib/selenium/webdriver/remote/bidi_bridge.rb +23 -0
  184. data/lib/selenium/webdriver/remote/bridge/commands.rb +0 -0
  185. data/lib/selenium/webdriver/remote/bridge/locator_converter.rb +0 -0
  186. data/lib/selenium/webdriver/remote/bridge.rb +20 -6
  187. data/lib/selenium/webdriver/remote/capabilities.rb +0 -0
  188. data/lib/selenium/webdriver/remote/driver.rb +0 -0
  189. data/lib/selenium/webdriver/remote/features.rb +9 -8
  190. data/lib/selenium/webdriver/remote/http/common.rb +0 -0
  191. data/lib/selenium/webdriver/remote/http/curb.rb +0 -0
  192. data/lib/selenium/webdriver/remote/http/default.rb +0 -0
  193. data/lib/selenium/webdriver/remote/response.rb +0 -0
  194. data/lib/selenium/webdriver/remote/server_error.rb +0 -0
  195. data/lib/selenium/webdriver/remote.rb +0 -0
  196. data/lib/selenium/webdriver/safari/driver.rb +0 -0
  197. data/lib/selenium/webdriver/safari/features.rb +0 -0
  198. data/lib/selenium/webdriver/safari/options.rb +0 -0
  199. data/lib/selenium/webdriver/safari/service.rb +0 -0
  200. data/lib/selenium/webdriver/safari.rb +0 -0
  201. data/lib/selenium/webdriver/support/abstract_event_listener.rb +0 -0
  202. data/lib/selenium/webdriver/support/block_event_listener.rb +0 -0
  203. data/lib/selenium/webdriver/support/color.rb +0 -0
  204. data/lib/selenium/webdriver/support/escaper.rb +0 -0
  205. data/lib/selenium/webdriver/support/event_firing_bridge.rb +0 -0
  206. data/lib/selenium/webdriver/support/guards/guard.rb +0 -0
  207. data/lib/selenium/webdriver/support/guards/guard_condition.rb +0 -0
  208. data/lib/selenium/webdriver/support/guards.rb +0 -0
  209. data/lib/selenium/webdriver/support/relative_locator.rb +0 -0
  210. data/lib/selenium/webdriver/support/select.rb +0 -0
  211. data/lib/selenium/webdriver/support.rb +0 -0
  212. data/lib/selenium/webdriver/version.rb +1 -1
  213. data/lib/selenium/webdriver.rb +0 -0
  214. data/lib/selenium-webdriver.rb +0 -0
  215. data/selenium-webdriver.gemspec +0 -1
  216. metadata +9 -28
  217. data/lib/selenium/webdriver/firefox/extension.rb +0 -103
Binary file
File without changes
@@ -64,7 +64,16 @@
64
64
  if (target === '') {
65
65
  throw botError(INVALID_SELECTOR, 'Unable to locate an element with the tagName ""');
66
66
  }
67
- return Array.from(root.getElementsByTagName(target));
67
+ if ('getElementsByTagName' in root) {
68
+ return Array.from(root.getElementsByTagName(target));
69
+ }
70
+ const elements = Array.from(root.querySelectorAll('*'));
71
+ if (target === '*') {
72
+ return elements;
73
+ }
74
+ const html = 'http://www.w3.org/1999/xhtml';
75
+ const folded = target.toLowerCase();
76
+ return elements.filter(el => el.namespaceURI === html ? el.localName === folded : el.localName === target);
68
77
  }
69
78
  const DEFAULT_NS_RESOLVER = (function () {
70
79
  const ns = { svg: 'http://www.w3.org/2000/svg' };
@@ -147,7 +156,10 @@
147
156
  return resolveAnchor(selector());
148
157
  }
149
158
  if (selector && typeof selector === 'object') {
150
- const found = findElements(selector);
159
+ let found = root ? findElements(selector, root) : [];
160
+ if (!found.length) {
161
+ found = findElements(selector);
162
+ }
151
163
  if (!found.length) {
152
164
  throw botError(NO_SUCH_ELEMENT, 'No element has been found by ' + JSON.stringify(selector));
153
165
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -29,7 +29,9 @@ module Selenium
29
29
  class Bluetooth < Domain
30
30
  EVENTS = {
31
31
  request_device_prompt_updated: 'bluetooth.requestDevicePromptUpdated',
32
- gatt_connection_attempted: 'bluetooth.gattConnectionAttempted'
32
+ gatt_connection_attempted: 'bluetooth.gattConnectionAttempted',
33
+ characteristic_event_generated: 'bluetooth.characteristicEventGenerated',
34
+ descriptor_event_generated: 'bluetooth.descriptorEventGenerated'
33
35
  }.freeze
34
36
 
35
37
  SIMULATE_ADAPTER_PARAMETERS_STATE = {
@@ -80,7 +82,7 @@ module Selenium
80
82
 
81
83
  # @api private
82
84
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
83
- # @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothbluetoothmanufacturerdata
85
+ # @see https://bluetooth.spec.whatwg.org/#cddl-type-bluetoothbluetoothmanufacturerdata
84
86
  BluetoothManufacturerData = Serialization::Record.define(
85
87
  key: {wire_key: 'key', primitive: 'integer'},
86
88
  data: {wire_key: 'data', primitive: 'string'}
@@ -88,7 +90,7 @@ module Selenium
88
90
 
89
91
  # @api private
90
92
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
91
- # @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothcharacteristicproperties
93
+ # @see https://bluetooth.spec.whatwg.org/#cddl-type-bluetoothcharacteristicproperties
92
94
  CharacteristicProperties = Serialization::Record.define(
93
95
  broadcast: {wire_key: 'broadcast', required: false, primitive: 'boolean'},
94
96
  read: {wire_key: 'read', required: false, primitive: 'boolean'},
@@ -102,7 +104,7 @@ module Selenium
102
104
 
103
105
  # @api private
104
106
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
105
- # @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothrequestdeviceinfo
107
+ # @see https://bluetooth.spec.whatwg.org/#cddl-type-bluetoothrequestdeviceinfo
106
108
  RequestDeviceInfo = Serialization::Record.define(
107
109
  id: {wire_key: 'id', primitive: 'string'},
108
110
  name: {wire_key: 'name', nullable: true, primitive: 'string'}
@@ -110,7 +112,7 @@ module Selenium
110
112
 
111
113
  # @api private
112
114
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
113
- # @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothscanrecord
115
+ # @see https://bluetooth.spec.whatwg.org/#cddl-type-bluetoothscanrecord
114
116
  ScanRecord = Serialization::Record.define(
115
117
  name: {wire_key: 'name', required: false, primitive: 'string'},
116
118
  uuids: {wire_key: 'uuids', required: false, list: true},
@@ -125,7 +127,7 @@ module Selenium
125
127
 
126
128
  # @api private
127
129
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
128
- # @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothhandlerequestdevicepromptparameters
130
+ # @see https://bluetooth.spec.whatwg.org/#cddl-type-bluetoothhandlerequestdevicepromptparameters
129
131
  class HandleRequestDevicePromptParameters < Serialization::Union
130
132
  discriminator 'accept'
131
133
  variants(
@@ -157,7 +159,7 @@ module Selenium
157
159
 
158
160
  # @api private
159
161
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
160
- # @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothsimulateadapterparameters
162
+ # @see https://bluetooth.spec.whatwg.org/#cddl-type-bluetoothsimulateadapterparameters
161
163
  SimulateAdapterParameters = Serialization::Record.define(
162
164
  context: {wire_key: 'context', primitive: 'string'},
163
165
  le_supported: {wire_key: 'leSupported', required: false, primitive: 'boolean'},
@@ -166,14 +168,14 @@ module Selenium
166
168
 
167
169
  # @api private
168
170
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
169
- # @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothdisablesimulationparameters
171
+ # @see https://bluetooth.spec.whatwg.org/#cddl-type-bluetoothdisablesimulationparameters
170
172
  DisableSimulationParameters = Serialization::Record.define(
171
173
  context: {wire_key: 'context', primitive: 'string'}
172
174
  )
173
175
 
174
176
  # @api private
175
177
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
176
- # @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothsimulatepreconnectedperipheralparameters
178
+ # @see https://bluetooth.spec.whatwg.org/#cddl-type-bluetoothsimulatepreconnectedperipheralparameters
177
179
  SimulatePreconnectedPeripheralParameters = Serialization::Record.define(
178
180
  context: {wire_key: 'context', primitive: 'string'},
179
181
  address: {wire_key: 'address', primitive: 'string'},
@@ -184,7 +186,7 @@ module Selenium
184
186
 
185
187
  # @api private
186
188
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
187
- # @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothsimulateadvertisementparameters
189
+ # @see https://bluetooth.spec.whatwg.org/#cddl-type-bluetoothsimulateadvertisementparameters
188
190
  SimulateAdvertisementParameters = Serialization::Record.define(
189
191
  context: {wire_key: 'context', primitive: 'string'},
190
192
  scan_entry: {wire_key: 'scanEntry', ref: 'Bluetooth::SimulateAdvertisementScanEntryParameters'}
@@ -192,7 +194,7 @@ module Selenium
192
194
 
193
195
  # @api private
194
196
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
195
- # @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothsimulateadvertisementscanentryparameters
197
+ # @see https://bluetooth.spec.whatwg.org/#cddl-type-bluetoothsimulateadvertisementscanentryparameters
196
198
  SimulateAdvertisementScanEntryParameters = Serialization::Record.define(
197
199
  device_address: {wire_key: 'deviceAddress', primitive: 'string'},
198
200
  rssi: {wire_key: 'rssi', primitive: 'number'},
@@ -201,7 +203,7 @@ module Selenium
201
203
 
202
204
  # @api private
203
205
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
204
- # @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothsimulategattconnectionresponseparameters
206
+ # @see https://bluetooth.spec.whatwg.org/#cddl-type-bluetoothsimulategattconnectionresponseparameters
205
207
  SimulateGattConnectionResponseParameters = Serialization::Record.define(
206
208
  context: {wire_key: 'context', primitive: 'string'},
207
209
  address: {wire_key: 'address', primitive: 'string'},
@@ -210,7 +212,7 @@ module Selenium
210
212
 
211
213
  # @api private
212
214
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
213
- # @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothsimulategattdisconnectionparameters
215
+ # @see https://bluetooth.spec.whatwg.org/#cddl-type-bluetoothsimulategattdisconnectionparameters
214
216
  SimulateGattDisconnectionParameters = Serialization::Record.define(
215
217
  context: {wire_key: 'context', primitive: 'string'},
216
218
  address: {wire_key: 'address', primitive: 'string'}
@@ -218,7 +220,7 @@ module Selenium
218
220
 
219
221
  # @api private
220
222
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
221
- # @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothsimulateserviceparameters
223
+ # @see https://bluetooth.spec.whatwg.org/#cddl-type-bluetoothsimulateserviceparameters
222
224
  SimulateServiceParameters = Serialization::Record.define(
223
225
  context: {wire_key: 'context', primitive: 'string'},
224
226
  address: {wire_key: 'address', primitive: 'string'},
@@ -228,7 +230,7 @@ module Selenium
228
230
 
229
231
  # @api private
230
232
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
231
- # @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothsimulatecharacteristicparameters
233
+ # @see https://bluetooth.spec.whatwg.org/#cddl-type-bluetoothsimulatecharacteristicparameters
232
234
  SimulateCharacteristicParameters = Serialization::Record.define(
233
235
  context: {wire_key: 'context', primitive: 'string'},
234
236
  address: {wire_key: 'address', primitive: 'string'},
@@ -244,7 +246,7 @@ module Selenium
244
246
 
245
247
  # @api private
246
248
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
247
- # @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothsimulatecharacteristicresponseparameters
249
+ # @see https://bluetooth.spec.whatwg.org/#cddl-type-bluetoothsimulatecharacteristicresponseparameters
248
250
  SimulateCharacteristicResponseParameters = Serialization::Record.define(
249
251
  context: {wire_key: 'context', primitive: 'string'},
250
252
  address: {wire_key: 'address', primitive: 'string'},
@@ -257,7 +259,7 @@ module Selenium
257
259
 
258
260
  # @api private
259
261
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
260
- # @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothsimulatedescriptorparameters
262
+ # @see https://bluetooth.spec.whatwg.org/#cddl-type-bluetoothsimulatedescriptorparameters
261
263
  SimulateDescriptorParameters = Serialization::Record.define(
262
264
  context: {wire_key: 'context', primitive: 'string'},
263
265
  address: {wire_key: 'address', primitive: 'string'},
@@ -269,7 +271,7 @@ module Selenium
269
271
 
270
272
  # @api private
271
273
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
272
- # @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothsimulatedescriptorresponseparameters
274
+ # @see https://bluetooth.spec.whatwg.org/#cddl-type-bluetoothsimulatedescriptorresponseparameters
273
275
  SimulateDescriptorResponseParameters = Serialization::Record.define(
274
276
  context: {wire_key: 'context', primitive: 'string'},
275
277
  address: {wire_key: 'address', primitive: 'string'},
@@ -283,7 +285,7 @@ module Selenium
283
285
 
284
286
  # @api private
285
287
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
286
- # @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothrequestdevicepromptupdatedparameters
288
+ # @see https://bluetooth.spec.whatwg.org/#cddl-type-bluetoothrequestdevicepromptupdatedparameters
287
289
  RequestDevicePromptUpdatedParameters = Serialization::Record.define(
288
290
  context: {wire_key: 'context', primitive: 'string'},
289
291
  prompt: {wire_key: 'prompt', primitive: 'string'},
@@ -292,7 +294,7 @@ module Selenium
292
294
 
293
295
  # @api private
294
296
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
295
- # @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothgattconnectionattemptedparameters
297
+ # @see https://bluetooth.spec.whatwg.org/#cddl-type-bluetoothgattconnectionattemptedparameters
296
298
  GattConnectionAttemptedParameters = Serialization::Record.define(
297
299
  context: {wire_key: 'context', primitive: 'string'},
298
300
  address: {wire_key: 'address', primitive: 'string'}
@@ -300,7 +302,7 @@ module Selenium
300
302
 
301
303
  # @api private
302
304
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
303
- # @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothcharacteristiceventgeneratedparameters
305
+ # @see https://bluetooth.spec.whatwg.org/#cddl-type-bluetoothcharacteristiceventgeneratedparameters
304
306
  CharacteristicEventGeneratedParameters = Serialization::Record.define(
305
307
  context: {wire_key: 'context', primitive: 'string'},
306
308
  address: {wire_key: 'address', primitive: 'string'},
@@ -312,7 +314,7 @@ module Selenium
312
314
 
313
315
  # @api private
314
316
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
315
- # @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothdescriptoreventgeneratedparameters
317
+ # @see https://bluetooth.spec.whatwg.org/#cddl-type-bluetoothdescriptoreventgeneratedparameters
316
318
  DescriptorEventGeneratedParameters = Serialization::Record.define(
317
319
  context: {wire_key: 'context', primitive: 'string'},
318
320
  address: {wire_key: 'address', primitive: 'string'},
@@ -325,7 +327,9 @@ module Selenium
325
327
 
326
328
  EVENT_TYPES = {
327
329
  'bluetooth.requestDevicePromptUpdated' => Bluetooth::RequestDevicePromptUpdatedParameters,
328
- 'bluetooth.gattConnectionAttempted' => Bluetooth::GattConnectionAttemptedParameters
330
+ 'bluetooth.gattConnectionAttempted' => Bluetooth::GattConnectionAttemptedParameters,
331
+ 'bluetooth.characteristicEventGenerated' => Bluetooth::CharacteristicEventGeneratedParameters,
332
+ 'bluetooth.descriptorEventGenerated' => Bluetooth::DescriptorEventGeneratedParameters
329
333
  }.freeze
330
334
 
331
335
  def bluetooth_manufacturer_data(**) = BluetoothManufacturerData.new(**)
File without changes
@@ -81,6 +81,19 @@ module Selenium
81
81
  landscape: 'landscape'
82
82
  }.freeze
83
83
 
84
+ # @api private
85
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
86
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextbaseinfo
87
+ BaseInfo = Serialization::Record.define(
88
+ children: {wire_key: 'children', nullable: true, ref: 'BrowsingContext::Info', list: true},
89
+ client_window: {wire_key: 'clientWindow', primitive: 'string'},
90
+ context: {wire_key: 'context', primitive: 'string'},
91
+ original_opener: {wire_key: 'originalOpener', nullable: true, primitive: 'string'},
92
+ url: {wire_key: 'url', primitive: 'string'},
93
+ user_context: {wire_key: 'userContext', primitive: 'string'},
94
+ parent: {wire_key: 'parent', required: false, nullable: true, primitive: 'string'}
95
+ )
96
+
84
97
  # @api private
85
98
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
86
99
  # @see https://w3c.github.io/webdriver-bidi/#type-browsingContext-Info
@@ -91,7 +104,8 @@ module Selenium
91
104
  original_opener: {wire_key: 'originalOpener', nullable: true, primitive: 'string'},
92
105
  url: {wire_key: 'url', primitive: 'string'},
93
106
  user_context: {wire_key: 'userContext', primitive: 'string'},
94
- parent: {wire_key: 'parent', required: false, nullable: true, primitive: 'string'}
107
+ parent: {wire_key: 'parent', required: false, nullable: true, primitive: 'string'},
108
+ extensible: true
95
109
  )
96
110
 
97
111
  # @api private
@@ -209,7 +223,8 @@ module Selenium
209
223
  context: {wire_key: 'context', primitive: 'string'},
210
224
  origin: {wire_key: 'origin', required: false, enum: 'BrowsingContext::CAPTURE_SCREENSHOT_PARAMETERS_ORIGIN'},
211
225
  format: {wire_key: 'format', required: false, ref: 'BrowsingContext::ImageFormat'},
212
- clip: {wire_key: 'clip', required: false, ref: 'BrowsingContext::ClipRectangle'}
226
+ clip: {wire_key: 'clip', required: false, ref: 'BrowsingContext::ClipRectangle'},
227
+ image_size: {wire_key: 'imageSize', required: false, ref: 'BrowsingContext::ImageSize'}
213
228
  )
214
229
 
215
230
  # @api private
@@ -220,6 +235,14 @@ module Selenium
220
235
  quality: {wire_key: 'quality', required: false, primitive: 'number'}
221
236
  )
222
237
 
238
+ # @api private
239
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
240
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextimagesize
241
+ ImageSize = Serialization::Record.define(
242
+ max_width: {wire_key: 'maxWidth', required: false, primitive: 'integer'},
243
+ max_height: {wire_key: 'maxHeight', required: false, primitive: 'integer'}
244
+ )
245
+
223
246
  # @api private
224
247
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
225
248
  # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextcliprectangle
@@ -290,7 +313,8 @@ module Selenium
290
313
  # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextgettreeparameters
291
314
  GetTreeParameters = Serialization::Record.define(
292
315
  max_depth: {wire_key: 'maxDepth', required: false, primitive: 'integer'},
293
- root: {wire_key: 'root', required: false, primitive: 'string'}
316
+ root: {wire_key: 'root', required: false, primitive: 'string'},
317
+ extensible: true
294
318
  )
295
319
 
296
320
  # @api private
@@ -430,6 +454,7 @@ module Selenium
430
454
  # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextstartscreencastparameters
431
455
  StartScreencastParameters = Serialization::Record.define(
432
456
  context: {wire_key: 'context', primitive: 'string'},
457
+ destination_folder: {wire_key: 'destinationFolder', required: false, primitive: 'string'},
433
458
  mime_type: {wire_key: 'mimeType', required: false, primitive: 'string'},
434
459
  video: {wire_key: 'video', required: false, ref: 'BrowsingContext::MediaTrackConstraints'},
435
460
  audio: {wire_key: 'audio', required: false, primitive: 'boolean'}
@@ -561,8 +586,22 @@ module Selenium
561
586
  default_value: {wire_key: 'defaultValue', required: false, primitive: 'string'}
562
587
  )
563
588
 
589
+ # @api private
590
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
591
+ # @see https://w3c.github.io/webdriver-bidi/#cddl-type-browsingcontextcontextcreatedparameters
592
+ ContextCreatedParameters = Serialization::Record.define(
593
+ children: {wire_key: 'children', nullable: true, ref: 'BrowsingContext::Info', list: true},
594
+ client_window: {wire_key: 'clientWindow', primitive: 'string'},
595
+ context: {wire_key: 'context', primitive: 'string'},
596
+ original_opener: {wire_key: 'originalOpener', nullable: true, primitive: 'string'},
597
+ url: {wire_key: 'url', primitive: 'string'},
598
+ user_context: {wire_key: 'userContext', primitive: 'string'},
599
+ parent: {wire_key: 'parent', required: false, nullable: true, primitive: 'string'},
600
+ has_planned_navigation: {wire_key: 'hasPlannedNavigation', required: false, primitive: 'boolean'}
601
+ )
602
+
564
603
  EVENT_TYPES = {
565
- 'browsingContext.contextCreated' => BrowsingContext::Info,
604
+ 'browsingContext.contextCreated' => BrowsingContext::ContextCreatedParameters,
566
605
  'browsingContext.contextDestroyed' => BrowsingContext::Info,
567
606
  'browsingContext.domContentLoaded' => BrowsingContext::NavigationInfo,
568
607
  'browsingContext.downloadEnd' => BrowsingContext::DownloadEndParams,
@@ -585,6 +624,7 @@ module Selenium
585
624
  def inner_text_locator(**) = InnerTextLocator.new(**)
586
625
  def x_path_locator(**) = XPathLocator.new(**)
587
626
  def image_format(**) = ImageFormat.new(**)
627
+ def image_size(**) = ImageSize.new(**)
588
628
  def clip_rectangle = ClipRectangle
589
629
  def element_clip_rectangle(**) = ElementClipRectangle.new(**)
590
630
  def box_clip_rectangle(**) = BoxClipRectangle.new(**)
@@ -594,6 +634,7 @@ module Selenium
594
634
  def media_track_constraints(**) = MediaTrackConstraints.new(**)
595
635
  def accessibility_locator_value(**) = AccessibilityLocator::Value.new(**)
596
636
  def context_locator_value(**) = ContextLocator::Value.new(**)
637
+ def moz = Moz.new(connection)
597
638
 
598
639
  # @api private
599
640
  # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
@@ -610,10 +651,17 @@ module Selenium
610
651
  context:,
611
652
  origin: Serialization::UNSET,
612
653
  format: Serialization::UNSET,
613
- clip: Serialization::UNSET
654
+ clip: Serialization::UNSET,
655
+ image_size: Serialization::UNSET
614
656
  )
615
657
  Serialization.validate!('origin', origin, BrowsingContext::CAPTURE_SCREENSHOT_PARAMETERS_ORIGIN)
616
- params = CaptureScreenshotParameters.new(context: context, origin: origin, format: format, clip: clip)
658
+ params = CaptureScreenshotParameters.new(
659
+ context: context,
660
+ origin: origin,
661
+ format: format,
662
+ clip: clip,
663
+ image_size: image_size
664
+ )
617
665
  execute(
618
666
  cmd: 'browsingContext.captureScreenshot',
619
667
  params: params,
@@ -760,11 +808,18 @@ module Selenium
760
808
  # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-startScreencast
761
809
  def start_screencast(
762
810
  context:,
811
+ destination_folder: Serialization::UNSET,
763
812
  mime_type: Serialization::UNSET,
764
813
  video: Serialization::UNSET,
765
814
  audio: Serialization::UNSET
766
815
  )
767
- params = StartScreencastParameters.new(context: context, mime_type: mime_type, video: video, audio: audio)
816
+ params = StartScreencastParameters.new(
817
+ context: context,
818
+ destination_folder: destination_folder,
819
+ mime_type: mime_type,
820
+ video: video,
821
+ audio: audio
822
+ )
768
823
  execute(
769
824
  cmd: 'browsingContext.startScreencast',
770
825
  params: params,
@@ -791,6 +846,22 @@ module Selenium
791
846
  params = TraverseHistoryParameters.new(context: context, delta: delta)
792
847
  execute(cmd: 'browsingContext.traverseHistory', params: params)
793
848
  end
849
+
850
+ # @api private
851
+ # moz: vendor variant of BrowsingContext, with browser-specific commands and params.
852
+ # Construct Moz.new(source) for a matching session; other sessions use BrowsingContext.
853
+ class Moz < BrowsingContext
854
+ # @api private
855
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
856
+ # @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-getTree
857
+ def get_tree(max_depth: Serialization::UNSET, root: Serialization::UNSET, scope: Serialization::UNSET)
858
+ extensions = {
859
+ 'moz:scope' => scope
860
+ }.reject { |_, value| Serialization::UNSET.equal?(value) }
861
+ params = GetTreeParameters.new(max_depth: max_depth, root: root, extensions: extensions)
862
+ execute(cmd: 'browsingContext.getTree', params: params, result: BrowsingContext::GetTreeResult)
863
+ end
864
+ end
794
865
  end # BrowsingContext
795
866
  end # Protocol
796
867
  end # BiDi
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed to the Software Freedom Conservancy (SFC) under one
4
+ # or more contributor license agreements. See the NOTICE file
5
+ # distributed with this work for additional information
6
+ # regarding copyright ownership. The SFC licenses this file
7
+ # to you under the Apache License, Version 2.0 (the
8
+ # "License"); you may not use this file except in compliance
9
+ # with the License. You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing,
14
+ # software distributed under the License is distributed on an
15
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ # KIND, either express or implied. See the License for the
17
+ # specific language governing permissions and limitations
18
+ # under the License.
19
+
20
+ # DO NOT EDIT! This file is generated by rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb.
21
+ # Regenerate with: `bazel run //rb/lib/selenium/webdriver:bidi-generate`
22
+
23
+ module Selenium
24
+ module WebDriver
25
+ class BiDi
26
+ module Protocol
27
+ # @api private
28
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
29
+ class DigitalCredentials < Domain
30
+ # @see https://w3c-fedid.github.io/digital-credentials/#cddl-type-digitalcredentials-virtualwalletaction
31
+ VIRTUAL_WALLET_ACTION = {
32
+ decline: 'decline',
33
+ respond: 'respond',
34
+ wait: 'wait',
35
+ clear: 'clear'
36
+ }.freeze
37
+
38
+ # @api private
39
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
40
+ # @see https://w3c-fedid.github.io/digital-credentials/#cddl-type-digitalcredentials-setvirtualwalletbehaviorparameters
41
+ SetVirtualWalletBehaviorParameters = Serialization::Record.define(
42
+ action: {wire_key: 'action', enum: 'DigitalCredentials::VIRTUAL_WALLET_ACTION'},
43
+ context: {wire_key: 'context', required: false, primitive: 'string'},
44
+ protocol: {wire_key: 'protocol', required: false, primitive: 'string'},
45
+ response: {wire_key: 'response', required: false}
46
+ )
47
+
48
+ # @api private
49
+ # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
50
+ def set_virtual_wallet_behavior(
51
+ action:,
52
+ context: Serialization::UNSET,
53
+ protocol: Serialization::UNSET,
54
+ response: Serialization::UNSET
55
+ )
56
+ Serialization.validate!('action', action, DigitalCredentials::VIRTUAL_WALLET_ACTION)
57
+ params = SetVirtualWalletBehaviorParameters.new(
58
+ action: action,
59
+ context: context,
60
+ protocol: protocol,
61
+ response: response
62
+ )
63
+ execute(cmd: 'digitalCredentials.setVirtualWalletBehavior', params: params)
64
+ end
65
+ end # DigitalCredentials
66
+ end # Protocol
67
+ end # BiDi
68
+ end # WebDriver
69
+ end # Selenium
File without changes