selenium-webdriver 4.32.0 → 4.38.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 (53) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +46 -5
  3. data/README.md +1 -1
  4. data/bin/linux/selenium-manager +0 -0
  5. data/bin/macos/selenium-manager +0 -0
  6. data/bin/windows/selenium-manager.exe +0 -0
  7. data/lib/selenium/webdriver/atoms/findElements.js +19 -18
  8. data/lib/selenium/webdriver/atoms/isDisplayed.js +2 -2
  9. data/lib/selenium/webdriver/atoms.rb +2 -2
  10. data/lib/selenium/webdriver/bidi/browser.rb +64 -0
  11. data/lib/selenium/webdriver/bidi/browsing_context.rb +1 -1
  12. data/lib/selenium/webdriver/bidi/network/cookies.rb +5 -8
  13. data/lib/selenium/webdriver/bidi/network/intercepted_request.rb +16 -4
  14. data/lib/selenium/webdriver/bidi/network/intercepted_response.rb +20 -6
  15. data/lib/selenium/webdriver/bidi/network/url_pattern.rb +1 -1
  16. data/lib/selenium/webdriver/bidi/network.rb +12 -9
  17. data/lib/selenium/webdriver/bidi.rb +1 -1
  18. data/lib/selenium/webdriver/chrome/driver.rb +2 -2
  19. data/lib/selenium/webdriver/chromium/options.rb +2 -2
  20. data/lib/selenium/webdriver/common/child_process.rb +4 -0
  21. data/lib/selenium/webdriver/common/driver.rb +8 -8
  22. data/lib/selenium/webdriver/common/driver_extensions/has_file_downloads.rb +7 -1
  23. data/lib/selenium/webdriver/common/error.rb +3 -3
  24. data/lib/selenium/webdriver/common/interactions/key_actions.rb +4 -4
  25. data/lib/selenium/webdriver/common/interactions/pointer_actions.rb +10 -10
  26. data/lib/selenium/webdriver/common/interactions/pointer_input.rb +6 -6
  27. data/lib/selenium/webdriver/common/keys.rb +9 -0
  28. data/lib/selenium/webdriver/common/manager.rb +2 -0
  29. data/lib/selenium/webdriver/common/options.rb +20 -11
  30. data/lib/selenium/webdriver/common/platform.rb +1 -3
  31. data/lib/selenium/webdriver/common/proxy.rb +1 -0
  32. data/lib/selenium/webdriver/common/service.rb +10 -10
  33. data/lib/selenium/webdriver/common/virtual_authenticator/credential.rb +4 -4
  34. data/lib/selenium/webdriver/common/wait.rb +1 -1
  35. data/lib/selenium/webdriver/common/zipper.rb +12 -2
  36. data/lib/selenium/webdriver/edge/driver.rb +2 -2
  37. data/lib/selenium/webdriver/firefox/driver.rb +2 -2
  38. data/lib/selenium/webdriver/firefox/service.rb +2 -2
  39. data/lib/selenium/webdriver/ie/driver.rb +2 -2
  40. data/lib/selenium/webdriver/remote/driver.rb +2 -2
  41. data/lib/selenium/webdriver/safari/driver.rb +2 -2
  42. data/lib/selenium/webdriver/support/block_event_listener.rb +2 -2
  43. data/lib/selenium/webdriver/support/event_firing_bridge.rb +3 -3
  44. data/lib/selenium/webdriver/version.rb +1 -1
  45. data/lib/selenium/webdriver.rb +4 -5
  46. data/selenium-webdriver.gemspec +2 -2
  47. metadata +7 -12
  48. data/lib/selenium/webdriver/bidi/log/base_log_entry.rb +0 -35
  49. data/lib/selenium/webdriver/bidi/log/console_log_entry.rb +0 -35
  50. data/lib/selenium/webdriver/bidi/log/filter_by.rb +0 -40
  51. data/lib/selenium/webdriver/bidi/log/generic_log_entry.rb +0 -33
  52. data/lib/selenium/webdriver/bidi/log/javascript_log_entry.rb +0 -33
  53. data/lib/selenium/webdriver/bidi/log_inspector.rb +0 -147
@@ -1,35 +0,0 @@
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
- module Selenium
21
- module WebDriver
22
- class BiDi
23
- class BaseLogEntry
24
- attr_accessor :level, :text, :timestamp, :stack_trace
25
-
26
- def initialize(level:, text:, timestamp:, stack_trace:)
27
- @level = level
28
- @text = text
29
- @timestamp = timestamp
30
- @stack_trace = stack_trace
31
- end
32
- end # BaseLogEntry
33
- end # BiDi
34
- end # WebDriver
35
- end # Selenium
@@ -1,35 +0,0 @@
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
- module Selenium
21
- module WebDriver
22
- class BiDi
23
- class ConsoleLogEntry < GenericLogEntry
24
- attr_accessor :method, :realm, :args
25
-
26
- def initialize(method:, realm:, args:, **opts)
27
- super(**opts)
28
- @method = method
29
- @realm = realm
30
- @args = args
31
- end
32
- end # ConsoleLogEntry
33
- end # BiDi
34
- end # WebDriver
35
- end # Selenium
@@ -1,40 +0,0 @@
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
- module Selenium
21
- module WebDriver
22
- class BiDi
23
- class FilterBy
24
- attr_accessor :level
25
-
26
- def initialize(level)
27
- @level = level
28
- end
29
-
30
- def self.log_level(level = nil)
31
- unless %w[debug error info warning].include?(level)
32
- raise Error::WebDriverError,
33
- "Valid log levels are 'debug', 'error', 'info' and 'warning'. Received: #{level}"
34
- end
35
- FilterBy.new(level)
36
- end
37
- end # FilterBy
38
- end # BiDi
39
- end # WebDriver
40
- end # Selenium
@@ -1,33 +0,0 @@
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
- module Selenium
21
- module WebDriver
22
- class BiDi
23
- class GenericLogEntry < BaseLogEntry
24
- attr_accessor :type
25
-
26
- def initialize(level:, text:, timestamp:, type:, stack_trace:)
27
- super(level: level, text: text, timestamp: timestamp, stack_trace: stack_trace)
28
- @type = type
29
- end
30
- end # GenericLogEntry
31
- end # BiDi
32
- end # WebDriver
33
- end # Selenium
@@ -1,33 +0,0 @@
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
- module Selenium
21
- module WebDriver
22
- class BiDi
23
- class JavascriptLogEntry < GenericLogEntry
24
- attr_accessor :type
25
-
26
- def initialize(level:, text:, timestamp:, type:, stack_trace:)
27
- super
28
- @type = 'javascript'
29
- end
30
- end # JavascriptLogEntry
31
- end # BiDi
32
- end # WebDriver
33
- end # Selenium
@@ -1,147 +0,0 @@
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
- # This file is automatically generated. Any changes will be lost!
21
-
22
- require_relative 'log/base_log_entry'
23
- require_relative 'log/generic_log_entry'
24
- require_relative 'log/console_log_entry'
25
- require_relative 'log/javascript_log_entry'
26
- require_relative 'log/filter_by'
27
-
28
- module Selenium
29
- module WebDriver
30
- class BiDi
31
- class LogInspector
32
- EVENTS = {
33
- entry_added: 'entryAdded'
34
- }.freeze
35
-
36
- LOG_LEVEL = {
37
- DEBUG: 'debug',
38
- ERROR: 'error',
39
- INFO: 'info',
40
- WARNING: 'warning'
41
- }.freeze
42
-
43
- def initialize(driver, browsing_context_ids = nil)
44
- WebDriver.logger.deprecate('LogInspector class',
45
- 'Script class with driver.script',
46
- id: :log_inspector)
47
-
48
- unless driver.capabilities.web_socket_url
49
- raise Error::WebDriverError,
50
- 'WebDriver instance must support BiDi protocol'
51
- end
52
-
53
- @bidi = driver.bidi
54
- @bidi.session.subscribe('log.entryAdded', browsing_context_ids)
55
- end
56
-
57
- def on_console_entry(filter_by = nil, &block)
58
- check_valid_filter(filter_by)
59
-
60
- on_log do |params|
61
- type = params['type']
62
- console_log_events(params, filter_by, &block) if type.eql?('console')
63
- end
64
- end
65
-
66
- def on_javascript_log(filter_by = nil, &block)
67
- check_valid_filter(filter_by)
68
-
69
- on_log do |params|
70
- type = params['type']
71
- javascript_log_events(params, filter_by, &block) if type.eql?('javascript')
72
- end
73
- end
74
-
75
- def on_javascript_exception(&block)
76
- on_log do |params|
77
- type = params['type']
78
- javascript_log_events(params, FilterBy.log_level('error'), &block) if type.eql?('javascript')
79
- end
80
- end
81
-
82
- def on_log(filter_by = nil, &block)
83
- unless filter_by.nil?
84
- check_valid_filter(filter_by)
85
-
86
- on(:entry_added) do |params|
87
- yield(params) if params['level'] == filter_by.level
88
- end
89
- return
90
- end
91
-
92
- on(:entry_added, &block)
93
- end
94
-
95
- private
96
-
97
- def on(event, &block)
98
- event = EVENTS[event] if event.is_a?(Symbol)
99
- @bidi.add_callback("log.#{event}", &block)
100
- end
101
-
102
- def check_valid_filter(filter_by)
103
- return if filter_by.nil? || filter_by.instance_of?(FilterBy)
104
-
105
- raise "Pass valid FilterBy object. Received: #{filter_by.inspect}"
106
- end
107
-
108
- def console_log_events(params, filter_by)
109
- event = ConsoleLogEntry.new(
110
- level: params['level'],
111
- text: params['text'],
112
- timestamp: params['timestamp'],
113
- type: params['type'],
114
- method: params['method'],
115
- realm: params['realm'],
116
- args: params['args'],
117
- stack_trace: params['stackTrace']
118
- )
119
-
120
- unless filter_by.nil?
121
- yield(event) if params['level'] == filter_by.level
122
- return
123
- end
124
-
125
- yield(event)
126
- end
127
-
128
- def javascript_log_events(params, filter_by)
129
- event = JavascriptLogEntry.new(
130
- level: params['level'],
131
- text: params['text'],
132
- timestamp: params['timestamp'],
133
- type: params['type'],
134
- stack_trace: params['stackTrace']
135
- )
136
-
137
- unless filter_by.nil?
138
- yield(event) if params['level'] == filter_by.level
139
- return
140
- end
141
-
142
- yield(event)
143
- end
144
- end # LogInspector
145
- end # Bidi
146
- end # WebDriver
147
- end # Selenium