Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions rb/lib/selenium/webdriver/bidi/protocol/bluetooth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ class HandleRequestDevicePromptParameters < Serialization::Union
context: {wire_key: 'context', primitive: 'string'},
prompt: {wire_key: 'prompt', primitive: 'string'}
)

def self.true(**) = Bluetooth::HandleRequestDevicePromptParameters::AcceptParameters.new(**)
def self.false(**) = Bluetooth::HandleRequestDevicePromptParameters::CancelParameters.new(**)
end

# @api private
Expand Down Expand Up @@ -325,6 +328,11 @@ class HandleRequestDevicePromptParameters < Serialization::Union
'bluetooth.gattConnectionAttempted' => Bluetooth::GattConnectionAttemptedParameters
}.freeze

def bluetooth_manufacturer_data(**) = BluetoothManufacturerData.new(**)
def characteristic_properties(**) = CharacteristicProperties.new(**)
def scan_record(**) = ScanRecord.new(**)
def simulate_advertisement_scan_entry_parameters(**) = SimulateAdvertisementScanEntryParameters.new(**)

# @api private
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
def handle_request_device_prompt(context:, prompt:, accept:, device: Serialization::UNSET)
Expand Down
7 changes: 7 additions & 0 deletions rb/lib/selenium/webdriver/bidi/protocol/browser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ class SetClientWindowStateParameters < Serialization::Union
x: {wire_key: 'x', required: false, primitive: 'integer'},
y: {wire_key: 'y', required: false, primitive: 'integer'}
)

def self.normal(**) = Browser::SetClientWindowStateParameters::ClientWindowRectState.new(**)
end

# @api private
Expand Down Expand Up @@ -152,8 +154,13 @@ class DownloadBehavior < Serialization::Union
# @api private
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
Denied = Serialization::Record.define(type: {fixed: 'denied'})

def self.allowed(**) = Browser::DownloadBehavior::Allowed.new(**)
def self.denied(**) = Browser::DownloadBehavior::Denied.new(**)
end

def download_behavior = DownloadBehavior

# @api private
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
# @see https://w3c.github.io/webdriver-bidi/#command-browser-close
Expand Down
29 changes: 29 additions & 0 deletions rb/lib/selenium/webdriver/bidi/protocol/browsing_context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ class Locator < Serialization::Union
xpath: 'BrowsingContext::XPathLocator'
)
object_only

def self.accessibility(**) = BrowsingContext::AccessibilityLocator.new(**)
def self.css(**) = BrowsingContext::CssLocator.new(**)
def self.context(**) = BrowsingContext::ContextLocator.new(**)
def self.inner_text(**) = BrowsingContext::InnerTextLocator.new(**)
def self.xpath(**) = BrowsingContext::XPathLocator.new(**)
end

# @api private
Expand Down Expand Up @@ -224,6 +230,9 @@ class ClipRectangle < Serialization::Union
element: 'BrowsingContext::ElementClipRectangle'
)
object_only

def self.box(**) = BrowsingContext::BoxClipRectangle.new(**)
def self.element(**) = BrowsingContext::ElementClipRectangle.new(**)
end

# @api private
Expand Down Expand Up @@ -524,6 +533,9 @@ class DownloadEndParams < Serialization::Union
url: {wire_key: 'url', primitive: 'string'},
user_context: {wire_key: 'userContext', required: false, primitive: 'string'}
)

def self.canceled(**) = BrowsingContext::DownloadEndParams::CanceledParams.new(**)
def self.complete(**) = BrowsingContext::DownloadEndParams::CompleteParams.new(**)
end

# @api private
Expand Down Expand Up @@ -566,6 +578,23 @@ class DownloadEndParams < Serialization::Union
'browsingContext.userPromptOpened' => BrowsingContext::UserPromptOpenedParameters
}.freeze

def locator = Locator
def accessibility_locator(**) = AccessibilityLocator.new(**)
def css_locator(**) = CssLocator.new(**)
def context_locator(**) = ContextLocator.new(**)
def inner_text_locator(**) = InnerTextLocator.new(**)
def x_path_locator(**) = XPathLocator.new(**)
def image_format(**) = ImageFormat.new(**)
def clip_rectangle = ClipRectangle
def element_clip_rectangle(**) = ElementClipRectangle.new(**)
def box_clip_rectangle(**) = BoxClipRectangle.new(**)
def print_margin_parameters(**) = PrintMarginParameters.new(**)
def print_page_parameters(**) = PrintPageParameters.new(**)
def viewport(**) = Viewport.new(**)
def media_track_constraints(**) = MediaTrackConstraints.new(**)
def accessibility_locator_value(**) = AccessibilityLocator::Value.new(**)
def context_locator_value(**) = ContextLocator::Value.new(**)

# @api private
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
# @see https://w3c.github.io/webdriver-bidi/#command-browsingContext-activate
Expand Down
4 changes: 4 additions & 0 deletions rb/lib/selenium/webdriver/bidi/protocol/domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ def initialize(source)

private

# The connection this domain runs over, so a generated vendor accessor can build its
# sibling variant (`Moz.new(connection)`) — construction stays connection-based.
def connection = @transport.connection

def execute(cmd:, params: nil, result: nil)
@transport.execute(cmd: cmd, params: params, result: result)
end
Expand Down
6 changes: 6 additions & 0 deletions rb/lib/selenium/webdriver/bidi/protocol/emulation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@ class SetGeolocationOverrideParameters < Serialization::Union
user_contexts: {wire_key: 'userContexts', required: false, list: true}
)

def geolocation_coordinates(**) = GeolocationCoordinates.new(**)
def geolocation_position_error(**) = GeolocationPositionError.new(**)
def network_conditions_offline(**) = NetworkConditionsOffline.new(**)
def screen_area(**) = ScreenArea.new(**)
def screen_orientation(**) = ScreenOrientation.new(**)

# @api private
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
# @see https://w3c.github.io/webdriver-bidi/#command-emulation-setForcedColorsModeThemeOverride
Expand Down
37 changes: 37 additions & 0 deletions rb/lib/selenium/webdriver/bidi/protocol/input.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ class SourceActions < Serialization::Union
wheel: 'Input::WheelSourceActions'
)
object_only

def self.none(**) = Input::NoneSourceActions.new(**)
def self.key(**) = Input::KeySourceActions.new(**)
def self.pointer(**) = Input::PointerSourceActions.new(**)
def self.wheel(**) = Input::WheelSourceActions.new(**)
end

# @api private
Expand Down Expand Up @@ -98,6 +103,10 @@ class KeySourceAction < Serialization::Union
key_up: 'Input::KeyUpAction'
)
object_only

def self.pause(**) = Input::PauseAction.new(**)
def self.key_down(**) = Input::KeyDownAction.new(**)
def self.key_up(**) = Input::KeyUpAction.new(**)
end

# @api private
Expand Down Expand Up @@ -134,6 +143,11 @@ class PointerSourceAction < Serialization::Union
pointer_move: 'Input::PointerMoveAction'
)
object_only

def self.pause(**) = Input::PauseAction.new(**)
def self.pointer_down(**) = Input::PointerDownAction.new(**)
def self.pointer_up(**) = Input::PointerUpAction.new(**)
def self.pointer_move(**) = Input::PointerMoveAction.new(**)
end

# @api private
Expand All @@ -155,6 +169,9 @@ class WheelSourceAction < Serialization::Union
scroll: 'Input::WheelScrollAction'
)
object_only

def self.pause(**) = Input::PauseAction.new(**)
def self.scroll(**) = Input::WheelScrollAction.new(**)
end

# @api private
Expand Down Expand Up @@ -257,6 +274,8 @@ class Origin < Serialization::Union
element: 'Input::ElementOrigin'
)
scalar_values 'viewport', 'pointer'

def self.element(**) = Input::ElementOrigin.new(**)
end

# @api private
Expand Down Expand Up @@ -287,6 +306,24 @@ class Origin < Serialization::Union
'input.fileDialogOpened' => Input::FileDialogInfo
}.freeze

def element_origin(**) = ElementOrigin.new(**)
def source_actions = SourceActions
def none_source_actions(**) = NoneSourceActions.new(**)
def key_source_actions(**) = KeySourceActions.new(**)
def key_source_action = KeySourceAction
def pointer_source_actions(**) = PointerSourceActions.new(**)
def pointer_parameters(**) = PointerParameters.new(**)
def pointer_source_action = PointerSourceAction
def wheel_source_actions(**) = WheelSourceActions.new(**)
def wheel_source_action = WheelSourceAction
def pause_action(**) = PauseAction.new(**)
def key_down_action(**) = KeyDownAction.new(**)
def key_up_action(**) = KeyUpAction.new(**)
def pointer_up_action(**) = PointerUpAction.new(**)
def pointer_down_action(**) = PointerDownAction.new(**)
def pointer_move_action(**) = PointerMoveAction.new(**)
def wheel_scroll_action(**) = WheelScrollAction.new(**)

# @api private
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
# @see https://w3c.github.io/webdriver-bidi/#command-input-performActions
Expand Down
3 changes: 3 additions & 0 deletions rb/lib/selenium/webdriver/bidi/protocol/log.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ class Entry < Serialization::Union
)
fallback 'Log::GenericLogEntry'
object_only

def self.console(**) = Log::ConsoleLogEntry.new(**)
def self.javascript(**) = Log::JavascriptLogEntry.new(**)
end

# @api private
Expand Down
19 changes: 19 additions & 0 deletions rb/lib/selenium/webdriver/bidi/protocol/network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ class BytesValue < Serialization::Union
base64: 'Network::Base64Value'
)
object_only

def self.string(**) = Network::StringValue.new(**)
def self.base64(**) = Network::Base64Value.new(**)
end

# @api private
Expand Down Expand Up @@ -264,6 +267,9 @@ class UrlPattern < Serialization::Union
string: 'Network::UrlPatternString'
)
object_only

def self.pattern(**) = Network::UrlPatternPattern.new(**)
def self.string(**) = Network::UrlPatternString.new(**)
end

# @api private
Expand Down Expand Up @@ -365,6 +371,8 @@ class ContinueWithAuthParameters < Serialization::Union
request: {wire_key: 'request', primitive: 'string'},
action: {wire_key: 'action', enum: 'Network::CONTINUE_WITH_AUTH_NO_CREDENTIALS_ACTION'}
)

def self.provide_credentials(**) = Network::ContinueWithAuthParameters::Credentials.new(**)
end

# @api private
Expand Down Expand Up @@ -522,6 +530,17 @@ class ContinueWithAuthParameters < Serialization::Union
'network.responseStarted' => Network::ResponseStartedParameters
}.freeze

def auth_credentials(**) = AuthCredentials.new(**)
def bytes_value = BytesValue
def string_value(**) = StringValue.new(**)
def base64_value(**) = Base64Value.new(**)
def cookie_header(**) = CookieHeader.new(**)
def header(**) = Header.new(**)
def set_cookie_header(**) = SetCookieHeader.new(**)
def url_pattern = UrlPattern
def url_pattern_pattern(**) = UrlPatternPattern.new(**)
def url_pattern_string(**) = UrlPatternString.new(**)

# @api private
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
# @see https://w3c.github.io/webdriver-bidi/#command-network-addDataCollector
Expand Down
2 changes: 2 additions & 0 deletions rb/lib/selenium/webdriver/bidi/protocol/permissions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ class Permissions < Domain
user_context: {wire_key: 'userContext', required: false, primitive: 'string'}
)

def permission_descriptor(**) = PermissionDescriptor.new(**)

# @api private
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
def set_permission(
Expand Down
85 changes: 85 additions & 0 deletions rb/lib/selenium/webdriver/bidi/protocol/script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ class EvaluateResult < Serialization::Union
exception: 'Script::EvaluateResultException'
)
object_only

def self.success(**) = Script::EvaluateResultSuccess.new(**)
def self.exception(**) = Script::EvaluateResultException.new(**)
end

# @api private
Expand Down Expand Up @@ -169,6 +172,20 @@ class LocalValue < Serialization::Union
)
fallback 'Script::RemoteReference'
object_only

def self.undefined(**) = Script::UndefinedValue.new(**)
def self.null(**) = Script::NullValue.new(**)
def self.string(**) = Script::StringValue.new(**)
def self.number(**) = Script::NumberValue.new(**)
def self.boolean(**) = Script::BooleanValue.new(**)
def self.bigint(**) = Script::BigIntValue.new(**)
def self.channel(**) = Script::ChannelValue.new(**)
def self.array(**) = Script::ArrayLocalValue.new(**)
def self.date(**) = Script::DateLocalValue.new(**)
def self.map(**) = Script::MapLocalValue.new(**)
def self.object(**) = Script::ObjectLocalValue.new(**)
def self.regexp(**) = Script::RegExpLocalValue.new(**)
def self.set(**) = Script::SetLocalValue.new(**)
end

# @api private
Expand Down Expand Up @@ -248,6 +265,13 @@ class PrimitiveProtocolValue < Serialization::Union
bigint: 'Script::BigIntValue'
)
object_only

def self.undefined(**) = Script::UndefinedValue.new(**)
def self.null(**) = Script::NullValue.new(**)
def self.string(**) = Script::StringValue.new(**)
def self.number(**) = Script::NumberValue.new(**)
def self.boolean(**) = Script::BooleanValue.new(**)
def self.bigint(**) = Script::BigIntValue.new(**)
end

# @api private
Expand Down Expand Up @@ -314,6 +338,15 @@ class RealmInfo < Serialization::Union
worklet: 'Script::WorkletRealmInfo'
)
object_only

def self.window(**) = Script::WindowRealmInfo.new(**)
def self.dedicated_worker(**) = Script::DedicatedWorkerRealmInfo.new(**)
def self.shared_worker(**) = Script::SharedWorkerRealmInfo.new(**)
def self.service_worker(**) = Script::ServiceWorkerRealmInfo.new(**)
def self.worker(**) = Script::WorkerRealmInfo.new(**)
def self.paint_worklet(**) = Script::PaintWorkletRealmInfo.new(**)
def self.audio_worklet(**) = Script::AudioWorkletRealmInfo.new(**)
def self.worklet(**) = Script::WorkletRealmInfo.new(**)
end

# @api private
Expand Down Expand Up @@ -490,6 +523,33 @@ class RemoteValue < Serialization::Union
window: 'Script::WindowProxyRemoteValue'
)
object_only

def self.undefined(**) = Script::UndefinedValue.new(**)
def self.null(**) = Script::NullValue.new(**)
def self.string(**) = Script::StringValue.new(**)
def self.number(**) = Script::NumberValue.new(**)
def self.boolean(**) = Script::BooleanValue.new(**)
def self.bigint(**) = Script::BigIntValue.new(**)
def self.symbol(**) = Script::SymbolRemoteValue.new(**)
def self.array(**) = Script::ArrayRemoteValue.new(**)
def self.object(**) = Script::ObjectRemoteValue.new(**)
def self.function(**) = Script::FunctionRemoteValue.new(**)
def self.regexp(**) = Script::RegExpRemoteValue.new(**)
def self.date(**) = Script::DateRemoteValue.new(**)
def self.map(**) = Script::MapRemoteValue.new(**)
def self.set(**) = Script::SetRemoteValue.new(**)
def self.weakmap(**) = Script::WeakMapRemoteValue.new(**)
def self.weakset(**) = Script::WeakSetRemoteValue.new(**)
def self.generator(**) = Script::GeneratorRemoteValue.new(**)
def self.error(**) = Script::ErrorRemoteValue.new(**)
def self.proxy(**) = Script::ProxyRemoteValue.new(**)
def self.promise(**) = Script::PromiseRemoteValue.new(**)
def self.typedarray(**) = Script::TypedArrayRemoteValue.new(**)
def self.arraybuffer(**) = Script::ArrayBufferRemoteValue.new(**)
def self.nodelist(**) = Script::NodeListRemoteValue.new(**)
def self.htmlcollection(**) = Script::HTMLCollectionRemoteValue.new(**)
def self.node(**) = Script::NodeRemoteValue.new(**)
def self.window(**) = Script::WindowProxyRemoteValue.new(**)
end

# @api private
Expand Down Expand Up @@ -866,6 +926,31 @@ class Target < Serialization::Union
'script.realmDestroyed' => Script::RealmDestroyedParameters
}.freeze

def channel_value(**) = ChannelValue.new(**)
def channel_properties(**) = ChannelProperties.new(**)
def local_value = LocalValue
def array_local_value(**) = ArrayLocalValue.new(**)
def date_local_value(**) = DateLocalValue.new(**)
def map_local_value(**) = MapLocalValue.new(**)
def object_local_value(**) = ObjectLocalValue.new(**)
def reg_exp_value(**) = RegExpValue.new(**)
def reg_exp_local_value(**) = RegExpLocalValue.new(**)
def set_local_value(**) = SetLocalValue.new(**)
def primitive_protocol_value = PrimitiveProtocolValue
def undefined_value(**) = UndefinedValue.new(**)
def null_value(**) = NullValue.new(**)
def string_value(**) = StringValue.new(**)
def number_value(**) = NumberValue.new(**)
def boolean_value(**) = BooleanValue.new(**)
def big_int_value(**) = BigIntValue.new(**)
def remote_reference = RemoteReference
def shared_reference(**) = SharedReference.new(**)
def remote_object_reference(**) = RemoteObjectReference.new(**)
def serialization_options(**) = SerializationOptions.new(**)
def realm_target(**) = RealmTarget.new(**)
def context_target(**) = ContextTarget.new(**)
def target = Target

# @api private
# @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
# @see https://w3c.github.io/webdriver-bidi/#command-script-addPreloadScript
Expand Down
Loading
Loading