Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rb][BiDi] Add Script module commands and types #12082

Open
wants to merge 5 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
[rb][bidi] added non-primitive, remote and special number type
  • Loading branch information
TamsilAmani committed Jun 22, 2023
commit 2c62d0a4655335ea8792302f2620c18a511bea3c
39 changes: 39 additions & 0 deletions rb/lib/selenium/webdriver/bidi/script/non_primitive_type.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# frozen_string_literal: true

# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

module Selenium
module WebDriver
class BiDi
module NonPrimitiveType
ARRAY = 'array'
DATE = 'date'
MAP = 'map'
OBJECT = 'object'
REGULAR_EXPRESSION = 'regexp'
SET = 'set'

def self.find_by_name(name)
NonPrimitiveType.constants.each do |type|
return true if name.casecmp(type)
end
end
end
end
end
end
48 changes: 48 additions & 0 deletions rb/lib/selenium/webdriver/bidi/script/remote_type.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# frozen_string_literal = true

# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

module Selenium
module WebDriver
class BiDi
module RemoteType
SYMBOL = 'symbol'
FUNCTION = 'function'
WEAK_MAP = 'weakmap'
WEAK_SET = 'weakset'
ITERATOR = 'iterator'
GENERATOR = 'generator'
ERROR = 'error'
PROXY = 'proxy'
PROMISE = 'promise'
TYPED_ARRAY = 'typedarray'
ARRAY_BUFFER = 'arraybuffer'
NODE_LIST = 'nodelist'
HTML_COLLECTION = 'htmlcollection'
NODE = 'node'
WINDOW = 'window'

def self.find_by_name(name)
RemoteType.constants.each do |type|
return true if name.casecmp(type)
end
end
end
end
end
end
31 changes: 31 additions & 0 deletions rb/lib/selenium/webdriver/bidi/script/special_number_type.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# frozen_string_literal = true

# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

module Selenium
module WebDriver
class BiDi
module SpecialNumberType
NAN = 'NaN'
MINUS_ZERO = '-0'
INFINITY = 'Infinity'
MINUS_INFINITY = '-Infinity'
end
end
end
end