selenium-webdriver 4.45.0 → 4.48.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.
- checksums.yaml +4 -4
- data/CHANGES +46 -0
- data/bin/linux/selenium-manager +0 -0
- data/bin/macos/selenium-manager +0 -0
- data/bin/selenium-manager-THIRD-PARTY-NOTICES.txt +5940 -0
- data/bin/selenium-manager.cdx.json +11708 -0
- data/bin/windows/selenium-manager.exe +0 -0
- data/lib/selenium/webdriver/bidi/error.rb +48 -0
- data/lib/selenium/webdriver/bidi/protocol/bluetooth.rb +495 -0
- data/lib/selenium/webdriver/bidi/protocol/browser.rb +250 -0
- data/lib/selenium/webdriver/bidi/protocol/browsing_context.rb +798 -0
- data/lib/selenium/webdriver/{common/driver_extensions/has_bidi.rb → bidi/protocol/domain.rb} +23 -13
- data/lib/selenium/webdriver/bidi/protocol/emulation.rb +448 -0
- data/lib/selenium/webdriver/bidi/protocol/error_code.rb +66 -0
- data/lib/selenium/webdriver/bidi/protocol/input.rb +354 -0
- data/lib/selenium/webdriver/bidi/protocol/log.rb +115 -0
- data/lib/selenium/webdriver/bidi/protocol/network.rb +720 -0
- data/lib/selenium/webdriver/bidi/protocol/permissions.rb +75 -0
- data/lib/selenium/webdriver/bidi/protocol/script.rb +1052 -0
- data/lib/selenium/webdriver/bidi/protocol/session.rb +286 -0
- data/lib/selenium/webdriver/bidi/protocol/speculation.rb +58 -0
- data/lib/selenium/webdriver/bidi/protocol/storage.rb +183 -0
- data/lib/selenium/webdriver/bidi/protocol/user_agent_client_hints.rb +88 -0
- data/lib/selenium/webdriver/bidi/protocol/web_extension.rb +132 -0
- data/lib/selenium/webdriver/bidi/protocol.rb +42 -0
- data/lib/selenium/webdriver/bidi/serialization/record.rb +399 -0
- data/lib/selenium/webdriver/bidi/serialization/union.rb +160 -0
- data/lib/selenium/webdriver/bidi/serialization.rb +78 -0
- data/lib/selenium/webdriver/bidi/support/bidi_generate.rb +1420 -0
- data/lib/selenium/webdriver/bidi/support/check_generated.rb +63 -0
- data/lib/selenium/webdriver/bidi/transport.rb +57 -0
- data/lib/selenium/webdriver/bidi.rb +3 -0
- data/lib/selenium/webdriver/chrome/driver.rb +3 -3
- data/lib/selenium/webdriver/chrome/service.rb +4 -1
- data/lib/selenium/webdriver/chromium/driver.rb +0 -1
- data/lib/selenium/webdriver/chromium/options.rb +20 -0
- data/lib/selenium/webdriver/common/client_config.rb +97 -0
- data/lib/selenium/webdriver/common/driver.rb +13 -2
- data/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb +0 -7
- data/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb +0 -7
- data/lib/selenium/webdriver/common/driver_finder.rb +4 -3
- data/lib/selenium/webdriver/common/local_driver.rb +15 -4
- data/lib/selenium/webdriver/common/options.rb +21 -1
- data/lib/selenium/webdriver/common/proxy.rb +1 -9
- data/lib/selenium/webdriver/common/selenium_manager.rb +2 -1
- data/lib/selenium/webdriver/common/takes_screenshot.rb +1 -1
- data/lib/selenium/webdriver/common/websocket_connection.rb +64 -26
- data/lib/selenium/webdriver/common.rb +1 -1
- data/lib/selenium/webdriver/edge/driver.rb +3 -3
- data/lib/selenium/webdriver/edge/service.rb +4 -1
- data/lib/selenium/webdriver/firefox/driver.rb +3 -6
- data/lib/selenium/webdriver/firefox/options.rb +19 -0
- data/lib/selenium/webdriver/firefox/profile.rb +13 -6
- data/lib/selenium/webdriver/ie/driver.rb +3 -3
- data/lib/selenium/webdriver/remote/bidi_bridge.rb +41 -9
- data/lib/selenium/webdriver/remote/bridge.rb +8 -10
- data/lib/selenium/webdriver/remote/driver.rb +14 -4
- data/lib/selenium/webdriver/remote/http/common.rb +25 -12
- data/lib/selenium/webdriver/remote/http/default.rb +56 -39
- data/lib/selenium/webdriver/safari/driver.rb +3 -3
- data/lib/selenium/webdriver/safari/options.rb +16 -1
- data/lib/selenium/webdriver/support/guards/guard.rb +20 -3
- data/lib/selenium/webdriver/support/guards.rb +9 -3
- data/lib/selenium/webdriver/version.rb +1 -1
- metadata +29 -3
|
Binary file
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
require 'selenium/webdriver/common/error'
|
|
21
|
+
require 'selenium/webdriver/bidi/protocol/error_code'
|
|
22
|
+
|
|
23
|
+
module Selenium
|
|
24
|
+
module WebDriver
|
|
25
|
+
module Error
|
|
26
|
+
# Raised locally when a BiDi wire payload does not match this Selenium's generated
|
|
27
|
+
# schema. It is not a protocol error code; the (de)serialization layer raises it directly.
|
|
28
|
+
class SerializationError < WebDriverError; end
|
|
29
|
+
|
|
30
|
+
# Register each BiDi-only code as a WebDriverError subclass; shared codes keep their classic class.
|
|
31
|
+
BiDi::Protocol::ErrorCode::CLASS_NAMES.each_value do |name|
|
|
32
|
+
const_set(name, Class.new(WebDriverError)) unless const_defined?(name, false)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
class BiDi
|
|
37
|
+
module Protocol
|
|
38
|
+
module ErrorCode
|
|
39
|
+
# The exception class for a wire error code, or WebDriverError for an unknown one.
|
|
40
|
+
def self.for(code)
|
|
41
|
+
name = code && CLASS_NAMES[code]
|
|
42
|
+
name ? Error.const_get(name) : Error::WebDriverError
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,495 @@
|
|
|
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 Bluetooth < Domain
|
|
30
|
+
EVENTS = {
|
|
31
|
+
request_device_prompt_updated: 'bluetooth.requestDevicePromptUpdated',
|
|
32
|
+
gatt_connection_attempted: 'bluetooth.gattConnectionAttempted'
|
|
33
|
+
}.freeze
|
|
34
|
+
|
|
35
|
+
SIMULATE_ADAPTER_PARAMETERS_STATE = {
|
|
36
|
+
absent: 'absent',
|
|
37
|
+
powered_off: 'powered-off',
|
|
38
|
+
powered_on: 'powered-on'
|
|
39
|
+
}.freeze
|
|
40
|
+
|
|
41
|
+
SIMULATE_SERVICE_PARAMETERS_TYPE = {
|
|
42
|
+
add: 'add',
|
|
43
|
+
remove: 'remove'
|
|
44
|
+
}.freeze
|
|
45
|
+
|
|
46
|
+
SIMULATE_CHARACTERISTIC_PARAMETERS_TYPE = {
|
|
47
|
+
add: 'add',
|
|
48
|
+
remove: 'remove'
|
|
49
|
+
}.freeze
|
|
50
|
+
|
|
51
|
+
SIMULATE_CHARACTERISTIC_RESPONSE_PARAMETERS_TYPE = {
|
|
52
|
+
read: 'read',
|
|
53
|
+
write: 'write',
|
|
54
|
+
subscribe_to_notifications: 'subscribe-to-notifications',
|
|
55
|
+
unsubscribe_from_notifications: 'unsubscribe-from-notifications'
|
|
56
|
+
}.freeze
|
|
57
|
+
|
|
58
|
+
SIMULATE_DESCRIPTOR_PARAMETERS_TYPE = {
|
|
59
|
+
add: 'add',
|
|
60
|
+
remove: 'remove'
|
|
61
|
+
}.freeze
|
|
62
|
+
|
|
63
|
+
SIMULATE_DESCRIPTOR_RESPONSE_PARAMETERS_TYPE = {
|
|
64
|
+
read: 'read',
|
|
65
|
+
write: 'write'
|
|
66
|
+
}.freeze
|
|
67
|
+
|
|
68
|
+
CHARACTERISTIC_EVENT_GENERATED_PARAMETERS_TYPE = {
|
|
69
|
+
read: 'read',
|
|
70
|
+
write_with_response: 'write-with-response',
|
|
71
|
+
write_without_response: 'write-without-response',
|
|
72
|
+
subscribe_to_notifications: 'subscribe-to-notifications',
|
|
73
|
+
unsubscribe_from_notifications: 'unsubscribe-from-notifications'
|
|
74
|
+
}.freeze
|
|
75
|
+
|
|
76
|
+
DESCRIPTOR_EVENT_GENERATED_PARAMETERS_TYPE = {
|
|
77
|
+
read: 'read',
|
|
78
|
+
write: 'write'
|
|
79
|
+
}.freeze
|
|
80
|
+
|
|
81
|
+
# @api private
|
|
82
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
83
|
+
# @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothbluetoothmanufacturerdata
|
|
84
|
+
BluetoothManufacturerData = Serialization::Record.define(
|
|
85
|
+
key: {wire_key: 'key', primitive: 'integer'},
|
|
86
|
+
data: {wire_key: 'data', primitive: 'string'}
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
# @api private
|
|
90
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
91
|
+
# @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothcharacteristicproperties
|
|
92
|
+
CharacteristicProperties = Serialization::Record.define(
|
|
93
|
+
broadcast: {wire_key: 'broadcast', required: false, primitive: 'boolean'},
|
|
94
|
+
read: {wire_key: 'read', required: false, primitive: 'boolean'},
|
|
95
|
+
write_without_response: {wire_key: 'writeWithoutResponse', required: false, primitive: 'boolean'},
|
|
96
|
+
write: {wire_key: 'write', required: false, primitive: 'boolean'},
|
|
97
|
+
notify: {wire_key: 'notify', required: false, primitive: 'boolean'},
|
|
98
|
+
indicate: {wire_key: 'indicate', required: false, primitive: 'boolean'},
|
|
99
|
+
authenticated_signed_writes: {wire_key: 'authenticatedSignedWrites', required: false, primitive: 'boolean'},
|
|
100
|
+
extended_properties: {wire_key: 'extendedProperties', required: false, primitive: 'boolean'}
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
# @api private
|
|
104
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
105
|
+
# @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothrequestdeviceinfo
|
|
106
|
+
RequestDeviceInfo = Serialization::Record.define(
|
|
107
|
+
id: {wire_key: 'id', primitive: 'string'},
|
|
108
|
+
name: {wire_key: 'name', nullable: true, primitive: 'string'}
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
# @api private
|
|
112
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
113
|
+
# @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothscanrecord
|
|
114
|
+
ScanRecord = Serialization::Record.define(
|
|
115
|
+
name: {wire_key: 'name', required: false, primitive: 'string'},
|
|
116
|
+
uuids: {wire_key: 'uuids', required: false, list: true},
|
|
117
|
+
appearance: {wire_key: 'appearance', required: false, primitive: 'number'},
|
|
118
|
+
manufacturer_data: {
|
|
119
|
+
wire_key: 'manufacturerData',
|
|
120
|
+
required: false,
|
|
121
|
+
ref: 'Bluetooth::BluetoothManufacturerData',
|
|
122
|
+
list: true
|
|
123
|
+
}
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
# @api private
|
|
127
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
128
|
+
# @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothhandlerequestdevicepromptparameters
|
|
129
|
+
class HandleRequestDevicePromptParameters < Serialization::Union
|
|
130
|
+
discriminator 'accept'
|
|
131
|
+
variants(
|
|
132
|
+
true => 'Bluetooth::HandleRequestDevicePromptParameters::AcceptParameters',
|
|
133
|
+
false => 'Bluetooth::HandleRequestDevicePromptParameters::CancelParameters'
|
|
134
|
+
)
|
|
135
|
+
object_only
|
|
136
|
+
|
|
137
|
+
# @api private
|
|
138
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
139
|
+
AcceptParameters = Serialization::Record.define(
|
|
140
|
+
accept: {fixed: true},
|
|
141
|
+
context: {wire_key: 'context', primitive: 'string'},
|
|
142
|
+
prompt: {wire_key: 'prompt', primitive: 'string'},
|
|
143
|
+
device: {wire_key: 'device', primitive: 'string'}
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
# @api private
|
|
147
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
148
|
+
CancelParameters = Serialization::Record.define(
|
|
149
|
+
accept: {fixed: false},
|
|
150
|
+
context: {wire_key: 'context', primitive: 'string'},
|
|
151
|
+
prompt: {wire_key: 'prompt', primitive: 'string'}
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
def self.true(**) = Bluetooth::HandleRequestDevicePromptParameters::AcceptParameters.new(**)
|
|
155
|
+
def self.false(**) = Bluetooth::HandleRequestDevicePromptParameters::CancelParameters.new(**)
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# @api private
|
|
159
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
160
|
+
# @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothsimulateadapterparameters
|
|
161
|
+
SimulateAdapterParameters = Serialization::Record.define(
|
|
162
|
+
context: {wire_key: 'context', primitive: 'string'},
|
|
163
|
+
le_supported: {wire_key: 'leSupported', required: false, primitive: 'boolean'},
|
|
164
|
+
state: {wire_key: 'state', enum: 'Bluetooth::SIMULATE_ADAPTER_PARAMETERS_STATE'}
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
# @api private
|
|
168
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
169
|
+
# @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothdisablesimulationparameters
|
|
170
|
+
DisableSimulationParameters = Serialization::Record.define(
|
|
171
|
+
context: {wire_key: 'context', primitive: 'string'}
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
# @api private
|
|
175
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
176
|
+
# @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothsimulatepreconnectedperipheralparameters
|
|
177
|
+
SimulatePreconnectedPeripheralParameters = Serialization::Record.define(
|
|
178
|
+
context: {wire_key: 'context', primitive: 'string'},
|
|
179
|
+
address: {wire_key: 'address', primitive: 'string'},
|
|
180
|
+
name: {wire_key: 'name', primitive: 'string'},
|
|
181
|
+
manufacturer_data: {wire_key: 'manufacturerData', ref: 'Bluetooth::BluetoothManufacturerData', list: true},
|
|
182
|
+
known_service_uuids: {wire_key: 'knownServiceUuids', list: true}
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
# @api private
|
|
186
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
187
|
+
# @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothsimulateadvertisementparameters
|
|
188
|
+
SimulateAdvertisementParameters = Serialization::Record.define(
|
|
189
|
+
context: {wire_key: 'context', primitive: 'string'},
|
|
190
|
+
scan_entry: {wire_key: 'scanEntry', ref: 'Bluetooth::SimulateAdvertisementScanEntryParameters'}
|
|
191
|
+
)
|
|
192
|
+
|
|
193
|
+
# @api private
|
|
194
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
195
|
+
# @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothsimulateadvertisementscanentryparameters
|
|
196
|
+
SimulateAdvertisementScanEntryParameters = Serialization::Record.define(
|
|
197
|
+
device_address: {wire_key: 'deviceAddress', primitive: 'string'},
|
|
198
|
+
rssi: {wire_key: 'rssi', primitive: 'number'},
|
|
199
|
+
scan_record: {wire_key: 'scanRecord', ref: 'Bluetooth::ScanRecord'}
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
# @api private
|
|
203
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
204
|
+
# @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothsimulategattconnectionresponseparameters
|
|
205
|
+
SimulateGattConnectionResponseParameters = Serialization::Record.define(
|
|
206
|
+
context: {wire_key: 'context', primitive: 'string'},
|
|
207
|
+
address: {wire_key: 'address', primitive: 'string'},
|
|
208
|
+
code: {wire_key: 'code', primitive: 'integer'}
|
|
209
|
+
)
|
|
210
|
+
|
|
211
|
+
# @api private
|
|
212
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
213
|
+
# @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothsimulategattdisconnectionparameters
|
|
214
|
+
SimulateGattDisconnectionParameters = Serialization::Record.define(
|
|
215
|
+
context: {wire_key: 'context', primitive: 'string'},
|
|
216
|
+
address: {wire_key: 'address', primitive: 'string'}
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
# @api private
|
|
220
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
221
|
+
# @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothsimulateserviceparameters
|
|
222
|
+
SimulateServiceParameters = Serialization::Record.define(
|
|
223
|
+
context: {wire_key: 'context', primitive: 'string'},
|
|
224
|
+
address: {wire_key: 'address', primitive: 'string'},
|
|
225
|
+
uuid: {wire_key: 'uuid', primitive: 'string'},
|
|
226
|
+
type: {wire_key: 'type', enum: 'Bluetooth::SIMULATE_SERVICE_PARAMETERS_TYPE'}
|
|
227
|
+
)
|
|
228
|
+
|
|
229
|
+
# @api private
|
|
230
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
231
|
+
# @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothsimulatecharacteristicparameters
|
|
232
|
+
SimulateCharacteristicParameters = Serialization::Record.define(
|
|
233
|
+
context: {wire_key: 'context', primitive: 'string'},
|
|
234
|
+
address: {wire_key: 'address', primitive: 'string'},
|
|
235
|
+
service_uuid: {wire_key: 'serviceUuid', primitive: 'string'},
|
|
236
|
+
characteristic_uuid: {wire_key: 'characteristicUuid', primitive: 'string'},
|
|
237
|
+
characteristic_properties: {
|
|
238
|
+
wire_key: 'characteristicProperties',
|
|
239
|
+
required: false,
|
|
240
|
+
ref: 'Bluetooth::CharacteristicProperties'
|
|
241
|
+
},
|
|
242
|
+
type: {wire_key: 'type', enum: 'Bluetooth::SIMULATE_CHARACTERISTIC_PARAMETERS_TYPE'}
|
|
243
|
+
)
|
|
244
|
+
|
|
245
|
+
# @api private
|
|
246
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
247
|
+
# @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothsimulatecharacteristicresponseparameters
|
|
248
|
+
SimulateCharacteristicResponseParameters = Serialization::Record.define(
|
|
249
|
+
context: {wire_key: 'context', primitive: 'string'},
|
|
250
|
+
address: {wire_key: 'address', primitive: 'string'},
|
|
251
|
+
service_uuid: {wire_key: 'serviceUuid', primitive: 'string'},
|
|
252
|
+
characteristic_uuid: {wire_key: 'characteristicUuid', primitive: 'string'},
|
|
253
|
+
type: {wire_key: 'type', enum: 'Bluetooth::SIMULATE_CHARACTERISTIC_RESPONSE_PARAMETERS_TYPE'},
|
|
254
|
+
code: {wire_key: 'code', primitive: 'integer'},
|
|
255
|
+
data: {wire_key: 'data', required: false, list: true}
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
# @api private
|
|
259
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
260
|
+
# @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothsimulatedescriptorparameters
|
|
261
|
+
SimulateDescriptorParameters = Serialization::Record.define(
|
|
262
|
+
context: {wire_key: 'context', primitive: 'string'},
|
|
263
|
+
address: {wire_key: 'address', primitive: 'string'},
|
|
264
|
+
service_uuid: {wire_key: 'serviceUuid', primitive: 'string'},
|
|
265
|
+
characteristic_uuid: {wire_key: 'characteristicUuid', primitive: 'string'},
|
|
266
|
+
descriptor_uuid: {wire_key: 'descriptorUuid', primitive: 'string'},
|
|
267
|
+
type: {wire_key: 'type', enum: 'Bluetooth::SIMULATE_DESCRIPTOR_PARAMETERS_TYPE'}
|
|
268
|
+
)
|
|
269
|
+
|
|
270
|
+
# @api private
|
|
271
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
272
|
+
# @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothsimulatedescriptorresponseparameters
|
|
273
|
+
SimulateDescriptorResponseParameters = Serialization::Record.define(
|
|
274
|
+
context: {wire_key: 'context', primitive: 'string'},
|
|
275
|
+
address: {wire_key: 'address', primitive: 'string'},
|
|
276
|
+
service_uuid: {wire_key: 'serviceUuid', primitive: 'string'},
|
|
277
|
+
characteristic_uuid: {wire_key: 'characteristicUuid', primitive: 'string'},
|
|
278
|
+
descriptor_uuid: {wire_key: 'descriptorUuid', primitive: 'string'},
|
|
279
|
+
type: {wire_key: 'type', enum: 'Bluetooth::SIMULATE_DESCRIPTOR_RESPONSE_PARAMETERS_TYPE'},
|
|
280
|
+
code: {wire_key: 'code', primitive: 'integer'},
|
|
281
|
+
data: {wire_key: 'data', required: false, list: true}
|
|
282
|
+
)
|
|
283
|
+
|
|
284
|
+
# @api private
|
|
285
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
286
|
+
# @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothrequestdevicepromptupdatedparameters
|
|
287
|
+
RequestDevicePromptUpdatedParameters = Serialization::Record.define(
|
|
288
|
+
context: {wire_key: 'context', primitive: 'string'},
|
|
289
|
+
prompt: {wire_key: 'prompt', primitive: 'string'},
|
|
290
|
+
devices: {wire_key: 'devices', ref: 'Bluetooth::RequestDeviceInfo', list: true}
|
|
291
|
+
)
|
|
292
|
+
|
|
293
|
+
# @api private
|
|
294
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
295
|
+
# @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothgattconnectionattemptedparameters
|
|
296
|
+
GattConnectionAttemptedParameters = Serialization::Record.define(
|
|
297
|
+
context: {wire_key: 'context', primitive: 'string'},
|
|
298
|
+
address: {wire_key: 'address', primitive: 'string'}
|
|
299
|
+
)
|
|
300
|
+
|
|
301
|
+
# @api private
|
|
302
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
303
|
+
# @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothcharacteristiceventgeneratedparameters
|
|
304
|
+
CharacteristicEventGeneratedParameters = Serialization::Record.define(
|
|
305
|
+
context: {wire_key: 'context', primitive: 'string'},
|
|
306
|
+
address: {wire_key: 'address', primitive: 'string'},
|
|
307
|
+
service_uuid: {wire_key: 'serviceUuid', primitive: 'string'},
|
|
308
|
+
characteristic_uuid: {wire_key: 'characteristicUuid', primitive: 'string'},
|
|
309
|
+
type: {wire_key: 'type', enum: 'Bluetooth::CHARACTERISTIC_EVENT_GENERATED_PARAMETERS_TYPE'},
|
|
310
|
+
data: {wire_key: 'data', required: false, list: true}
|
|
311
|
+
)
|
|
312
|
+
|
|
313
|
+
# @api private
|
|
314
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
315
|
+
# @see https://webbluetoothcg.github.io/web-bluetooth/#cddl-type-bluetoothdescriptoreventgeneratedparameters
|
|
316
|
+
DescriptorEventGeneratedParameters = Serialization::Record.define(
|
|
317
|
+
context: {wire_key: 'context', primitive: 'string'},
|
|
318
|
+
address: {wire_key: 'address', primitive: 'string'},
|
|
319
|
+
service_uuid: {wire_key: 'serviceUuid', primitive: 'string'},
|
|
320
|
+
characteristic_uuid: {wire_key: 'characteristicUuid', primitive: 'string'},
|
|
321
|
+
descriptor_uuid: {wire_key: 'descriptorUuid', primitive: 'string'},
|
|
322
|
+
type: {wire_key: 'type', enum: 'Bluetooth::DESCRIPTOR_EVENT_GENERATED_PARAMETERS_TYPE'},
|
|
323
|
+
data: {wire_key: 'data', required: false, list: true}
|
|
324
|
+
)
|
|
325
|
+
|
|
326
|
+
EVENT_TYPES = {
|
|
327
|
+
'bluetooth.requestDevicePromptUpdated' => Bluetooth::RequestDevicePromptUpdatedParameters,
|
|
328
|
+
'bluetooth.gattConnectionAttempted' => Bluetooth::GattConnectionAttemptedParameters
|
|
329
|
+
}.freeze
|
|
330
|
+
|
|
331
|
+
def bluetooth_manufacturer_data(**) = BluetoothManufacturerData.new(**)
|
|
332
|
+
def characteristic_properties(**) = CharacteristicProperties.new(**)
|
|
333
|
+
def scan_record(**) = ScanRecord.new(**)
|
|
334
|
+
def simulate_advertisement_scan_entry_parameters(**) = SimulateAdvertisementScanEntryParameters.new(**)
|
|
335
|
+
|
|
336
|
+
# @api private
|
|
337
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
338
|
+
def handle_request_device_prompt(context:, prompt:, accept:, device: Serialization::UNSET)
|
|
339
|
+
params = HandleRequestDevicePromptParameters.build(
|
|
340
|
+
context: context,
|
|
341
|
+
prompt: prompt,
|
|
342
|
+
accept: accept,
|
|
343
|
+
device: device
|
|
344
|
+
)
|
|
345
|
+
execute(cmd: 'bluetooth.handleRequestDevicePrompt', params: params)
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
# @api private
|
|
349
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
350
|
+
def simulate_adapter(context:, state:, le_supported: Serialization::UNSET)
|
|
351
|
+
Serialization.validate!('state', state, Bluetooth::SIMULATE_ADAPTER_PARAMETERS_STATE)
|
|
352
|
+
params = SimulateAdapterParameters.new(context: context, le_supported: le_supported, state: state)
|
|
353
|
+
execute(cmd: 'bluetooth.simulateAdapter', params: params)
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
# @api private
|
|
357
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
358
|
+
def disable_simulation(context:)
|
|
359
|
+
params = DisableSimulationParameters.new(context: context)
|
|
360
|
+
execute(cmd: 'bluetooth.disableSimulation', params: params)
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
# @api private
|
|
364
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
365
|
+
def simulate_preconnected_peripheral(context:, address:, name:, manufacturer_data:, known_service_uuids:)
|
|
366
|
+
params = SimulatePreconnectedPeripheralParameters.new(
|
|
367
|
+
context: context,
|
|
368
|
+
address: address,
|
|
369
|
+
name: name,
|
|
370
|
+
manufacturer_data: manufacturer_data,
|
|
371
|
+
known_service_uuids: known_service_uuids
|
|
372
|
+
)
|
|
373
|
+
execute(cmd: 'bluetooth.simulatePreconnectedPeripheral', params: params)
|
|
374
|
+
end
|
|
375
|
+
|
|
376
|
+
# @api private
|
|
377
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
378
|
+
def simulate_advertisement(context:, scan_entry:)
|
|
379
|
+
params = SimulateAdvertisementParameters.new(context: context, scan_entry: scan_entry)
|
|
380
|
+
execute(cmd: 'bluetooth.simulateAdvertisement', params: params)
|
|
381
|
+
end
|
|
382
|
+
|
|
383
|
+
# @api private
|
|
384
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
385
|
+
def simulate_gatt_connection_response(context:, address:, code:)
|
|
386
|
+
params = SimulateGattConnectionResponseParameters.new(context: context, address: address, code: code)
|
|
387
|
+
execute(cmd: 'bluetooth.simulateGattConnectionResponse', params: params)
|
|
388
|
+
end
|
|
389
|
+
|
|
390
|
+
# @api private
|
|
391
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
392
|
+
def simulate_gatt_disconnection(context:, address:)
|
|
393
|
+
params = SimulateGattDisconnectionParameters.new(context: context, address: address)
|
|
394
|
+
execute(cmd: 'bluetooth.simulateGattDisconnection', params: params)
|
|
395
|
+
end
|
|
396
|
+
|
|
397
|
+
# @api private
|
|
398
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
399
|
+
def simulate_service(context:, address:, uuid:, type:)
|
|
400
|
+
Serialization.validate!('type', type, Bluetooth::SIMULATE_SERVICE_PARAMETERS_TYPE)
|
|
401
|
+
params = SimulateServiceParameters.new(context: context, address: address, uuid: uuid, type: type)
|
|
402
|
+
execute(cmd: 'bluetooth.simulateService', params: params)
|
|
403
|
+
end
|
|
404
|
+
|
|
405
|
+
# @api private
|
|
406
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
407
|
+
def simulate_characteristic(
|
|
408
|
+
context:,
|
|
409
|
+
address:,
|
|
410
|
+
service_uuid:,
|
|
411
|
+
characteristic_uuid:,
|
|
412
|
+
type:,
|
|
413
|
+
characteristic_properties: Serialization::UNSET
|
|
414
|
+
)
|
|
415
|
+
Serialization.validate!('type', type, Bluetooth::SIMULATE_CHARACTERISTIC_PARAMETERS_TYPE)
|
|
416
|
+
params = SimulateCharacteristicParameters.new(
|
|
417
|
+
context: context,
|
|
418
|
+
address: address,
|
|
419
|
+
service_uuid: service_uuid,
|
|
420
|
+
characteristic_uuid: characteristic_uuid,
|
|
421
|
+
characteristic_properties: characteristic_properties,
|
|
422
|
+
type: type
|
|
423
|
+
)
|
|
424
|
+
execute(cmd: 'bluetooth.simulateCharacteristic', params: params)
|
|
425
|
+
end
|
|
426
|
+
|
|
427
|
+
# @api private
|
|
428
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
429
|
+
def simulate_characteristic_response(
|
|
430
|
+
context:,
|
|
431
|
+
address:,
|
|
432
|
+
service_uuid:,
|
|
433
|
+
characteristic_uuid:,
|
|
434
|
+
type:,
|
|
435
|
+
code:,
|
|
436
|
+
data: Serialization::UNSET
|
|
437
|
+
)
|
|
438
|
+
Serialization.validate!('type', type, Bluetooth::SIMULATE_CHARACTERISTIC_RESPONSE_PARAMETERS_TYPE)
|
|
439
|
+
params = SimulateCharacteristicResponseParameters.new(
|
|
440
|
+
context: context,
|
|
441
|
+
address: address,
|
|
442
|
+
service_uuid: service_uuid,
|
|
443
|
+
characteristic_uuid: characteristic_uuid,
|
|
444
|
+
type: type,
|
|
445
|
+
code: code,
|
|
446
|
+
data: data
|
|
447
|
+
)
|
|
448
|
+
execute(cmd: 'bluetooth.simulateCharacteristicResponse', params: params)
|
|
449
|
+
end
|
|
450
|
+
|
|
451
|
+
# @api private
|
|
452
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
453
|
+
def simulate_descriptor(context:, address:, service_uuid:, characteristic_uuid:, descriptor_uuid:, type:)
|
|
454
|
+
Serialization.validate!('type', type, Bluetooth::SIMULATE_DESCRIPTOR_PARAMETERS_TYPE)
|
|
455
|
+
params = SimulateDescriptorParameters.new(
|
|
456
|
+
context: context,
|
|
457
|
+
address: address,
|
|
458
|
+
service_uuid: service_uuid,
|
|
459
|
+
characteristic_uuid: characteristic_uuid,
|
|
460
|
+
descriptor_uuid: descriptor_uuid,
|
|
461
|
+
type: type
|
|
462
|
+
)
|
|
463
|
+
execute(cmd: 'bluetooth.simulateDescriptor', params: params)
|
|
464
|
+
end
|
|
465
|
+
|
|
466
|
+
# @api private
|
|
467
|
+
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
|
|
468
|
+
def simulate_descriptor_response(
|
|
469
|
+
context:,
|
|
470
|
+
address:,
|
|
471
|
+
service_uuid:,
|
|
472
|
+
characteristic_uuid:,
|
|
473
|
+
descriptor_uuid:,
|
|
474
|
+
type:,
|
|
475
|
+
code:,
|
|
476
|
+
data: Serialization::UNSET
|
|
477
|
+
)
|
|
478
|
+
Serialization.validate!('type', type, Bluetooth::SIMULATE_DESCRIPTOR_RESPONSE_PARAMETERS_TYPE)
|
|
479
|
+
params = SimulateDescriptorResponseParameters.new(
|
|
480
|
+
context: context,
|
|
481
|
+
address: address,
|
|
482
|
+
service_uuid: service_uuid,
|
|
483
|
+
characteristic_uuid: characteristic_uuid,
|
|
484
|
+
descriptor_uuid: descriptor_uuid,
|
|
485
|
+
type: type,
|
|
486
|
+
code: code,
|
|
487
|
+
data: data
|
|
488
|
+
)
|
|
489
|
+
execute(cmd: 'bluetooth.simulateDescriptorResponse', params: params)
|
|
490
|
+
end
|
|
491
|
+
end # Bluetooth
|
|
492
|
+
end # Protocol
|
|
493
|
+
end # BiDi
|
|
494
|
+
end # WebDriver
|
|
495
|
+
end # Selenium
|